How to: Manage Dispatch

For information about prerequisites, see Integrate with Dispatch.

Create Dispatch Attributes

To create Dispatch Attributes, call the Post Dispatch Attribute endpoint and pass the following required members in the request body:

MemberDescriptionRemarks
attributes > nameName of the attribute.string
minLength: 1
maxLength: 32
pattern: ^[a-zA-Z]{1,32}$
attributes > dataTypeData type of the attribute.string
Enum:
[ string, number, boolean, object, array ]
attributes > validation > range > min & maxField to specify the range that the attribute value must lie. In the case of the "string" datatype, the range will be the length of a string value. This validation allowed only for string and number type of attributes.number

Also, specify the dispatchTypeId in the path parameter.

The JSON request body should be similar to the following:

{
  "attributes": [
    {
      "name": "string",
      "description": "string",
      "tags": [
        "string"
      ],
      "dataType": "string",
      "indexed": false,
      "defaultValue": {},
      "validation": {
        "range": {
          "min": 0,
          "max": 0
        },
        "regex": "string",
        "valueOneOf": [
          "string"
        ],
        "required": false
      }
    }
  ],
  "_event_meta": {}
}

Retrieve Attribute Config of a Dispatch

To retrieve the attributes of a Dispatch, call the Get Dispatch Attribute endpoint and specify the dispatchTypeId in the path parameter.

Create a Dispatch

To create a Dispatch, call the Create Dispatch endpoint and pass the following required members in the request body:

MemberDescriptionRemarks
dispatchTypeIdID of the Dispatch Type.string
minLength: 4
maxLength: 64
dispatchRef (optional)External dispatch reference.string
minLength: 4
maxLength: 64
dispatchTypeName (optional)Dispatch type name.string
minLength: 4
maxLength: 64

The JSON request body should be similar to the following:

{
  "dispatchRef": "string",
  "dispatchTypeName": "string",
  "dispatchTypeId": "string",
  "jobs": [
    "string"
  ],
  "participants": [
    "string"
  ],
  "customData": {
    "additionalProp1": {}
  },
  "_event_meta": {},
  "additionalProp1": {}
}

Add Job to a Dispatch

To add a Job to a Dispatch, call the Add Job to Dispatch endpoint and pass the following required members in the request body:

MemberDescriptionRemarks
jobIdID of the Job.string
minLength: 1
maxLength: 64
callback > urlCallback URL to check whether a job can be added to a dispatch.string

The JSON request body should be similar to the following:

{
  "jobId": "string",
  "callback": {
    "url": "string",
    "headers": [
      {
        "key": "string",
        "value": "string"
      }
    ]
  },
  "_event_meta": {}
}

To add multiple Jobs to a Dispatch, call the Add Multiple Jobs to Dispatch endpoint and pass the following required members in the request body:

MemberDescriptionRemarks
jobsID of the Jobs to be added to the dispatch.string
minLength: 1
maxLength: 64
callback > urlCallback URL to check whether a job can be added to a dispatch.string

The JSON request body should be similar to the following:

{
  "jobs": [
    "string"
  ],
  "callback": {
    "url": "string",
    "headers": [
      {
        "key": "string",
        "value": "string"
      }
    ]
  },
  "_event_meta": {}
}

Add Participant to a Dispatch

To add a Participant to a Dispatch, call the Add Participant to Dispatch endpoint and pass the following required members in the request body:

MemberDescriptionRemarks
participantIdID of the Participant.string
minLength: 1
maxLength: 64
callback > urlCallback URL to check whether a participant can be added to a dispatch.string

The JSON request body should be similar to the following:

{
  "participantId": "string",
  "callback": {
    "url": "string",
    "headers": [
      {
        "key": "string",
        "value": "string"
      }
    ]
  },
  "_event_meta": {}
}

To add multiple Participants to a Dispatch, call the Add Multiple Participant to Dispatch endpoint and pass the following required members in the request body:

MemberDescriptionRemarks
participantsID of the Participants to be added to the dispatch.string
minLength: 1
maxLength: 64
minItems: 1
maxItems: 10

The JSON request body should be similar to the following:

{
  "participants": [
    "string"
  ],
  "_event_meta": {}
}

Update the status and sub-status of a Dispatch

To update the status and sub-status of a Dispatch, call the Change Status and Sub-Status of Dispatch endpoint and pass the required members in the request body. Also, specify the dispatchId in the path parameter.

MemberDescriptionRemarks
statusDispatch status.string
Enum:[ CLOSED, PENDING_CLOSURE, IN_PROGRESS ]

The JSON request body should be similar to the following:

{
  "status": "CLOSED",
  "subStatus": "string",
  "_event_meta": {}
}

To update the sub-status of a Dispatch, call the Change Sub-Status of Dispatch endpoint and pass the following required members in the request body. Also, specify the dispatchId in the path parameter.

MemberDescriptionRemarks
subStatusDispatch sub-status.string
maxLength: 64

The JSON request body should be similar to the following:

{
  "subStatus": "string",
  "_event_meta": {}
}

Remove Job from a Dispatch

To remove a Job from a Dispatch, call the Remove Job from Dispatch endpoint. Specify dispatchId and jobId in the path parameter.

The JSON request body should be similar to the following:

{
  "_event_meta": {}
}

To remove multiple Jobs from a Dispatch, call the Remove Multiple Jobs from the Dispatch endpoint. Specify dispatchId in the path parameter. Pass the following required members in the request body:

MemberDescriptionRemarks
jobsJob IDs of the Jobs to be removed from the Dispatch.string
minItems: 1
minLength: 1
maxLength: 64

The JSON request body should be similar to the following:

{
  "jobs": [
    "string"
  ],
  "_event_meta": {}
}

Remove Participant from a Dispatch

To remove a Participant from a Dispatch, call the Remove Participant from Dispatch endpoint. Specify dispatchId and participantId in the path parameter.

The JSON request body should be similar to the following:

{
  "_event_meta": {}
}