OUTSOURCE JOBS

Description: This API is used by the server to receive data to store as outsourced jobs. Server can receive multiple jobs.


A. URL:

http://ctsgtest.com/api/outsource/job/receive/
 

B. Method:

POST
 

C. Parameters:

  1. Parameter:
    jobs
    Description:
    The job(s) data to be saved into database as outsourced jobs
    Type:
    JSON-formatted String
    JSON Values:
    Mandatory Fields
    TrackingID : the identity of the job on database. Usually the job ID.
    collectPostal : the collect address' postal code for the parcel.
    collectAddress : the collect address for the parcel.
    collectContactName : the name of the parcel collection contact person.
    collectContactEmail : the email of the parcel collection contact person.
    collectContactNumber : the phone number of the collection collect contact person.
    deliverPostal : the delivery address' postal code for the parcel.
    deliverAddress : the delivery address for the parcel.
    deliverContactName : the name of the parcel delivery contact person.
    deliverContactEmail : the email of the parcel delivery contact person.
    deliverContactNumber : the phone number of the delivery collect contact person.
    parcelWeight : the ID of parcel weights for this particular job.
    parcelSize : the ID of parcel sizes for this particular job.
    jobType : the ID of job types for this particular job.
    declaredValue : declared value of the parcel.

    Example:
    [{"TrackingID":"PSTM455X","collectPostal":"117630","collectAddress":"CA","collectContactName":"123","collectContactEmail":"123","collectContactNumber":"123","deliverPostal":"498782","deliverAddress":"DA","deliverContactName":"123","deliverContactEmail":"123","deliverContactNumber":"123","parcelWeight":"5","parcelSize":"1","jobType":"urgent","declaredValue":"0"},{"TrackingID":"PSTM456X","collectPostal":"117630","collectAddress":"CA","collectContactName":"123","collectContactEmail":"123","collectContactNumber":"123","deliverPostal":"498782","deliverAddress":"DA","deliverContactName":"123","deliverContactEmail":"123","deliverContactNumber":"123","parcelWeight":"5","parcelSize":"1","jobType":"urgent","declaredValue":"0"}]
  2. Parameter:
    id
    Example:
    193
    Type:
    String
    Description:
    the ID of the user making the API call
  3. Parameter:
    key
    Example:
    123
    Type:
    String
    Description:
    the API key of the user making the API call
  4. Parameter:
    hsh
    Example:
    16d042ea4e74b6a48be3775b68fd8ce6
    Type:
    String
    Description:
    Secret code that is generated with the API call.
    It is an MD5 encryption of the string concatenation from the values of: APIKey + APISecret + UserID.

D. Response example:

{ "STATUS": "SUCCESS", "MESSAGE": "JOBS SAVED IN DATABASE", "DATA": [ { "status": "SUCCESS", "id": 2000003068 }, { "status": "SUCCESS", "id": 2000003069 } ], "ADDITIONAL_MESSAGE": "ALL JOBS SAVED TO DB." }
{
  "STATUS": "SUCCESS",
  "MESSAGE": "JOBS SAVED IN DATABASE",
  "DATA": [
    {
      "status": "SUCCESS",
      "id": 2000003068
    },
    {
      "status": "SUCCESS",
      "id": 2000003069
    }
  ],
  "ADDITIONAL_MESSAGE": "ALL JOBS SAVED TO DB."
}
							

E. Example of API Call:

POST Receive Job

Result