Returns

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

Get Open Return Template – REST

Summary

Name: Get Open Return Template
Reason to Call:

To retrieve the links and other information related to a previously created Open Return Template. Get Open Return Template is not typically used during normal operations but may be useful for recovery from a communication or other error.

Note: Any template that has been depleted (i.e., all of its artifacts have been retrieved) will be deleted and will not be accessible by this service.

Input: None – the endpoint href is a direct link to invoke this service for a specific template.
Output: The output of Get Open Return Template is identical to that of Create Open Return Template and includes the number of remaining artifacts, the links to the template itself and the corresponding Retrieve Next Open Template Artifact service.
Typical Next Call: Retrieve Next Open Return Artifact.
Version history: Release notes
Get Open Return Template – Summary of Service

Get Open Return Template – Summary of Service

Request Details

Request – Structure for Get Open Return Template

Endpoint

Invoke the link returned from a prior call to Create Open Return Template where the value of the attribute “rel” is “self”.

HTTP Headers

HTTP Header Variable

Value

Accept

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

Content-Type

application/vnd.cpc.openreturn+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

Get Open Return Template does not require any input XML data.

Response Details

The response to Get Open Return Template is identical to the response of Create Open Return Template. For response elements and the XML diagram, refer to Create Open Return Template.

Response – Possible Error Responses

In the case of an application error, an HTTP 400 level status code error response will be generated and the XML body will have an error message structure rather than the success response. For more information, see HTTP status codes.

Possible error messages for this service include the following:

HTTP Status Code Application Error Message
500 N/A Detailed schema validation error is provided.
412 9999

Examples

Sample REST XML Request – Get Open Return Template

There is no XML related to this REST request. Use the link provided by a prior request or see the soapUI project files for request examples.

Sample REST XML Response – Get Open Return Template

<open-return-info>
<artifacts-remaining>10</artifacts-remaining>
<links>
<linkrel="self"href="https://ct.soa-gw.canadapost.ca/rs/0007023211/0007023211/openreturn/349641323786705649"media-type="application/vnd.cpc.openreturn+xml"></link>
<linkrel="details"href="https://ct.soa-gw.canadapost.ca/rs/0007023211/0007023211/openreturn/349641323786705649/details"media-type="application/vnd.cpc.openreturn+xml"></link>
<linkrel="nextArtifact"href="https://ct.soa-gw.canadapost.ca/rs/0007023211/0007023211/openreturn/349641323786705649/artifact"media-type="application/pdf"></link>
</links>
</open-return-info>