Contract Shipping

Code Samples for Contract Shipping: Java (.zip) | PHP (.zip) | C# (.zip)

Get Manifests – REST

Summary

Name: Get Manifests
Reason to Call: To retrieve links to every manifest within a given date range.
Input:

A "start" and "end" date range.

Output:

The output is a list of links to the manifests that were created by the Transmit Shipments service.

Error Example: The start date cannot be a later date than the end date.
Typical Prior Call: Transmit Shipments
Typical Next Call: Get Manifest
Version history: Release notes
Get Manifests – Summary of Service

Get Manifests – Summary of Service

Request Details

Request – Structure for Get Manifests

Endpoint

GET https://XX/rs/{mailed by customer}/{mobo}/manifest?start=YYYYMMDD&end=YYYYMMDD

Replace... With...

XX (Development)

ct.soa-gw.canadapost.ca

XX (Production)

soa-gw.canadapost.ca

{mailed by customer}

your customer number

{mobo}

the mailed on behalf of customer number or repeat your customer number

YYYYMMDD

the start and end dates respectively

HTTP Headers

HTTP Header Variable

Value

Accept

application/vnd.cpc.manifest-v8+xml (Note: */* in place of the header value will return an error)

Authorization

Basic {Base64 encoding of userid:password}

Accept-language

en-CA or fr-CA

Body

None

Request – Elements

The Get Manifests service does not require any input XML data.

In the query string of the request, pass the "from" and "to" dates representing the date range of your search.

The "start" date is mandatory.

The "end" date is optional. If the "end" date is not provided, it will default to the current date. (i.e. today’s date).

Response Details

Response – Elements

The following table describes the XML fields in the response.

For a detailed view of the hierarchy of the response, see the diagram below.

Get Manifests – Detailed View of Response Elements
Element Name Type Description

manifests

Complex

This is the top level of the structure.

link

Complex

Contained within manifests.

Each link is essentially a pointer giving the client access to the information about an individual manifest.

The system will generate separate manifests:

  • by Canadian vs. international shipments.
  • by mobo
  • by paid-by-customer
  • by contract number

May occur 1 … N times.

Each link element allows the client to retrieve information about one of the manifests.

See Provided endpoints for a description of link attributes.

The link element is "Complex" because it contains a number of attributes. The link element does not contain any sub-elements.

Response – XML Diagram

The following diagram shows the top level response.

Get Manifests – Structure of XML Response

Get Manifests – Structure of XML Response

Note: the attribute "index" shown in the diagram above is not used in the Get Manifests service.

Response – Possible Error Responses

If no manifests are found, the XML response will be 200 and there will be an empty "manifest" structure.

Parameter error messages for HTTP response 400 are shown below. (See HTTP status codes for more information)

Code Message

9105

A required query parameter was not provided in the request.

9116

The "startDate" cannot be a later date than the "endDate".

Examples

Sample REST XML Request – Get Manifests

GET https://XX/rs/123456789/123456789/manifest?start=20100324&end=20100405
Accept:application/vnd.cpc.manifest-v8+xml
Authorization:Basic s7HD7gwsennesc==

Sample REST XML Response – Get Manifests

<manifests>
<link rel="manifest" href="https://XX/rs/11111111/222222222/manifest/33333333" media-type="application/vnd.cpc.manifest-v6+xml"></link>
<link rel="manifest" href="https://XX/rs/11111111/222222222/manifest/33333333" media-type="application/vnd.cpc.manifest-v6+xml"></link>
<link rel="manifest" href="https://XX/rs/11111111/222222222/manifest/33333333" media-type="application/vnd.cpc.manifest-v6+xml"></link>
</manifests>