- Previous: REST Get Child Information V1
- Up: Private REST Services
- Next: REST Get Country V1
REST Get Community V1
The REST v1 Get Community provides information on a single community in which Compassion partners with a local church.
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").
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/communities/{id}?ClientReferenceId=[string]&api_key=[string]
Production: https://api2.compassion.com/ci/v1/communities/{id}?ClientReferenceId=[string]&api_key=[string]
Request Parameters
Name | Description | Required | Data Type | Constraints |
---|---|---|---|---|
CommunityId | Compassion system-generated identifier | Yes | String | Max 10 |
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 |
---|---|---|
CommunityId | Compassion system-generated identifier for a community | number |
CommunityName | Name of the community | string |
CountryId |
Identifier of the country in which the community is located |
number |
LocationFromClosestCity | Description that helps to locate the community on a map | string |
DistanceFromClosestCity | Textual description of the distance from the community to the closest major city | string |
ClosestCityName | Name of the major city that is closest to the community | string |
UnemploymentRate | Typical unemployment rate in the community | string |
PrimaryDiet | Description of the most common foods eaten in the community | string |
ClimateId | Identifier of the type of climate that affects the area in which the community is located | string |
ClimateDescription | Description of the type of climate in which the community is located | string |
TerrainId | Identifier of the type of terrain that exists in the area in which the community is located | string |
TerrainDescription | Description of the type of terrain in which the community is located | string |
PrimaryOccupationId | Identifier of the primary occupation within the community | number |
PrimaryOccupationCode | Three character code of the primary occupation | string |
PrimaryOccupationTitle | Title of the primary occupation | string |
MainReligionId | Identifier of the main religion within the community | number |
MainReligionDescription | Description of the main religion within the community | string |
TypicalFloorBuildingMaterialId | Identifier of the building material that is used for typical floors within the community | string |
TypicalFloorBuildingMaterialDescription | Description of the building material that is used for typical floors within the community | string |
TypicalWallBuildingMaterialId | Identifier of the building material that is used for typical walls within the community | string |
TypicalWallBuildingMaterialDescription | Description of the building material that is used for typical walls within the community | string |
TypicalRoofBuildingMaterialId | Identifier of the building material that is used for typical roofs within the community | string |
TypicalRoofBuildingMaterialDescription | Description of the building material that is used for typical roofs within the community | string |
HighestEducationAvailable | Description of the highest level of education available within the community | string |
VocationalTrainingAvailable | Description of the vocational training that is available within the community | string |
RainyMonths | Month(s) that are considered the rainy month(s) within the community | string |
PlantingMonths | Month(s) that are considered the planting month(s) within the community | string |
HarvestMonths | Month(s) that are considered the harvest month(s) within the community | string |
HungerMonths | Month(s) that are considered the hunger month(s) within the community | string |
IllnessMonths | Month(s) that are considered the illness month(s) within the community | string |
FamilyMonthlyIncome | Typical monthly income of a family in US Dollars | string |
DistanceToMedicalAssistance | Description of the distance to the neareast medical assistance - can be in kilometers, meters, minutes, hours | string |
TypicalTransportationTimeToMedicalAssistance | Time it takes to get to the nearest medical assistance | string |
MedicalTransportationType | Primary method of transportation used to reach medical help | string |
CommunityPopulation | Population of the community | string |
WarmestMonth | Month the average temperature is the hottest | string |
WarmestMonthAverageTemperature | Average temperature of the hottest month | string |
CoolestMonth | Month the average temperature is the coldest | string |
CoolestMonthAverageTemperature | Average temperature of the coldest month | string |
DateOfLastReview | Date the community information was last reviewed | string |
DateofLastUpdate | Date the community information was last updated | string |
CommonHealthProblems | Common health problems of a community | string |
EconomicNeeds | Typical economic needs of a community | string |
EducationalNeeds | Typical educational needs of a community | string |
EnvironmentComment | General comments about the environment in a community | string |
NationalReligiousHolidays | National and religious holidays celebrated in a community | string |
PrimaryEthnicGroup | Primary ethnic group(s) and language(s) spoken in a community | string |
SocialNeeds | Typical social needs of a community | string |
SpiritualNeeds | Typical spiritual needs of a community | string |
TraditionsRitualsCustoms | Traditions, rituals and customs that are typically practiced in a community | string |
PercentageOfChildrenNotInSchool | Percentage of children not in school in a community | string |
PercentageChildrenCompletingElementary | Percentage of children completeing elementary school in a community | string |
PercentageChildrenCompletingSecondary | Percentage of children completing secondary school in a community | string |
XML Sample Successful Response
<Community xmlns="http://schemas.ci.org/ci/common/eim/2013/09/">
<CommunityID>[number]</CommunityID>
<CommunityName>[string]</CommunityName>
<CountryID>[number]</CountryID>
<LocationFromClosestCity>[string]</LocationFromClosestCity>
<DistanceFromClosestCity>[string]</DistanceFromClosestCity>
<ClosestCityName>[string]</ClosestCityName>
<UnemploymentRate>0.40</UnemploymentRate>
<PrimaryDiet>Chicken, bread, beef, rice,</PrimaryDiet>
<ClimateID>3</ClimateID>
<ClimateDescription>Dry</ClimateDescription>
<TerrainID>4</TerrainID>
<TerrainDescription>Plains/Flat land</TerrainDescription>
<PrimaryOccupationID>10</PrimaryOccupationID>
<PrimaryOccupationCode>VENDOR</PrimaryOccupationCode>
<PrimaryOccupationTitle>Street Market Vendor</PrimaryOccupationTitle>
<MainReligionID>4</MainReligionID>
<MainReligionDescription>Catholic</MainReligionDescription>
<TypicalFloorBuildingMaterialID>5</TypicalFloorBuildingMaterialID>
<TypicalFloorBuildingMaterialDescription>Brick/Block/Cement</TypicalFloorBuildingMaterialDescription>
<TypicalWallBuildingMaterialID>3</TypicalWallBuildingMaterialID>
<TypicalWallBuildingMaterialDescription>Mud/Earth/Clay/Adobe</TypicalWallBuildingMaterialDescription>
<TypicalRoofBuildingMaterialID>4</TypicalRoofBuildingMaterialID>
<TypicalRoofBuildingMaterialDescription>Tin/Corrugated Iron</TypicalRoofBuildingMaterialDescription>
<HighestEducationAvailable>University</HighestEducationAvailable>
<VocationalTrainingAvailable>Computer center</VocationalTrainingAvailable>
<RainyMonths>January,February,March,December</RainyMonths>
<PlantingMonths>October,November</PlantingMonths>
<HarvestMonths>April,May</HarvestMonths>
<HungerMonths>September,October,November</HungerMonths>
<IllnessMonths>June,July,August</IllnessMonths>
<FamilyMonthlyIncome>43.20</FamilyMonthlyIncome>
<DistanceToMedicalAssistance>.5 km</DistanceToMedicalAssistance>
<TypicalTransportationTimeToMedicalAssistance>10 minutes</TypicalTransportationTimeToMedicalAssistance>
<MedicalTransportationType>Walk</MedicalTransportationType>
<CommunityPopulation>14772</CommunityPopulation>
<WarmestMonth>September</WarmestMonth>
<WarmestMonthAverageTemperature>18C</WarmestMonthAverageTemperature>
<CoolestMonth>June</CoolestMonth>
<CoolestMonthAverageTemperature>-13C</CoolestMonthAverageTemperature>
<DateOfLastReview>2007-07-17T00:00:00-06:00</DateOfLastReview>
<DateOfLastUpdate>2002-08-01T00:00:00-06:00</DateOfLastUpdate>
<CommonHealthProblems>[string]</CommonHealthProblems>
<EconomicNeeds>[string]</EconomicNeeds>
<EducationalNeeds>[string]</EducationalNeeds>
<EnvironmentComment>[string]</EnvironmentComment>
<NationalReligiousHolidays>[string]</NationalReligiousHolidays>
<PrimaryEthnicGroup>[string]</PrimaryEthnicGroup>
<SocialNeeds>[string]</SocialNeeds>
<SpiritualNeeds>[string]</SpiritualNeeds>
<TraditionsRitualsCustoms>[string]</TraditionsRitualsCustoms>
<PercentageOfChildrenNotInSchool>0.20</PercentageOfChildrenNotInSchool>
<PercentCompletingElementarySchool>0.48</PercentCompletingElementarySchool>
<PercentCompletingSecondarySchool>0.35</PercentCompletingSecondarySchool>
</Community>
JSON Sample Successful Response
{
"communityID":[number],
"communityName":"[string]",
"countryID":[number],
"locationFromClosestCity":"[string]",
"distanceFromClosestCity":"[string]",
"closestCityName":"[string]",
"unemploymentRate":"0.40",
"primaryDiet":"Chicken, bread, beef, rice,",
"climateID":"3",
"climateDescription":"Dry",
"terrainID":"4",
"terrainDescription":"Plains/Flat land",
"primaryOccupationID":10,
"primaryOccupationCode":"VENDOR",
"primaryOccupationTitle":"Street Market Vendor",
"mainReligionID":4,
"mainReligionDescription":"Catholic",
"typicalFloorBuildingMaterialID":"5",
"typicalFloorBuildingMaterialDescription":"Brick/Block/Cement",
"typicalWallBuildingMaterialID":"3",
"typicalWallBuildingMaterialDescription":"Mud/Earth/Clay/Adobe",
"typicalRoofBuildingMaterialID":"4",
"typicalRoofBuildingMaterialDescription":"Tin/Corrugated Iron",
"highestEducationAvailable":"University",
"vocationalTrainingAvailable":"Computer center",
"rainyMonths":"January,February,March,December",
"plantingMonths":"October,November",
"harvestMonths":"April,May",
"hungerMonths":"September,October,November",
"illnessMonths":"June,July,August",
"familyMonthlyIncome":"43.20",
"distanceToMedicalAssistance":".5 km",
"typicalTransportationTimeToMedicalAssistance":"10 minutes",
"medicalTransportationType":"Walk",
"communityPopulation":"14772",
"warmestMonth":"September",
"warmestMonthAverageTemperature":"18C",
"coolestMonth":"June",
"coolestMonthAverageTemperature":"-13C",
"dateOfLastReview":"2007-07-17T00:00:00-06:00",
"dateOfLastUpdate":"2002-08-01T00:00:00-06:00",
"commonHealthProblems":"[string]",
"economicNeeds":"[string]",
"educationalNeeds":"[string]",
"environmentComment":"[string]",
"nationalReligiousHolidays":"[string]",
"primaryEthnicGroup":"[string]",
"socialNeeds":"[string]",
"spiritualNeeds":"[string]",
"traditionsRitualsCustoms":"[string]",
"percentageOfChildrenNotInSchool":"0.20",
"percentCompletingElementarySchool":"0.48",
"percentCompletingSecondarySchool":"0.35"
}
Sample Unsuccessful Responses
XML Unsuccessful Response
<Error>
<ID>[string]</ID>
<Message>Incorrect data type: ID can only be numeric digits (0-9).</Message>
</Error>
JSON Unsuccessful Response
{
"error": {
"id": "[string]"
"message": "Incorrect data type: ID can only be numeric digits (0-9)."
}
}
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 |
HTTP 502 | Bad Gateway |
HTTP 503 | API Maintenance / Service Unavailable |
HTTP 504 | Gateway Timeout |
- Previous: REST Get Child Information V1
- Up: Private REST Services
- Next: REST Get Country V1
Docs Navigation
- Compassion API Library
- Standards Documents
- Legacy APIs (Deprecating)
- Web Services Handshake (Legacy) - Notification and Command Messages
- Public API
- Private IPG APIs
- Private REST Services
- REST Get CDSP Implementor V1
- REST Get Child Case Study V1
- REST Get Child Exit Details V1
- REST Get Child Image V1
- REST Get Child Information V1
- REST Get Community V1
- REST Get Country V1
- REST Get CSP Implementor V1
- REST Get Local Church Partner V1
- REST Get Program Implementor V1
- REST Get Project Age Groups V1
- REST Get Child Image V1 - 2015/03
- Private Messaging APIs
- Quick Start Guide
- OffRamp Prerequisites and Setup
- IP OnRamp Service Configuration
- Available Message Types
- Message and Service Relationships
- Troubleshooting
- General Error Messages from Compass Party Host
- EsdMessageErrorMOE Sample
- Sample REST End-To-End Test Plan
- SOAP Wrapper Sample for Messages to GMC
- Allocate Child Message
- Cancel Commitment Message
- Commitment Canceled Message
- Commitment Created Message
- Constituent Created Message
- Constituent Updated Message
- Constituent Upserted Message
- Create Commitment Message
- Create Constituent Message
- Create Email Message
- Create Gift Message
- Deallocate Child Message
- Depart Child Message
- Email Created Message
- Email Updated Message
- Gift Created Message
- Update Child Message
- Update Constituent Message
- Update Email Message
- Upsert Constituent Message
- Update Project Message
- Private SOAP Services
- SOAP Get Child Exit Detail 201211
- SOAP Get Child Exit Detail 201310
- SOAP Get CDSP Implementor 201309
- SOAP Get Child Image 201211
- SOAP Get Child Case Study 201310
- SOAP Get Child Case Study 201412
- SOAP Get Child Information 201211
- SOAP Get Child Information 201310
- SOAP Get Community 201309
- SOAP Get Country Information 201104
- SOAP Get Local Church Partner 201309
- SOAP Get Program Implementor 201303
- SOAP Get Program Implementor 201309
- SOAP Get Project Age Group 201309
- Service Overview
- SOAP Get CSP Implementor 201309
- SOAP Get Child Image 201503
- Private USA APIs
- Private USA Web APIs
- private cornerstone connect messaging
- private cornerstone test
- public api
0 Comments
New comments are not being accepted at this time.