Animal by ID

50 views
Skip to first unread message

Vivian van Zyl

unread,
Oct 3, 2021, 2:20:11 PM10/3/21
to apidev
Hi There ~

How would I get just a single animal by ID? I assume it's a get call, but how is the query string configured to get a single animal by its ID returned by a search?

Example

I did a search and got a few Dogs, but would like to retrieve just this one specific dogs data at a later time:

{
    "meta": {
        "count": 16,
        "countReturned": 16,
        "pageReturned": 1,
        "limit": 25,
        "pages": 1,
        "transactionId": "mevOZXoEaddz"
    },
    "data": [
        {
            "type": "animals",
            "id": "16995700",
            "attributes": {
                "distance": 2.99,
                "isAdoptionPending": false,
                "ageGroup": "Adult",
                "isBirthDateExact": false,
                "breedString": "Shepherd \/ Mixed",
                "breedPrimary": "Shepherd",
                "breedPrimaryId": 411,
                "isBreedMixed": true,
                "isCourtesyListing": false,
                "isCurrentVaccinations": true,

Thank you again.

Regards
ViV

Richard Saffell

unread,
Oct 3, 2021, 2:37:04 PM10/3/21
to apidev, viv...@gmail.com
ViV,

You're right, it's a GET call. Here's the simplest form, which will return default fields and relationships.

{{url}}/public/animals/16995700

But you probably want to include the related data, with a query such as:

{{url}}/public/animals/16995700?include=breeds,colors,fosters,locations,orgs,patterns,pictures,species,statuses,videos,videourls

Also, currently the documentation can be found here: https://test1-api.rescuegroups.org/v5/public/docs  If you scroll down to Endpoint Reference > Animals you can find all of the includes and views, etc for the Animals endpoints.

Hope that helps!

Richard

Vivian van Zyl

unread,
Oct 3, 2021, 3:56:36 PM10/3/21
to apidev, Richard Saffell
Thank you very much, that answered my question.

Regards
ViV

Reply all
Reply to author
Forward
0 new messages