APIs & Integrations

RKOSURI
Participant

V3 API : Issue with scopes(403) even after configuration

SOLVE

Dear Team,

    I hope you are doing well. I am working on a project where i need to get all leads exists in contactlist. Here is the V3 endpoint used.

https://api.hubapi.com/crm/v3/objects/leads

I have a contactlistId and expecting all leads exists in that contactlist to appear on the postman response. As part of this requirement, first i have added the lead scopes (read& write) to the REQUIRED_SCOPE in hubspot app(Oauth) as below. From config point of time, everything looks fine. But when i tried to fetch the leads from postman, I am getting below 403 error even after configuration. Could you please help me on how to resolve this issue?

 

RKOSURI_0-1720177840420.png

RKOSURI_1-1720178097440.png

 

0 Upvotes
1 Accepted solution
AddaxLab
Solution
Member

V3 API : Issue with scopes(403) even after configuration

SOLVE

Hey , @RKOSURI 

Here is no one API endpoint to retrieve all contacts from contact list, but you can do it in 2 steps
  1. Retrieve all members from a list with a GET request to https://api.hubapi.com/crm/v3/lists/{listId}/memberships (replace {listId} with your actual id). Her...

     

    { "results": [ { "recordId": "19625561285", "membershipTimestamp": "2024-07-08T13:22:18.815Z" } ], "total": 1 }

     

    2. Get contact IDs from the response and map them to body payload for the next POST request to https://api.hubapi.com/crm/v3/objects/contacts/batch/read

     

    const body = { propertiesWithHistory: ["string"], inputs: [ { "id": "19625561285" }, // ... ADD MORE IDS HERE FROM THE RESPONSE OF THE PREVIOUS REQUEST ], properties: ["firstName", "email", "lastName"] // ADD PROPERTIES HERE };

02974_0-1720459174120.png

 

View solution in original post

0 Upvotes
5 Replies 5
AddaxLab
Member

V3 API : Issue with scopes(403) even after configuration

SOLVE

 Hey @RKOSURI

Here is no one API endpoint to retrieve all contacts from contact list, but you can do it in 2 steps
  1. Retrieve all members from a list with a GET request to https://api.hubapi.com/crm/v3/lists/{listId}/memberships (replace {listId} with your actual id). Her...

     

    { "results":[ { "recordId": "19625561285", "membershipTimestamp": "2024-07-08T13:22:18.815Z" } ],
    "total": 1 }

     

    2. Get contact IDs from the response and map them to body payload for the next POST request to https://api.hubapi.com/crm/v3/objects/contacts/batch/read

     

    const body = {propertiesWithHistory: ["string"], inputs: [
    { "id": "19625561285" }, // ... ADD MORE IDS HERE FROM THE RESPONSE OF THE PREVIOUS REQUEST ], properties: ["firstName", "email", "lastName"] // ADD PROPERTIES HERE };

    02974_0-1720532393078.png

     

0 Upvotes
Jaycee_Lewis
Community Manager
Community Manager

V3 API : Issue with scopes(403) even after configuration

SOLVE

Hey, @AddaxLab 👋 It looks like one of later replies got hung up in the spam filter. I moved it back out. I appreciate your help in this thread 🙌 — Jaycee


Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !
0 Upvotes
AddaxLab
Member

V3 API : Issue with scopes(403) even after configuration

SOLVE

Hey @RKOSURI 

If the app was previously installed with different scopes, changing the scope after installation will not modify the scope of the existing token. Our developers team suggests trying to reinstall the app and see if that resolves the issue.
02974_0-1720192019073.png

 

 
 
0 Upvotes
RKOSURI
Participant

V3 API : Issue with scopes(403) even after configuration

SOLVE

@AddaxLab Thanks for your reply. I will forward this to my teammate. Currently hubspot app has lot of configurations like webhook configs. Bit concerned of its backup if it needs a reinstall.  

0 Upvotes
AddaxLab
Solution
Member

V3 API : Issue with scopes(403) even after configuration

SOLVE

Hey , @RKOSURI 

Here is no one API endpoint to retrieve all contacts from contact list, but you can do it in 2 steps
  1. Retrieve all members from a list with a GET request to https://api.hubapi.com/crm/v3/lists/{listId}/memberships (replace {listId} with your actual id). Her...

     

    { "results": [ { "recordId": "19625561285", "membershipTimestamp": "2024-07-08T13:22:18.815Z" } ], "total": 1 }

     

    2. Get contact IDs from the response and map them to body payload for the next POST request to https://api.hubapi.com/crm/v3/objects/contacts/batch/read

     

    const body = { propertiesWithHistory: ["string"], inputs: [ { "id": "19625561285" }, // ... ADD MORE IDS HERE FROM THE RESPONSE OF THE PREVIOUS REQUEST ], properties: ["firstName", "email", "lastName"] // ADD PROPERTIES HERE };

02974_0-1720459174120.png

 

0 Upvotes