• Learn how AI and automation actually work in your Help Desk. Ask our experts how to improve team speed and customer happiness! AMA Nov 17-21.

    Ask us anything

APIs & Integrations

SChaudhury9
Member

how to get all reacord data of custom objects

SOLVE

My private app added some scopes 

SChaudhury9_0-1705041318713.png

but when i am hitting api 

https://api.hubapi.com/crm/v3/schemas

 giving me error 

{
    "status": "error",
    "message": "This app hasn't been granted all required scopes to make this call. Read more about required scopes here: https://developers.hubspot.com/scopes.",
    "correlationId": "5143fa12-ca96-4ec7-8a05-f3177ad170e0",
    "errors": [
        {
            "message": "One or more of the following scopes are required.",
            "context": {
                "requiredScopes": [
                    "crm.objects.custom.read",
                    "crm.schemas.custom.read"
                ]
            }
        }
    ],
    "links": {
    },
    "category": "MISSING_SCOPES"
}
and when calling https://api.hubapi.com/crm/v3/objects/custom giving this error 
{
    "status": "error",
    "message": "Unable to infer object type from: custom",
    "correlationId": "2d0ddf48-f2d3-48e7-a0d5-4a61f52f7b65"
} i want to retrive all records drom my custom object and i here my objettype is custom 
0 Upvotes
1 Accepted solution
zach_threadint
Solution
Guide

how to get all reacord data of custom objects

SOLVE

Hi @SChaudhury9 👋

 

That's very strange, indeed. All I can recommend at this point is to triple-check you're referencing the correct Private App key value in your request header.

 

I hope this proves useful. Please let me know if you have any follow-up questions.

All the best,

Zach

--

Zach Klein
HubSpot Integrations & App Developer
Meanjin / Brisbane, Australia



Say g'day


If my post helped answer your query, please consider marking it as a solution.


View solution in original post

0 Upvotes
3 Replies 3
zach_threadint
Guide

how to get all reacord data of custom objects

SOLVE

Hi @SChaudhury9 👋

 

Relating to the first issue you've described, what you'll need to do is add the following scope to your Private App and then try the request again:

  • crm.schemas.custom.read

Relating to the second issue you've described, the custom object name field is case-sensitive, so it might be worth double checking that first. You can also use the objectTypeId, rather than the custom object's name. You can retrieve this from HubSpot web UI by navigating to the relevant custom object's list page (e.g. Contacts > Custom Objects > Your Custom Object), and then grabbing the objectTypeId from the page URL. For example, the objectTypeId from the URL below is 2-104518576

So your endpoint would then become, for example: https://api.hubapi.com/crm/v3/objects/2-104518576

 

I hope this proves useful. Please let me know if you have any follow-up questions.

All the best,

Zach

--

Zach Klein
HubSpot Integrations & App Developer
Meanjin / Brisbane, Australia



Say g'day


If my post helped answer your query, please consider marking it as a solution.


0 Upvotes
SChaudhury9
Member

how to get all reacord data of custom objects

SOLVE

hey @zach_threadint  

 

In my private app the scope you have specfied is already added  i am attaching the list of scopes

crm.objects.contacts.writecrm.objects.contacts.readcrm.objects.custom.writecrm.schemas.custom.writecrm.schemas.custom.readcrm.objects.custom.read

 

but still givng me same erorr 

And in second case i have got my custom object id url that is 2-22478587

so as your suggestion the endpoint should look like https://api.hubapi.com/crm/v3/objects/2-22478587

but then also it is giving me error 

{
    "status": "error",
    "message": "Invalid object or event type id: 2-22478587",
    "correlationId": "1f0a2bfe-50c3-4492-b811-85702dc88a9a"
}
0 Upvotes
zach_threadint
Solution
Guide

how to get all reacord data of custom objects

SOLVE

Hi @SChaudhury9 👋

 

That's very strange, indeed. All I can recommend at this point is to triple-check you're referencing the correct Private App key value in your request header.

 

I hope this proves useful. Please let me know if you have any follow-up questions.

All the best,

Zach

--

Zach Klein
HubSpot Integrations & App Developer
Meanjin / Brisbane, Australia



Say g'day


If my post helped answer your query, please consider marking it as a solution.


0 Upvotes