# API Key not showing up in request paging link

**URL:** <https://community.hubspot.com/t/api-key-not-showing-up-in-request-paging-link/38586>\
**Category:** APIs & Integrations\
**Tags:** companies, developer-tools\
**Created:** [June 8, 2021, 11:24pm UTC](https://community.hubspot.com/t/api-key-not-showing-up-in-request-paging-link/38586 "2021-06-08T23:24:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nthomson6](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/nthomson6/32/22307_2.png) [@nthomson6](https://community.hubspot.com/u/nthomson6)\
**Post date:** [June 8, 2021, 11:24pm UTC](https://community.hubspot.com/t/api-key-not-showing-up-in-request-paging-link/38586/1 "2021-06-08T23:24:30Z")

</div>

Hi there,

I’m currently trying to pull companies from hubspot into azure data factory using “hapikey”. When I make the initial request I include the “hapikey” but when I receive the request, it doesn’t have the “hapikey” in the “paging.next.link”.

Is there a reason for this? If I include “limit” as an argument it’s returned in the next page link but the “hapikey” isn’t.

Nic

---

<div class="post-metadata">

**Author:** ![dennisedson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dennisedson/32/28044_2.png) [@dennisedson](https://community.hubspot.com/u/dennisedson)\
**Post date:** [June 9, 2021, 4:23pm UTC](https://community.hubspot.com/t/api-key-not-showing-up-in-request-paging-link/38586/2 "2021-06-09T16:23:36Z")

</div>

@nthomson6

Have you thought about using OAuth as an alternative? That is what we encourage developers to use

@johnelmer , do you have any suggestions?

---

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [June 10, 2021, 1:23pm UTC](https://community.hubspot.com/t/api-key-not-showing-up-in-request-paging-link/38586/3 "2021-06-10T13:23:16Z")

</div>

Hi @nthomson6 ,  
Actually, you have to save hapikey into db or any where because hapikey not returning on next page link via using api and next page offset id also need to add in database. Function add in cron job for iteration.  
I have a php code for this, please have a look.  
\<?php  
$from\_hapikey = ‘demo’;  
$no\_of\_page = 200;  
$offset = DB::table(‘offsets’)-\>where(‘id’,1)-\>value(‘offset’);  
if($offset != ‘done’){  
$results = DB::table(‘offsets’)-\>where(‘id’,‘\>’,$offset)-\>paginate($no\_of\_page);  
$offset\_update = 0;  
$results = // data get from companies api  
if(!empty($results)){  
$offset\_update = // add last page link id here  
} else {  
DB::table(‘offsets’)-\>where(‘id’,1)-\>update([‘offset’=\>‘done’]);  
}  
foreach ($results as $key =\> $value) {  
// sync here.  
}  
}  
?\>

Hope this helps!

If we were able to answer your query, kindly help the community by marking it as a solution.  
Thanks and Regards.

---

<div class="post-metadata">

**Author:** ![nthomson6](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/nthomson6/32/22307_2.png) [@nthomson6](https://community.hubspot.com/u/nthomson6)\
**Post date:** [June 11, 2021, 9:36am UTC](https://community.hubspot.com/t/api-key-not-showing-up-in-request-paging-link/38586/4 "2021-06-11T09:36:43Z")

</div>

This is an interesting response, I was doing this on azure data factory (frustratingly I use python normally and it’s very simple in python), iterating through the “after” parameter in a similar way to how you describe (I think since I’m not great with php) was able to sort it.

Thanks!
