Page History
Introduction
Version 5 of the RescueGroups.org API is currently under development. We released on On 2/15/18 a very early release (consider it , we released an alpha developer preview ) of of RescueGroups.org API v5. This is a very early release involving only the Animals endpoint.
On 10/5/19 we released a major update to the v5 API. Please see the notes below.
On 1/24/20 we released a minor update to the v5 API. This update involved mostly changes to the backend. Please see the notes below.
This API will change in the coming months. We would greatly appreciate your feedback and ideas for improvement. However, perform development at your own risk. We would expect changes to be relatively minor, but there's no guarantee.
Full API documentation
Please visit the full API documentation (for the Production environment): https://api.rescuegroups.org/v5/public/docs
Please visit the full API documentation (for the Test environment): https://test1-api.rescuegroups.org/v5/public/docs
Warning |
---|
The Test environment is a copy of production data. However, this copy may be several days or weeks old and should not be considered valid. You are not permitted to use data you retrieve from the Test servers in any production (publicly accessible) service or website. |
Changes and improvements of note
- Closely follows the JSON API specification. v2 was a completely custom and non-standard request and response structure.
- Uses industry standard HTTP verbs/methods (GET, PUT, etc) and endpoint URLs. v2 used one URL and everything was a POST.
- API Key is accepted only on Authorization header. In v2 the API Key was taken from the URL.
- Multiple sort values using +/- are supported. In v2 only one sort field was supported with asc/desc.
- Random sort now available. In v2 random was not available.
- Distance filter is it's own properties in POST body and supports either miles or kilometers. In v2 the radius filter was included with any other filters.
- Related objects can be included in the response body but separate (eg., Organization along with Animals). In v2 related object fields were either mixed with the requested object or an additional request to the API was necessary.
- Some fields are considered meta and returned separately from the other properties (see the meta Option). In v2 all fields were the same, even if they were meta.
- Endpoint URLs can include view names to automatically add filters. In v2 filters could only be added in the POST body.
Improvements/changes made with the update on 10/5/19
- If an attribute or relationship doesn't exist (ie., is null), that element will no longer be returned in the result. This will result in smaller results transfer sizes and make it easier to read and understand result data.
- Compression (gzip) has been enabled on the API server.
- All entity meta properties are now returned as entity attributes. Meta is only provided at the top-level of the response data.
- The top-level meta data now includes more information about the request and results, including a transactionId that can be used when requesting assistance from RescueGroups.org.
- We're simplifying the API by removing endpoints that weren't being used.
- Endpoints are now grouped in the documentation so that all endpoints of the same type (eg., animals) are together.
Improvements/changes made with the update on 1/24/20
- Geolocation now accepts
postalcode
,coordinates
, orlat
andlon
in order to calculate distance for animals and organizations. Refer to the Endpoint reference for more information about how to perform a distance query for animals or organizations.
Swagger definition available soon
Coming soon! You can download an early draft of our Swagger definition for the public API animals endpoint: http://test-api.rescuegroups.org/v5/public/swagger.phpendpoints.
To open the definition go to the Swagger Editor and click File > Import URL and paste the URL above, once it's available.
Examples
We will be adding examples and improving the Swagger definition as time allows.
Search with advanced filters
Return one random available cat within 100 miles of 20697. This request includes all related objects and all available fields, so it's a bit overwhelming.
Method: POST
Header: Authorization: (your API Key)
URL:
Code Block | ||
---|---|---|
| ||
https://test-api.rescuegroups.org/v5/public/animals/search/?include=breeds,colors,fosters,locations,orgs,patterns,pictures,species,statuses,videos,videourls&fields[animals]=activityLevel,adoptedDate,adoptionFeeString,isAdoptionPending,adultSexesOk,ageGroup,isAltered,availableDate,birthDate,isBirthDateExact,breedId,breedString,breedPrimary,breedPrimaryId,breedSecondary,breedSecondaryId,isBreedMixed,isCatsOk,coatLength,color,colorId,isCourtesyListing,
createdDate,isCurrentVaccinations,isDeclawed,descriptionHtml,descriptionText,distinguishingMarks,isDogsOk,earType,exerciseNeeds,eyeColor,fenceNeeds,isNeedingFoster,isFound,foundDate,foundPostalcode,groomingNeeds,isHousetrained,housetrainedReasonNot,indoorOutdoor,
isKidsOk,killDate,killReason,isMicrochipped,name,newPeopleReaction,obedienceTraining,ownerExperience,pattern,patternId,priority,rescueId,searchString,sex,sheddingLevel,sizeGroup,sizePotential,sizeCurrent,sizeUOM,isSpecialNeeds,specialNeedsDetails,species,speciesId,isSponsorable,sponsors,sponsorshipDetails,sponsorshipMinimum,summary,tailType,updatedDate,vocalLevel,isYardRequired,qualities&fields[orgs]=name,street,city,state,citystate,postalcode,postalcodePlus4,country,phone,fax,email,url,facebookUrl,adoptionUrl,donationUrl,sponsorshipUrl,serveAreas,adoptionProcess,about,services,meetPets,type,isCommonapplicationAccepted&fields[breeds]=name&fields[colors]=name&fields[fosters]=salutation,email,firstname,lastname,phoneHome,phoneCell&fields[locations]=name,street,city,state,postalcode,country,url,phone,phoneExt&fields[patterns]=name&fields[pictures]=created,updated,original,large,small&fields[species]=singular,plural,youngSingular,youngPlural&fields[statuses]=name&fields[videos]=fileSize,url&fields[videourls]=url,videoId,urlThumbnail&options=meta&sort=random&limit=1 |
POST Body:
Code Block | ||
---|---|---|
| ||
{
"data": {
"filters": [
{
"fieldName": "statuses.name",
"operation": "equals",
"criteria": "Available"
},
{
"fieldName": "species.singular",
"operation": "equals",
"criteria": "Cat"
}
],
"filterRadius":
{
"miles": 100,
"postalcode": 20697
}
}
} |
Get one animal
Return one specific animal by ID.
Method: GET
Header: Authorization: (your API Key)
URL:
...
collapse | true |
---|
...
Postman collection available
We have a public Postman collection available to help you with examples.
Developer community
Please join our developer community in Google Groups: https://groups.google.com/a/rescuegroups.org/forum/#!forum/apidev
Common questions
Question: When will this version of the API be available in production?
We don't have any ETA for production release yet. Please note, we do have a production environment URL that should be used if you choose to use this API to display data on publicly available websites.
Question: Will the current APIs (v2 and the REST API) be deprecated?
Yes, we expect to discontinue use of the current APIs as some time after v5 goes live. We will provide plenty of notice beforehand. We expect to have multiple APIs running in production for a year or more.
...