Hello,
I’m trying to use the CRM export API (Accounts Dashboard | HubSpot)
I’m having trouble authenticating, I’m using a token generated by a private app. Every time I launch it, I get a 403 “scope” error.
The response:
[403] This app hasn’t been granted all required scopes to make this call. Read more about required scopes here: https://developers.hubspot.com/scopes… Error Messages: [All of the following scopes are required.{“requiredScopes”:[“crm.export”]}].
I’ve checked several times, my app does contain “crm.export”, I’ve tried to regenerate the token but it doesn’t work…
I’m looking for a solution…
Hi @HazGaroth
I hope this curl will help you to resolve your query
curl --request POST \
--url https://api.hubapi.com/crm/v3/exports/export/async \
--header 'authorization: Bearer YOUR_ACCESS_TOKEN' \
--header 'content-type: application/json' \
--data '{
"exportType": "LIST",
"format": "CSV",
"exportName": "test",
"objectProperties": [
"email"
],
"associatedObjectType": "companies",
"objectType": "contacts",
"language": "EN",
"listId": "1697"
}'
I hope this will help you out. Please mark it as Solution Accepted and upvote to help another Community member.
Thanks!
Hello Gaurav,
This is exactly what i have at this point, but with a “view” request type.
It look like this:
-- header Token + content type
-- data’{
“exportType”: “VIEW”,
“exportName”: “test”,
“objectProperties”: [
“lastname”
],
“objectType”: “CONTACT”,
“language”: “FR”,
“publicCrmSearchRequest”: {
“filters”: [
{
“propertyName”: “company”,
“operator”: “EQ”
}
],
“sorts”: [
“ASC”
],
“query”: “omnes”
}
}’
My problem is not with writing the request, but with the authentication. For some reason my token, which has all the necessary acces, doesn’t work.