SOAP Get Child Image 201211

Note: This service is not available in our interactive API option.

The SOAP call Get Child Image provides the most recent image of a child based on an active child key. The image is formatted to input specifications.

Customers can manipulate the following parameters:

  • File type (.jpeg, .gif or .bmp)
  • Width and height
  • Resolution
  • Quality

There are three parameters to use to get the required type of picture:

  • DPI (dots per inch)
  • Height (pixels)
  • Width (pixels)

A website example would be DPI=72, Height=400, Width=300.

A print example would be DPI=300, Height= (desired inches high x DPI), Width= (desired inches wide x DPI). A print picture of 4 inches high by 3 inches wide the settings would be:

  • DPI=300
  • Height=1200
  • Width=900

If you need a higher DPI, adjust the height and width accordingly, keeping in mind that the bigger the picture the bigger the payload and slower the response time.

Sample Request
Request Parameters
Response Parameters
Sample Successful Response
Sample Unsuccessful Response
Error Response Codes

Sample Request

This is an example only.

Action
http://services.ci.org/public/ci/image/2012/11/GetChildImage
URL
Prod:    https://api2.compassion.com/ci.services/image/2012/11/getchildimage?api_key=[string]
IPTest: https://api2.compassion.com/iptest/ci.services/image/2012/11/getchildimage?api_key=[string]
XML
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Header>
    <ClientReferenceId  xmlns="http://schemas.ci.org/ci/services/common/2011/04/">[string]</ClientReferenceId>
  </s:Header>
  <s:Body>
    <GetChildImageRequest xmlns="http://schemas.ci.org/public/ci/services/image/2012/11/">
      <ChildKey>[string]</ChildKey>
      <ImageRequestCriteria>
        <ImageType>Headshot</ImageType>
        <ImageFormatCriteria>
          <Width>300</Width>
          <Height>400</Height>
          <DPI>72</DPI>
          <ImageFormat>jpeg</ImageFormat>
          <Quality>100</Quality>
        </ImageFormatCriteria>
      </ImageRequestCriteria>
    </GetChildImageRequest>
  </s:Body>
</s:Envelope>

Request Parameters

Name Description Required Data Type Constraints
ChildKey Code assigned by Compassion International when the child is registered in the Child Sponsorship Program or the Leadership Development Program. Yes String Fixed 9
Height Image height in pixels Optional Numeric Default 600
Value between 1 and 5000 inclusive
Width Image width in pixels Optional Numeric Default 400
>Value between 1 and 5000 inclusive
DPI Image dots per inch Optional Numeric Default 72
Value between 1 and 1200 inclusive
Quality Image quality (a lower number is poorer quality) Optional Numeric Default 100
Value between 1 and 100 inclusive
ImageFormat Type of image format Optional String Default jpeg
Valid Values
jpeg | bmp | gif
ImageType Type of image that can be returned Optional String Default Headshot
Valid Values
Headshot | Portrait | Fullshot | Raw
ClientReferenceId Uniquely represents the transaction in the client's system. Commonly used for client correlation. Optional String Max 100
api_key Your Mashery supplied key for an application running Compassion International services. Yes String  

Response Parameters

Name Description
ChildKey Same value that was in the request.
ImageSetName Default
ImageFormat Image format chosen by the customer or the default (jpeg) if the Image Format was not included in the input.
ImageType Image Type chosen by the customer or the default (headshot) if Image Type was not included in the input.
Width Width chosen by the customer. This field is not included if the width was not included in the input.
Height Height chosen by the customer. This field is not included if the height was not included in the input.
DPI DPI chosen by the customer. This field is not included if the DPI was not included in the input.
Quality Quality chosen by the customer. This field is not included if the Quality was not included in the input.
ImageData Child image data.
The following fields are returned only if ImageType = "raw" These coordinates identify the child's head
TopCoordinate Identifying the number of pixels from top of the image to the top left corner of the child's headshot
LeftCoordinate Identifying the number of pixels from left side of the image to the top left corner of the child's headshot
HeightCoordinate The height of the child's headshot
WidthCoordinate The width of the child's headshot

Sample Successful Response

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Header>
    <ClientReferenceId xmlns="http://schemas.ci.org/ci/services/common/2011/04/">PubChldInfo_TC-002</ClientReferenceId>
    <MessageStreamId xmlns="http://schemas.ci.org/ci/services/common/2011/04/">[string]</MessageStreamId>
    <ParentMessageId xmlns="http://schemas.ci.org/ci/services/common/2011/04/"/>
    <SendersAppName xmlns="http://schemas.ci.org/ci/services/common/2011/04/">PublicSimpleRequestReplySoapService</SendersAppName>
    <SendersName xmlns="http://schemas.ci.org/ci/services/common/2011/04/">CI\esbservice</SendersName>
    <SendersTrackingId xmlns="http://schemas.ci.org/ci/services/common/2011/04/">[string]</SendersTrackingId>
    <EventSequenceNumber xmlns="http://schemas.ci.org/ci/services/common/2011/04/">8</EventSequenceNumber>
    <MessageId xmlns="http://schemas.ci.org/ci/services/common/2011/04/">[string]</MessageId>
    <RelatesTo xmlns="http://schemas.ci.org/ci/services/common/2011/04/">[string]</RelatesTo>
    <SendingNode xmlns="http://schemas.ci.org/ci/services/common/2011/04/">PublicSimpleRequestReplySoapService</SendingNode>
  </s:Header>
  <s:Body>
    <GetChildImageResponse ResponseCode="0" SchemaVersion="1.0" xmlns="http://schemas.ci.org/public/ci/services/image/2012/11/">
      <ImageRequestCriteria>
        <ImageSetName>ImageSet1</ImageSetName>
        <ImageType>Raw</ImageType>
        <ImageFormatCriteria>
          <Width>300</Width>
          <Height>400</Height>
          <DPI>72</DPI>
          <ImageFormat>jpeg</ImageFormat>
          <Quality>100</Quality>
        </ImageFormatCriteria>
      </ImageRequestCriteria>
      <ChildKey>aannnnnnn</ChildKey>
      <Image SchemaVersion="1.0" xmlns="http://schemas.ci.org/public/ci/2011/04/common">
        <ImageFormat>jpeg</ImageFormat>
        <ImageType>Raw</ImageType>
        <ImageData>[blob]</ImageData>
        <TopCoordinate>86</TopCoordinate>
        <LeftCoordinate>300</LeftCoordinate>
        <HeightCoordinate>164</HeightCoordinate>
        <WidthCoordinate>117</WidthCoordinate>
      </Image>
    </GetChildImageResponse>
  </s:Body>
</s:Envelope>

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")

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Header>
    <ClientReferenceId xmlns="http://schemas.ci.org/ci/services/common/2011/04/">PubChldInfo_TC-002</ClientReferenceId>
    <MessageStreamId xmlns="http://schemas.ci.org/ci/services/common/2011/04/">[string]</MessageStreamId>
    <ParentMessageId xmlns="http://schemas.ci.org/ci/services/common/2011/04/"/>
    <SendersAppName xmlns="http://schemas.ci.org/ci/services/common/2011/04/">PublicSimpleRequestReplySoapService</SendersAppName>
    <SendersName xmlns="http://schemas.ci.org/ci/services/common/2011/04/">NT AUTHORITY\SYSTEM</SendersName>
    <SendersTrackingId xmlns="http://schemas.ci.org/ci/services/common/2011/04/">[string]</SendersTrackingId>
    <EventSequenceNumber xmlns="http://schemas.ci.org/ci/services/common/2011/04/">8</EventSequenceNumber>
    <MessageId xmlns="http://schemas.ci.org/ci/services/common/2011/04/">[string]</MessageId>
    <RelatesTo xmlns="http://schemas.ci.org/ci/services/common/2011/04/">[string]</RelatesTo>
    <SendingNode xmlns="http://schemas.ci.org/ci/services/common/2011/04/">PublicSimpleRequestReplySoapService</SendingNode>
  </s:Header>
  <s:Body>
    <GetChildImageResponse ResponseCode="0SchemaVersion="1.0xmlns="http://schemas.ci.org/public/ci/services/image/2012/11/">
      <ErrorResponse SchemaVersion="1.0" xmlns="http://schemas.ci.org/ci/services/common/2011/04/">
        <ErrorName>Validation Error</ErrorName>
        <DateTimestamp>2015-01-26T13:00:38.5607483-07:00</DateTimestamp>
        <SendersAppName>PublicSimpleRequestReplySoapService</SendersAppName>
        <ServiceName>PublicSimpleRequestReplySoapService</ServiceName>
        <ErrorId>[guid]</ErrorId>
        <ErrorCode>4004</ErrorCode>
        <ErrorMessage>Incorrect parameter: ChildKey must follow the correct format 'AANNNNNNN'.</ErrorMessage>
      </ErrorResponse>
    </GetChildImageResponse>
  </s:Body>
</s:Envelope> 

Error Response Codes

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

HTTP Error Response HTTP 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 Referee
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

Docs Navigation