GLS ShipIT 3.5.15 GLS ShipIT - REST services

Schedule sporadic date

# Accessing the REST service

The endpoints for the centrally hosted services can be obtained from your primary GLS contact and will be given with your credentials for the Service.

If you are connecting to a locally installed GLS ShipIT, you have to adapt the URL to point to the host (and port) in your network where the GLS ShipIT backend is running. E.g. https://10.10.10.10:8443/backend/rs/sporadiccollection

This service is about sporadic collections.

# Schedule sporadic date

## orderSporadicCollection

Schedules a sporadic collection for a contact. Please contact your depot for any queries regarding your pickups.

### Request data

Several parameters can be passed to the service.

Name | Expression in webservices | Field length | Type | Format | Mandatory/Optional | Restrictions | Level | Description
--- | --- | --- | --- | --- | --- | --- | --- | ---
Shipper identifier | ContactID | 10 | alphanumeric |  | Mandatory | - |  | The external identifier for the shipper
Expected pickup date | PreferredPickUpDate | 10 | alphanumeric | YYYY-MM-DD | Mandatory | - |  | The date for the expected pickup in the depot
Number of parcels | NumberOfParcels | 6 | numeric |  | Mandatory | >0 |  | The total number of parcel for pickup in the depot
Product type | Product | 7 | alphanumeric |  | Mandatory | Parcel or Express |  | The type of the product in the pickup
Expected Total Weight | ExpectedTotalWeight | 10 | decimal |  | Optional | >0 |  | The total aggregated weight of the parcels for pickup
Hazardous Goods Flag | ContainsHazGoods | 5 | boolean |  | Optional | true or false |  | Indicates if the parcels for pickup contain hazardous goods
Additional Information | AdditionalInformation | - | alphanumeric |  | Optional | - |  | Additional information relevant for the scheduling of the sporadic pickup

In the case of the PreferredPickUpDate not being not possible (Sundays, holiday, dates in the past, etc), it will be adjusted to the next available working day and the actual pickup date will be present in the PreferredPickUpDate property in the response.

The REST method is available at sub-path `/sporadiccollection` with http request method `POST`

Parameter | Mandatory | Location in Request | Description
--- | --- | --- | ---
request | TRUE | request body | The eu.glsgroup.fpcs.datatypes.soap.v1.sporadiccollection.SporadicCollection with the request parameters.

### Input validation

- The ContactID may not be empty and must reference an existing shipper external id.
- The PreferredPickUpDate may not be empty, and must be in the format "yyyy-MM-dd"
- The Product may not be empty, and must be one of the expected articles.
- The NumberOfParcels must be a positive integer value.

### Response data

Name | Expression in webservices | Field length | Type | Format | Mandatory/Optional | Restrictions | Level | Description
--- | --- | --- | --- | --- | --- | --- | --- | ---
Estimated pickup date | EstimatedPickUpDate | 10 | alphanumeric | YYYY-MM-DD | Mandatory | - |  | The scheduled date for the next available date for pickup in the depot

The REST response is eu.glsgroup.fpcs.datatypes.soap.v1.sporadiccollection.SporadicCollectionResponse or one of the following faults:

- eu.glsgroup.fpcs.datatypes.soap.v1.common.InvalidFieldValueFault

To schedule a sporadic date:

### Sample request

POST https://localhost:8443/backend/rs/sporadiccollection
POST data:
{
"ContactID":"1234567890",
"PreferredPickUpDate":"2023-04-18",
"NumberOfParcels":1,
"ExpectedTotalWeight":20.0,
"Product":"PARCEL",
"ContainsHazGoods":true,
"AdditionalInformation":"xyz"
}

If the request was successful:

{
"EstimatedPickUpDate":"2023-04-18"
}

If a mandatory parameter is not provided, a HTTP response with error code '400 Bad Request' is returned:

Response headers:
HTTP/1.1 400 Bad Request
message: The Mandatory parameter ContactID is not set
error: MANDATORY_PARAMETER_NOT_SET
Content-Length: 0
args: ["ContactID"]

If the ContactID is not recognized:

Response headers:
HTTP/1.1 400 Bad Request
Connection: keep-alive
message: Referenced object ContactID with id nan not found
serverExecutionTime: 22
error: REFERENCED_OBJECT_NOT_FOUND
Content-Length: 0
args: ["ContactID","nan"]
Date: Thu, 25 May 2023 19:01:54 GMT