# v3 Contacts Api list method - paging error

**URL:** <https://community.hubspot.com/t/v3-contacts-api-list-method-paging-error/20086>\
**Category:** APIs & Integrations\
**Tags:** contacts\
**Created:** [April 15, 2020, 8:59pm UTC](https://community.hubspot.com/t/v3-contacts-api-list-method-paging-error/20086 "2020-04-15T20:59:36Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![bbalmer](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/bbalmer/32/33328_2.png) [@bbalmer](https://community.hubspot.com/u/bbalmer)\
**Post date:** [April 15, 2020, 8:59pm UTC](https://community.hubspot.com/t/v3-contacts-api-list-method-paging-error/20086/1 "2020-04-15T20:59:36Z")

</div>

Hello -

When we are using this method to get archived contacts and when we attempt to move beyond the first page we are met with an error. (Note - hapi key redacted)

[https://api.hubapi.com/crm/v3/objects/contacts?archived=true&limit=4&after=MzUxLTE1ODY3OTUwMTI0NTE%3D&hapikey=12345](https://api.hubapi.com/crm/v3/objects/contacts?archived=true&limit=4&after=MzUxLTE1ODY3OTUwMTI0NTE%3D&hapikey=12345)

`{"status":"error","message":"%s cannot be null","correlationId":"86de7387-5fe9-46d9-bd22-e0128d78243e","category":"VALIDATION_ERROR","requestId":"cc9c645a-f6d8-4a87-9c14-9122708d4f02"}`

the after token was taken from the first page of results.

Thank you

---

<div class="post-metadata">

**Author:** ![WendyGoh](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/wendygoh/32/42320_2.png) [@WendyGoh](https://community.hubspot.com/u/WendyGoh)\
**Post date:** [April 16, 2020, 6:53am UTC](https://community.hubspot.com/t/v3-contacts-api-list-method-paging-error/20086/2 "2020-04-16T06:53:32Z")

</div>

_Side note: It seems that while the href link display redacted the hapikey, upon clicking on the link, I’m still seeing the hapikey. As such, I edited your post to remove the reference to your API key. Going forward, please avoid including any sensitive details (e.g. API keys, OAuth tokens, etc.) in your post since this is a public forum. I’d strongly recommend deactivating the key you posted and generating a new one._

Hey @bbalmer,

Thanks for pointing this out. I’m also seeing this behavior and I’ll have to check in with our internal team on this. I’ll keep you posted here.

---

<div class="post-metadata">

**Author:** ![bbalmer](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/bbalmer/32/33328_2.png) [@bbalmer](https://community.hubspot.com/u/bbalmer)\
**Post date:** [April 16, 2020, 12:46pm UTC](https://community.hubspot.com/t/v3-contacts-api-list-method-paging-error/20086/3 "2020-04-16T12:46:26Z")

</div>

Thanks Wendy - its just a test account but I appreciate you looking out for us and have rotated. Appreciate your help on this issue in advance.

---

<div class="post-metadata">

**Author:** ![WendyGoh](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/wendygoh/32/42320_2.png) [@WendyGoh](https://community.hubspot.com/u/WendyGoh)\
**Post date:** [April 24, 2020, 1:36am UTC](https://community.hubspot.com/t/v3-contacts-api-list-method-paging-error/20086/4 "2020-04-24T01:36:53Z")

</div>

Hey @bbalmer,

Here’s an update!

Our team has pushed a fix for this and I’ve also tested it out on my end. All should be well now! Do try it out and let me know if the after key is working for you 🙂

---

<div class="post-metadata">

**Author:** ![bbalmer](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/bbalmer/32/33328_2.png) [@bbalmer](https://community.hubspot.com/u/bbalmer)\
**Post date:** [July 6, 2020, 3:09pm UTC](https://community.hubspot.com/t/v3-contacts-api-list-method-paging-error/20086/5 "2020-07-06T15:09:06Z")

</div>

Thanks @WendyGoh - its working great!

---

<div class="post-metadata">

**Author:** ![MohammadQasemi](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@MohammadQasemi](https://community.hubspot.com/u/MohammadQasemi)\
**Post date:** [December 6, 2022, 11:03am UTC](https://community.hubspot.com/t/v3-contacts-api-list-method-paging-error/20086/6 "2022-12-06T11:03:45Z")

</div>

```lia-code-sample
use HubSpot\Factory;
use HubSpot\Client\Crm\Companies\ApiException;

$client = Factory::createWithAccessToken('YOUR_ACCESS_TOKEN');

try {
 $apiResponse = $client->crm()->companies()->basicApi()->getPage(10, ['customer_code,name,domain'], false);
 var_dump($apiResponse);
} catch (ApiException $e) {
 echo "Exception when calling basic_api->get_page: ", $e->getMessage();
}

This is my code and copy pasted from doc, works fine when I tested it out on your docs testing machine, but when I run it on my local I get this error:

Exception when calling basic_api->get_page: [400] Client error: `GET https://api.hubapi.com/crm/v3/objects/companies?limit=10&after=customer_code%2Cname%2Cdomain&archived=false` resulted in a `400 Bad Request` response: {"status":"error","message":"Invalid paging token provided.","correlationId":"b1e8bd93-00c1-441a-b1dd-ce752ff57a29","con (truncated...)

```

---

<div class="post-metadata">

**Author:** ![MohammadQasemi](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@MohammadQasemi](https://community.hubspot.com/u/MohammadQasemi)\
**Post date:** [December 6, 2022, 11:46am UTC](https://community.hubspot.com/t/v3-contacts-api-list-method-paging-error/20086/7 "2022-12-06T11:46:25Z")

</div>

```auto
use HubSpot\Factory;
use HubSpot\Client\Crm\Companies\ApiException;

$client = Factory::createWithAccessToken('YOUR_ACCESS_TOKEN');

try {
 $apiResponse = $client->crm()->companies()->basicApi()->getPage(10, ['customer_code,name,domain'], false);
 var_dump($apiResponse);
} catch (ApiException $e) {
 echo "Exception when calling basic_api->get_page: ", $e->getMessage();
}

This is my code and copy pasted from doc, works fine when I tested it out on your docs testing machine, but when I run it on my local I get this error:

Exception when calling basic_api->get_page: [400] Client erro

```

```lia-code-sample
use HubSpot\Factory;
use HubSpot\Client\Crm\Companies\ApiException;

$client = Factory::createWithAccessToken('YOUR_ACCESS_TOKEN');

try {
 $apiResponse = $client->crm()->companies()->basicApi()->getPage(10, ['customer_code,name,domain'], false);
 var_dump($apiResponse);
} catch (ApiException $e) {
 echo "Exception when calling basic_api->get_page: ", $e->getMessage();
}

This is my code and copy pasted from doc, works fine when I tested it out on your docs testing machine, but when I run it on my local I get this error:

Exception when calling basic_api->get_page: [400] Client error: `GET https://api.hubapi.com/crm/v3/objects/companies?limit=10&after=customer_code%2Cname%2Cdomain&archived=false` resulted in a `400 Bad Request` response: {"status":"error","message":"Invalid paging token provided.","correlationId":"b1e8bd93-00c1-441a-b1dd-ce752ff57a29","con (truncated...)

```

`r: `GET [https://api.hubapi.com/crm/v3/objects/companies?limit=10&after=customer\_code%2Cname%2Cdomain&archived=false`](https://api.hubapi.com/crm/v3/objects/companies?limit=10&after=customer_code%2Cname%2Cdomain&archived=false%60) resulted in a `400 Bad Request` response: {“status”:“error”,“message”:“Invalid paging token provided.”,“correlationId”:“b1e8bd93-00c1-441a-b1dd-ce752ff57a29”,"con (truncated…)`
