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
{"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
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.
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.
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 
Thanks @WendyGoh - its working great!
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...)
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
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` resulted in a 400 Bad Request response: {“status”:“error”,“message”:“Invalid paging token provided.”,“correlationId”:“b1e8bd93-00c1-441a-b1dd-ce752ff57a29”,"con (truncated…)`