Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Parameter

Description

Type

serviceRequestId

The service request id associated to the regulated entity.

The service request must exist.

Query string

serviceRegulatedEntities

A collection of service regulated entities.

Body

Sample request body – This is a sample which adds the values of the regulated entity ids for the specified service requestupdates the value(s) of the service request regulated entities.

Notes: Only the values should be modified. The values ids are associated to an entity id. You cannot use the same service request id when adding new regulated entities. This is a constraint in the database.This example is for service id 123 and type VESSEL. You can get a list from the GetList pageregulated entity values.

You can get all of the ids and values from the GetAll.

Code Block
languagejson
[ 
  {
       "Id": 1,"VESSEL_NM",
       "Value": "test 1 " 
  },
  {
       "Id": 2,"CDN_SHIP_IND",
       "Value": "test 2" 
  },
  {   
    "Id": 3"IMO",
       "Value": "test 3" 
  },
  {   
    "Id": 4,"OFFICIAL_NO",
       "Value": "test 4" 
  }
]

Returns

HTTP 200 - OK

Returns a list of service request regulated entities entity values with their ids, English and French display names. The ids are returned based on a sort order.Is there’s no regulated entity ids found, an empty list is returned.

Sample response body – Returns the added values.

Note: The ids will be different than this example because they’re generated from the database.

Code Block
languagejson
[
  {
    "Id": 1"VESSEL_NM",
    "Value": "test 1 "
  },
  {
    "Id": 2"CDN_SHIP_IND",
    "Value": "test 2"
  },
  {
    "Id": 3"IMO",
    "Value": "test 3"
  },
  {
    "Id": 4"OFFICIAL_NO",
    "Value": "test 4"
  }
]

Example

Note: Make sure to use the proper ids from the GetList GetAll function.

Code Block
languagec#
//Use your own service request id.
const int serviceRequetId = 1234;

//Makevar sureserviceRequestRegulatedEntities to= use the proper ids from the GetList function.await ServiceRegulatedEntityManager.GetAll(serviceRequestId);
var regulatedEntities = new List<ServiceRegulatedEntity>();
foreach {(var serviceRequestRegulatedEntity in    new ServiceRegulatedEntity
     serviceRequestRegulatedEntities)
{
         Id = 1,
         Value = "Your value"
      },
      regulatedEntities.Add(new ServiceRegulatedEntity
 
    {

        Id = 2serviceRequestRegulatedEntity.RegulatedEntityIdTypeCode,
         Value = "YourUpdated value"
      },
      new ServiceRegulatedEntity
      {
          Id = 3,
          Value = "Your value"
      },
      new ServiceRegulatedEntity
      {
          Id = 4,
          Value = "Your value"
      }
  };
  
var newServiceRegulatedEntities});
}

var updated = await ServiceRegulatedEntityManager.AddUpdate(serviceRequestId, regulatedEntities);