Private Consigned Child Keys

The Consigned Child Keys API is a RESTful API.

This service provides external Compassion clients the ability to retrieve a list of children and their consignment expiration dates based on a consignment identifier. Children are consigned to a consignment identifier for potential sponsorship at events, concerts, or via Compassion.com or Compassion.mobi. Children whose consignment has expired will not be included in the response.

Sample Request

This is an example only.

https://api2.compassion.com/us/1/needmarketing/consignedchildkeys?consignmentid=1269375&ClientReferenceId=ddddd&api_key=xxxxx

Request Parameters

NameDescriptionRequiredData TypeConstraints
ConsignmentId The Id that child(ren) are consigned to. Yes Integer
ClientReferenceId Uniquely represents the transaction in the client's system. Optional String Max 100
api_key Your Mashery supplied key for an application running Compassion International services. Yes String

Response Parameters

NameDescription
ConsignmentId Same value that was in the request.
ISOCountryCode Two-character code assigned to a country by the International Organization for Standardization (ISO) which the children are consigned in. Currently, US is the only valid country code for consignment.
ChildKey Uniquely identifies a child.
ConsignmentExpirationDate Consignment expiration date for the child. Any child key with a consignment date that occurs in the past will be filtered out of the result set.

Abbreviated Sample Successful Response

<PublicConsignedChildKeysResponse ResponseCode="0" ClientReferenceId="ddddd">
  <ConsignmentId>12345678</ConsignmentId>
  <ISOCountryCode>US</ISOCountryCode>
  <ConsignedChildKeyCollection rowcount="1">
  <ConsignedChildKey>
    <ChildKey>String</ChildKey>
    <ConsignmentExpirationDate>yyyy-mm-ddThh:mm:ssZ</ConsignmentExpirationDate>
    </ConsignedChildKey>
    </ConsignedChildKeyCollection>
</PublicConsignedChildKeysResponse>

Abbreviated Sample Unsuccessful Response

The service operation will provide the following response when there are missing required parameters.
Exception Returned: (ResponseCode = "1", HTTP Status Code ="404")

<PublicConsignedChildKeysResponse ResponseCode="1">
  <ConsignmentId>1234567a</ConsignmentId>
  <ISOCountryCode>US</ISOCountryCode>
  <ConsignedChildKeyCollection rowcount="0"/>
  <ExceptionMessage>Incorrect data type: consignment ID can only be numeric digits (0-9).</ExceptionMessage>
</PublicConsignedChildKeysResponse>

Error Response Codes

For ResponseCode = 1, the table below indicates the HTTP error response and HTTP error message.

HTTP Error ResponseHTTP Error Message
HTTP 400 Service Parameter Failure
HTTP 401 Not Authenticated / Authorized for Service Data
HTTP 403 Not Authorized
HTTP 403 Account Inactive
HTTP 403 Over Queries Per Second Limit
HTTP 403 Over Rate Limit
HTTP 403 Unknown Referer
HTTP 404 Requested Resource Not Found
HTTP 408 Request Timeout
HTTP 414 Request URI Too Long
HTTP 500 Internal Server Error
HTTP 502 Bad Gateway
HTTP 503 API Maintenance / Service Unavailable
HTTP 504 Gateway Timeout

0 Comments

New comments are not being accepted at this time.

Docs Navigation