# Question on the "after" parameter

**URL:** <https://community.hubspot.com/t/question-on-the-after-parameter/119365>\
**Category:** APIs & Integrations\
**Tags:** developer-tools\
**Created:** [October 28, 2024, 8:54pm UTC](https://community.hubspot.com/t/question-on-the-after-parameter/119365 "2024-10-28T20:54:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![DanaIrvine](https://avatars.discourse-cdn.com/v4/letter/d/f4b2a3/32.png) [@DanaIrvine](https://community.hubspot.com/u/DanaIrvine)\
**Post date:** [October 28, 2024, 8:54pm UTC](https://community.hubspot.com/t/question-on-the-after-parameter/119365/1 "2024-10-28T20:54:34Z")

</div>

I am using /crm/v3/objects/tickets/search to search tickets. The issue I am having is I am expecting more than 200 results, but there’s a limit of 200 with a search. I believe the “after” parameter is my solution to query additional pages of data but I can’t figure out what it is expecting there, or how it is used.

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [October 28, 2024, 10:59pm UTC](https://community.hubspot.com/t/question-on-the-after-parameter/119365/2 "2024-10-28T22:59:08Z")

</div>

Hey, @DanaIrvine 👋 I completely understand why this is confusing until you do it a few times.

I don’t have 200+ Tickets in my test portal, but I think I can still give an example that is enough to get you started.

In my test portal, I have 12 Tickets:

 ![CleanShot 2024-10-28 at 16.42.45@2x.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/c/9/c986ab4fb86d359592f6933638565377957e8225.png)

For our example purposes, we’ll make our request using a `Limit` of 5, and then use the `After` value to page through the others.

Request one (to get `after` value)

Request

`POST https://api.hubapi.com/crm/v3/objects/tickets/search`

Request body

```lia-code-sample
{
 "limit": 5
}

```

Response

```lia-code-sample
{
 "total": 12,
 "results": [
 {
 "id": ...
 }
 ],
 "paging": {
 "next": {
 "after": "5"
 }
 }
}

```

For all the following requests, we will include the `after` value in our requests in the body

Request #2 (which will return the next five tickets)

Body

```lia-code-sample
{
 "limit": 5,
 "after": "5"
}

```

Request #3 (which will return the last two tickets)

Body

```lia-code-sample
{
 "limit": 5,
 "after": "10"
}

```

In your case, since you are not sending a `limit` value, I’d expect the `after` values to come in increments of 200 for each response — “after”: “200”, “after”: “400”, “after”: “600”, etc.

For me personally, when I’m testing, I find Postman to be the easiest way to gain an understanding of how the Search API wants to behave.

I hope this helps get you moving forward! — Jaycee

---

<div class="post-metadata">

**Author:** ![DanaIrvine](https://avatars.discourse-cdn.com/v4/letter/d/f4b2a3/32.png) [@DanaIrvine](https://community.hubspot.com/u/DanaIrvine)\
**Post date:** [October 29, 2024, 2:49pm UTC](https://community.hubspot.com/t/question-on-the-after-parameter/119365/3 "2024-10-29T14:49:36Z")

</div>

Thanks, now I get an error.  
This works, returns 5 records:  
{  
“limit”: 5,  
“after”: “0”,  
“properties”: [  
“id”  
],  
“filterGroups”:[{  
“filters”:[  
{  
“propertyName”:“hs\_lastmodifieddate”,  
“operator”:“BETWEEN”,  
“highValue”: 1730260800000,  
“value”:1727755200000  
},  
{  
“propertyName”:“hs\_pipeline”,  
“operator”:“EQ”,  
“value”:63784995  
}  
]  
}],  
“sorts”: [{  
“propertyName”: “id”,  
“direction”: “ASCENDING”  
}  
]  
}  
This gives an error , returns the same 5 records: “Invalid input JSON on line 27, column 3: Could not resolve subtype of [simple type, class  
| com.hubspot.conversations.publicapi.core.messages.PublicMessageEgg]: missing type id property \u0027type\u0027”  
{  
“limit”: 5,  
“after”: “5”,  
“properties”: [  
“id”  
],  
“filterGroups”:[{  
“filters”:[  
{  
“propertyName”:“hs\_lastmodifieddate”,  
“operator”:“BETWEEN”,  
“highValue”: 1730260800000,  
“value”:1727755200000  
},  
{  
“propertyName”:“hs\_pipeline”,  
“operator”:“EQ”,  
“value”:63784995  
}  
]  
}],  
“sorts”: [{  
“propertyName”: “id”,  
“direction”: “ASCENDING”  
}  
]  
}  
The only difference is after 0 vs after 5.

---

<div class="post-metadata">

**Author:** ![SteveHTM](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/stevehtm/32/22074_2.png) [@SteveHTM](https://community.hubspot.com/u/SteveHTM)\
**Post date:** [October 29, 2024, 2:59pm UTC](https://community.hubspot.com/t/question-on-the-after-parameter/119365/4 "2024-10-29T14:59:36Z")

</div>

- as Jaycee mentions, you should check the value of the total and paging.next.after values returned from your first call.

```lia-code-sample
{ "total": 12, "results": [{ "id": ... }], 
"paging": { "next": { "after": "5" } } }

```

If these do not indicate addition records available then there may be something else going wrong.

Good luck!

Steve

@DanaIrvine

---

<div class="post-metadata">

**Author:** ![DanaIrvine](https://avatars.discourse-cdn.com/v4/letter/d/f4b2a3/32.png) [@DanaIrvine](https://community.hubspot.com/u/DanaIrvine)\
**Post date:** [October 29, 2024, 4:02pm UTC](https://community.hubspot.com/t/question-on-the-after-parameter/119365/5 "2024-10-29T16:02:36Z")

</div>

Nevermind, assigned a variable in the wrong spot in my loop.. duh!  
Meet with Dana Irvine\<\>  
[A close up of a logo Description automatically generated]  
[facebook]\<\> [linkedin] \<\> [twitter] \<\>  
Dana Irvine (they/them/theirs)  
IT Manager  
Tel: 866.444.4615 x1007  
Direct: 609-879-0020  
[www.paragonpayroll.com](http://www.paragonpayroll.com)\<\>  
Please note that all times are EST unless otherwise specified.  
\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
From: Dana Irvine  
Sent: Tuesday, October 29, 2024 11:16 AM  
To: hubspot.prod|52220eb7|6fe2fc0f-89cb-443a-a18d-e14f3c523b06@replybyemail.usw2.prod.hosted.lithcloud.com  
Subject: Re: Question on the “after” parameter  
I am running this in powershell, the same JSON works in postman. Makes no sense.
