REST Get Project Age Groups V1

The REST call Get Project Age Groups provides a project's basic hourly, daily, and monthly information based on age groups. This service applies only to CDSP Implementors.

The service returns JSON as default. The service will also return XML. This is controlled by the Accept parameter in the Message Header (i.e., for XML, it should be "Accept: application/xml" and for JSON, it should be "Accept: application/json").

CDSP is Compassion International's Child Development Sponsorship Program which connects one child with one sponsor to help that child develop into the extraordinary individual which God ordained.

The CDSP program provides the following through sponsorship:

  • Educational opportunities
  • Healthcare, supplemental nutrition, and health education
  • Life-skills training
  • A safe and loving environment in which to learn and play
  • The opportunity to hear the gospel of Jesus Christ and be discipled

Sample Request
Request Parameters
Response Parameters
XML Sample Successful Response
JSON Sample Successful Response
Sample Unsuccessful Responses
Error Response Codes

Sample Request

This is an example only.

IPTest: https://api2.compassion.com/iptest/ci/v1/cdspimplementors/{projectkey}/agegroups?ClientReferenceId=[string]&api_key=[string]

Production: https://api2.compassion.com/ci/v1/cdspimplementors/{projectkey}/agegroups?ClientReferenceId=[string]&api_key=[string]

Request Parameters

Name Description Required Data Type Constraints
ProjectKey Key identifying a CDSP Implementor Yes String Fixed 5
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

Name Description Data Type Returned
ProjectKey Same value as input string
LowAge Youngest age the below data applies to string
HighAge Oldest age the below data applies to
string
SchoolMonths Months of the year the project is in session string
SchoolDays Days of the week the project is in session string
SchoolHours How many hours the related activity meets string

XML Sample Successful Response

<ProjectAgeGroupCollection rowcount="4" xmlns="http://schemas.ci.org/ci/services/project/2013/09/"> 
  <ProjectAgeGroup xmlns="http://schemas.ci.org/ci/common/eim/2013/09/">
    <ProjectKey>[string]</ProjectKey>
    <LowAge>6</LowAge>
    <HighAge>7</HighAge>
    <SchoolMonths>February,March,April,June,July,August,October,November</SchoolMonths>
    <SchoolDays>Monday,Tuesday,Wednesday,Thursday,Friday</SchoolDays>
    <SchoolHours>15</SchoolHours
  </ProjectAgeGroup
  <ProjectAgeGroup xmlns="http://schemas.ci.org/ci/common/eim/2013/09/">
    <ProjectKey>[string]</ProjectKey>
    <LowAge>8</LowAge>
    <HighAge>9</HighAge>
    <SchoolMonths>February,March,April,June,July,August,October,November</SchoolMonths>
    <SchoolDays>Monday,Tuesday,Wednesday,Thursday,Friday</SchoolDays>
    <SchoolHours>20</SchoolHours
  </ProjectAgeGroup
  <ProjectAgeGroup xmlns="http://schemas.ci.org/ci/common/eim/2013/09/">
    <ProjectKey>[string]</ProjectKey>
    <LowAge>10</LowAge>
    <HighAge>11</HighAge>
    <SchoolMonths>February,March,April,June,July,August,October,November</SchoolMonths>
    <SchoolDays>Monday,Tuesday,Wednesday,Thursday,Friday</SchoolDays>
    <SchoolHours>30</SchoolHours
  </ProjectAgeGroup>  
  <ProjectAgeGroup xmlns="http://schemas.ci.org/ci/common/eim/2013/09/">
    <ProjectKey>[string]</ProjectKey>
    <LowAge>12</LowAge>
    <HighAge>14</HighAge>
    <SchoolMonths>February,March,April,June,July,August,October,November</SchoolMonths>
    <SchoolDays>Monday,Tuesday,Wednesday,Thursday,Friday</SchoolDays>
    <SchoolHours>40</SchoolHours
  </ProjectAgeGroup
</ProjectAgeGroupCollection>

JSON Sample Successful Response

{
  "rowcount":"4",
  "projectAgeGroupCollection":
[
  {"projectKey":"[string]",
    "lowAge"
:"3",
    "highAge"
:"5",
    "schoolMonths"
:"January,February,March,April,May,June,July,August,September,October,November",
    "schoolDays"
:"Sunday,Monday,Tuesday,Wednesday,Thursday,Saturday",
    "schoolHours"
:"18"
  },
  {"projectKey"
:"[string]",
    "lowAge":"6",
    "highAge":"8",
    "schoolMonths"
:"January,February,March,April,May,June,July,August,September,October,November", 
    "schoolDays":"Sunday,Monday,Tuesday,Wednesday,Thursday,Saturday",
    "schoolHours":"24"
  },
  {"projectKey":"[string]",
    "lowAge":"9",
    "highAge":"11",
    "schoolMonths":"January,February,March,April,May,June,July,August,September,October,November",
    "schoolDays":"Sunday,Monday,Tuesday,Wednesday,Thursday,Saturday",
    "schoolHours":"30"
  },
  {"projectKey":"[string]",
    "lowAge":"12",
    "highAge":"14",
    "schoolMonths":"January,February,March,April,May,June,July,August,September,October,November",
    "schoolDays":"Sunday,Monday,Tuesday,Wednesday,Thursday,Saturday",
    "schoolHours":"30"
  }
]
}

Sample Unsuccessful Responses

XML Unsuccessful Response
<Error
  <ID>[string]</ID
  <Message>Invalid project key. Project key must be 2 alpha characters followed by 3 numeric characters.</Message>
</Error>
JSON Unsuccessful Response
{
  "error": {
    "id": "[string]"
    "message""Invalid project key. Project key must be 2 alpha characters followed by 3 numeric characters."
  }
}

Error Response Codes

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 Referrer
HTTP 404 Requested Resource Not Found
HTTP 408 Request Timeout
HTTP 414 Request URI Too Long
HTTP 500 Internal Server Error / Parameter Failure
HTTP 502 Bad Gateway
HTTP 503 API Maintenance / Service Unavailable
HTTP 504 Gateway Timeout

2 Comments

  1. Emanuel Cino9 years ago

    Hi all,

    I noticed the service is not working for a lot of Project keys. Is this service still maintained ? Exemple of failing project keys : TZ708, TZ965, UG829, EI440, EI124, ...

  2. Unknown8 years ago

    Currently these Project Keys have no ProjectAgeGroups, we also have a bug in this service in production that will tell you { "error": { "id": "...", "message": "Internal system error has occurred. Contact the Customer Support Desk (CSD) for further investigation. The supplied Error Id will be necessary for analysis." } } instead of telling you Data not Found. Please modify your client to have these errors mean Data not found, because we are having problems debugging and solving due to other priorites.

New comments are not being accepted at this time.

Docs Navigation