Tracking

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

Get Delivery Confirmation Certificate – REST

Summary

Name: Get Delivery Confirmation Certificate
Reason to Call: To retrieve the image of the delivery confirmation certificate (which is a document showing proof of delivery with details) for a given parcel.
Input: PIN
Output: PDF document
Error Examples: PIN not found, signature not available
Typical Prior Calls: Get Tracking Summary, Get Tracking Details
Typical Next Call: No directly related calls
Version history: Release notes

Request Details

Request – Structure for Get Delivery Confirmation Certificate

Endpoint

GET https://XX/vis/certificate/{pin number}

Replace... With...

XX (Development)

ct.soa-gw.canadapost.ca

XX (Production)

soa-gw.canadapost.ca

{pin number}

the parcel PIN

HTTP Headers

HTTP Header Variable

Value

Accept

application/vnd.cpc.track-v2+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 PIN is the only parameter required for this service, as shown below.

Get Delivery Confirmation Certificate – REST - Request Parameters
Parameter Name Type of Parameter Description/Size/Format

Access by PIN

{pin number}

Directly embedded in URI

The PIN (Parcel Identification Number) assigned by Canada Post on creation of the shipping label and used for tracking purposes.

(12, 13 or 16 characters)

When executing a request by PIN, this is mandatory and is the only parameter necessary.

The {pin number} is embedded into the URI as follows:

XX/vis/certificate/{pin number}

Response – Possible Error Responses

A correctly structured request may receive the following application error response:

Code Message

007

No Delivery Information Available

Response Details

Response – Elements

Only simple types are shown in the table below. For complex types, see the diagram.

Get Delivery Confirmation Certificate – REST – Response Elements
Element Name Description
delivery-confirmation-certificate The top level element of the XML response structure.

filename

A possible file name to be used based on the PIN

image

The Base64 encoded string of bytes for the file

mime-type

application/pdf

Response – XML Diagram

The response will contain the delivery-confirmation-certificate or the messages structure.

XML diagram for Get Delivery Confirmation Certificate Response

XML diagram for Get Delivery Confirmation Certificate Response Message diagram

Examples

Sample REST XML Request – Get Delivery Confirmation Certificate

GET https://XX/vis/certificate/1847430072172051

Sample REST XML Response – Get Delivery Confirmation Certificate

<delivery-confirmation-certificate>
<filename>1371134583769923.jpg</filename>
<image>/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGB gcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICI sIxwcKDcpLDAHIYIUESDFSKVIOWVHDVHKSDJHVSDNVSFDMVN SDVNSDJVSDSWEHDVKJKJWE/wAARCABfAZADASIAAhEBAxEB8 QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoLAtRAA AgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBka </image>
<mime-type>image/jpg</mime-type>
</delivery-confirmation-certificate>