APIs & Integrations

GBulleri
Participant

REST API call from a newbie

Hi,

this my first post!

 

I created  a test account: into the test account there are 3 contacts;

I generated the api key of the test account.

 

When with the below rest api call (I' am using powershell)

$headers=@{"accept"= "application/json"}

[System.Uri]$Uri2 = "https://api.hubapi.com/contacts/v1/lists?count=2&hapikey=my test account api key"
$response = Invoke-RestMethod $Uri2 -Method 'GET' -Headers $headers -ContentType 'application/json' -websession $sess

 

The list of the contacts is empty!

{
"offset": 0,
"lists": [],
"has-more": false
}

 

Why is empty?

Any suggestion ?

Thank You Very Much

 

 

 

0 Upvotes
1 Reply 1
GBulleri
Participant

REST API call from a newbie

I found the error!

the right endpoint is:

 

https://api.hubapi.com/contacts/v1/lists/all/contacts/all