Returned relationship links not working

18 views
Skip to first unread message

Ken Cline

unread,
May 13, 2021, 6:01:48 PM5/13/21
to apidev
Hi, I'm must beginning to play with the v5 API. I'm wondering if I'm simply confused, some endpoints haven't been implemented, or something is broken. 

I've defined the following variables:

{{SpeciesID}} = 8         // Dog
{{BreedID}} = 74          // Affenpinscher
{{RG_API_KEY}} = <my API Key>

Headers:
Authorization {{RG_API_KEY}}
Content-Type application/vnd.api+json

Using Postman, I GET the following URL 

{{v5Url}}/public/animals/species/{{SpeciesID}}/breeds/

And receive good data:

{
    "meta": {
        "count": 291,
        "countReturned": 25,
        "pageReturned": 1,
        "pages": 12,
        "limit": 25,
        "transactionId": "QBfnkAcwMITP"
    },
    "data": [
        {
            "type": "breeds",
            "id": "74",
            "attributes": {
                "name": "Affenpinscher"
            },
            "relationships": {
                "species": {
                    "data": [
                        {
                            "type": "species",
                            "id": "8",
                            "links": {
                                "self": "/public/breeds/74/species/8"
                            }
                        }
                    ],
                    "links": {
                        "self": "/public/breeds/74/species/"
                    }
                }
            }
        },
...
}

However, when I call any of the self links, I get an invalid endpoint error

{
    "errors": [
        {
            "status": 400,
            "source": {
                "path": ""
            },
            "title": "Invalid endpoint",
            "detail": "The endpoint URL you requested was not found"
        }
    ],
    "meta": {
        "transactionId": "AsqNLrAZfihK"
    }
}

From what I can see, it appears that the self link is wrong. Based on the endpoint documentation the self links should be as follows:

/public/animals/breeds/{{BreedID}}/                 // for Breed object
/public/animals/species/{{SpeciesID}}/           // for Species object
 

Richard Saffell

unread,
May 13, 2021, 7:58:10 PM5/13/21
to apidev, Ken Cline
I'm really sorry for the confusion, but we haven't implemented Links yet. I thought we had removed all Links from the output, but I guess we missed some. Please ignore any Links you find since it has not been implemented.
Reply all
Reply to author
Forward
0 new messages