APIs & Integrations

Caloyski
Mitglied

GET Owners API v3 doesn't work with "after"

If I add "after" in the query string to the following request

https://api.hubapi.com/crm/v3/owners/?after=200&limit=100&hapikey={myApiKey}

it doesn't work and says:

 

 
{
    "status": "error",
    "message": "Invalid paging token provided.",
    "correlationId": "9a863ddd-fa21-4658-81fa-74e356cbe1fb",
    "context": {
        "after": [
            "Optional[0]"
        ]
    },
    "category": "VALIDATION_ERROR"
}

 

Immagine.png

0 Upvotes
1 Antwort
WendyGoh
HubSpot Employee
HubSpot Employee

GET Owners API v3 doesn't work with "after"

Hey @Caloyski,

 

Just to clarify, where did you get the `200` value for the after parameter? 

 

The after parameter will be returned as the paging.next.after JSON property on the response result. i.e. 

 

{
results:[
{
id:"123",
email:"email",
firstName:"W",
lastName:"G",
userId:2,
createdAt:"2018-07-24T10:12:04.070Z",
updatedAt:"2020-05-25T00:01:58.599Z",
archived:false},
{
id:"123",
email:"email",
firstName:"Jocelyn",
lastName:"Ng",
userId:1,
createdAt:"2018-07-24T10:21:14.726Z",
updatedAt:"2019-05-29T08:02:22.235Z",
archived:false}],
paging:{
next:{
after:"MzMwNDk0MDA%3D",
link:"https://api.hubspot.com/crm/v3/owners/?portalId={{portalId}}&limit=2&after=MzMwNDk0MDA%3D"}}}

The after parameter in this case is `MzMwNDk0MDA`. 

 

Did you get the after parameter from the return response body?