APIs & Integrations

himanshurauthan
Thought Leader | Elite Partner
Thought Leader | Elite Partner

Insufficient permissions while testing the settings PUT/GET

SOLVE

The /install endpoint is working fine and the status is true.

But when i am trying with /settings api, both PUT and GET, its returning 400, insufficient permissions.

Can anyone please help me to fix this ?

Thanks

Digital Marketing & Inbound Expert In Growth Hacking Technology
5 Accepted solutions
himanshurauthan
Solution
Thought Leader | Elite Partner
Thought Leader | Elite Partner

Insufficient permissions while testing the settings PUT/GET

SOLVE

Thank You @Llewellyn_Smith

I am including the hapikey as a query param in our request. For deeper look I am sharing more details.
To get the settings we are using this request
https://api.hubapi.com/extensions/ecomm/v1/settings?appId=62834&hapikey=5***************************...

But getting the response like that.
{
"status":"error",
"message":"Insufficient permissions",
"correlationId":"407d9ccf-4c0e-4033-bdda-2de71b5d924c",
"requestId":"242fec7f004a20dd2f20dab52697bef5"
}

And after successful install when we check the install status we get the response like-
https://api.hubapi.com/extensions/ecomm/v1/installs/status?appId=62834&hapikey=5********************...
{
"installCompleted":true,
"ecommSettingsEnabled":false
}
Is it something related with ecommSettingsEnabled.
Please suggest.

Digital Marketing & Inbound Expert In Growth Hacking Technology

View solution in original post

0 Upvotes
lsmith
Solution
HubSpot Product Team
HubSpot Product Team

Insufficient permissions while testing the settings PUT/GET

SOLVE

Hi @himanshurauthan, thanks for the clarifying information.

First, regarding the /settings endpoint, an appId can be included or omitted as a query param.
If an appId is not included, then the hapikey provided should be from the marketing/sales portal that is using the eComm Bridge API directly.
If passed an appId, then the hapikey provided should be from the developer portal that owns that app. This is because in this case the settings endpoint will be used to edit settings for the application, not for any specific portal.

The same is not true of the /installs endpoint. This endpoint does not work with an appId (the appId will not do anything).
Installing manually using that endpoint is for using the eCommBridge API directly (without an application).
If you are developing an application that uses the eCommBridge API, then installation will happen automatically when a user on a marketing/sales portal auths your application.

In your case it looks like the same hapikey is being used to create settings and install ecomm. This makes sense if that hapikey is for a marketing/sales portal that wants to use the API without and app, but won't work for modifying settings or installing app 62834. Instead, you can use your developer portal's hapikey for the /settings endpoint, and you don't need to worry about installing eCommBridge manually.

I hope that helps resolve the issue. Please let me know if you have any other questions, or if the docs did not make this sufficiently clear.

View solution in original post

himanshurauthan
Solution
Thought Leader | Elite Partner
Thought Leader | Elite Partner

Insufficient permissions while testing the settings PUT/GET

SOLVE

Thanks @Llewellyn_Smith for your clean explanation.
It resolves the issue. Now I am able to access /installs and /settings endpoint.

Digital Marketing & Inbound Expert In Growth Hacking Technology

View solution in original post

0 Upvotes
himanshurauthan
Solution
Thought Leader | Elite Partner
Thought Leader | Elite Partner

Insufficient permissions while testing the settings PUT/GET

SOLVE

Hi @Llewellyn_Smith,
I have one more doubt about the import process.
When I am setting the importTriggerUri for the import-setting API. It is showing status code 200 and returning the correct importTriggerUri.
But Import Initialization Webhook not working. Means importTriggerUri has never been called by hubspot. I used the hapikey from developer portal.
Example for import-setting API-
PUT-> https://api.hubapi.com/extensions/ecomm/v1/import-settings/?appId=62834&hapikey=a*******************...
With request Body
{
"importTriggerUri": "https://ffa26776.ngrok.io/mg223/hubintegration/hubspot/importdata/"
}
And in response we are getting this. And same thing we get from GET-> https://api.hubapi.com/extensions/ecomm/v1/import-settings/?appId=62834&hapikey=a*******************...
{
"importTriggerUri": "https://ffa26776.ngrok.io/mg223/hubintegration/hubspot/importdata/"
}
But unable to know why Import Initialization Webhook not working. Please correct me if I was doing something wrong.

Digital Marketing & Inbound Expert In Growth Hacking Technology

View solution in original post

0 Upvotes
himanshurauthan
Solution
Thought Leader | Elite Partner
Thought Leader | Elite Partner

Insufficient permissions while testing the settings PUT/GET

SOLVE

Hi @Llewellyn_Smith
Hope you are doing well.

Have you got anything related with the import initialization Webhook callback not working.

Besides that I have one more doubt about the image in product Sync-Message endpoint api.
I tried to map the property of image as 'STRING' as well as 'AVATAR_IMAGE' too like that-
{
"propertyName": "image",
"dataType": "STRING",
"targetHubspotProperty": "ip__ecomm_bridge__product_image"
}
{
"propertyName": "image",
"dataType": "AVATAR_IMAGE",
"targetHubspotProperty": "ip__ecomm_bridge__product_image"
}

In both cases product created but image not showing in product library of hubspot. Sync-message data was like that -
[
"integratorObjectId" => "000175",
"action" => "UPSERT",
"changeOccurredTimestamp" => 1524204368000,
"propertyNameToValues" => [
"name" => "Example Product 175",
"image" => "https://cdn.shopify.com/s/files/1/2806/2864/products/soccer_e9376f74-1031-4d8d-a7aa-c811526f5263.png...",
"price" => "75",
"description" => "Example Product 175 description"
]
]

Please let me know If something wrong in this process.

Digital Marketing & Inbound Expert In Growth Hacking Technology

View solution in original post

0 Upvotes
7 Replies 7
himanshurauthan
Solution
Thought Leader | Elite Partner
Thought Leader | Elite Partner

Insufficient permissions while testing the settings PUT/GET

SOLVE

Hi @Llewellyn_Smith
Hope you are doing well.

Have you got anything related with the import initialization Webhook callback not working.

Besides that I have one more doubt about the image in product Sync-Message endpoint api.
I tried to map the property of image as 'STRING' as well as 'AVATAR_IMAGE' too like that-
{
"propertyName": "image",
"dataType": "STRING",
"targetHubspotProperty": "ip__ecomm_bridge__product_image"
}
{
"propertyName": "image",
"dataType": "AVATAR_IMAGE",
"targetHubspotProperty": "ip__ecomm_bridge__product_image"
}

In both cases product created but image not showing in product library of hubspot. Sync-message data was like that -
[
"integratorObjectId" => "000175",
"action" => "UPSERT",
"changeOccurredTimestamp" => 1524204368000,
"propertyNameToValues" => [
"name" => "Example Product 175",
"image" => "https://cdn.shopify.com/s/files/1/2806/2864/products/soccer_e9376f74-1031-4d8d-a7aa-c811526f5263.png...",
"price" => "75",
"description" => "Example Product 175 description"
]
]

Please let me know If something wrong in this process.

Digital Marketing & Inbound Expert In Growth Hacking Technology
0 Upvotes
lsmith
HubSpot Product Team
HubSpot Product Team

Insufficient permissions while testing the settings PUT/GET

SOLVE

Hi @himanshurauthan. Thanks for the information. I'll investigate and get back to you as soon as I can.

himanshurauthan
Solution
Thought Leader | Elite Partner
Thought Leader | Elite Partner

Insufficient permissions while testing the settings PUT/GET

SOLVE

Hi @Llewellyn_Smith,
I have one more doubt about the import process.
When I am setting the importTriggerUri for the import-setting API. It is showing status code 200 and returning the correct importTriggerUri.
But Import Initialization Webhook not working. Means importTriggerUri has never been called by hubspot. I used the hapikey from developer portal.
Example for import-setting API-
PUT-> https://api.hubapi.com/extensions/ecomm/v1/import-settings/?appId=62834&hapikey=a*******************...
With request Body
{
"importTriggerUri": "https://ffa26776.ngrok.io/mg223/hubintegration/hubspot/importdata/"
}
And in response we are getting this. And same thing we get from GET-> https://api.hubapi.com/extensions/ecomm/v1/import-settings/?appId=62834&hapikey=a*******************...
{
"importTriggerUri": "https://ffa26776.ngrok.io/mg223/hubintegration/hubspot/importdata/"
}
But unable to know why Import Initialization Webhook not working. Please correct me if I was doing something wrong.

Digital Marketing & Inbound Expert In Growth Hacking Technology
0 Upvotes
himanshurauthan
Solution
Thought Leader | Elite Partner
Thought Leader | Elite Partner

Insufficient permissions while testing the settings PUT/GET

SOLVE

Thanks @Llewellyn_Smith for your clean explanation.
It resolves the issue. Now I am able to access /installs and /settings endpoint.

Digital Marketing & Inbound Expert In Growth Hacking Technology
0 Upvotes
lsmith
Solution
HubSpot Product Team
HubSpot Product Team

Insufficient permissions while testing the settings PUT/GET

SOLVE

Hi @himanshurauthan, thanks for the clarifying information.

First, regarding the /settings endpoint, an appId can be included or omitted as a query param.
If an appId is not included, then the hapikey provided should be from the marketing/sales portal that is using the eComm Bridge API directly.
If passed an appId, then the hapikey provided should be from the developer portal that owns that app. This is because in this case the settings endpoint will be used to edit settings for the application, not for any specific portal.

The same is not true of the /installs endpoint. This endpoint does not work with an appId (the appId will not do anything).
Installing manually using that endpoint is for using the eCommBridge API directly (without an application).
If you are developing an application that uses the eCommBridge API, then installation will happen automatically when a user on a marketing/sales portal auths your application.

In your case it looks like the same hapikey is being used to create settings and install ecomm. This makes sense if that hapikey is for a marketing/sales portal that wants to use the API without and app, but won't work for modifying settings or installing app 62834. Instead, you can use your developer portal's hapikey for the /settings endpoint, and you don't need to worry about installing eCommBridge manually.

I hope that helps resolve the issue. Please let me know if you have any other questions, or if the docs did not make this sufficiently clear.

himanshurauthan
Solution
Thought Leader | Elite Partner
Thought Leader | Elite Partner

Insufficient permissions while testing the settings PUT/GET

SOLVE

Thank You @Llewellyn_Smith

I am including the hapikey as a query param in our request. For deeper look I am sharing more details.
To get the settings we are using this request
https://api.hubapi.com/extensions/ecomm/v1/settings?appId=62834&hapikey=5***************************...

But getting the response like that.
{
"status":"error",
"message":"Insufficient permissions",
"correlationId":"407d9ccf-4c0e-4033-bdda-2de71b5d924c",
"requestId":"242fec7f004a20dd2f20dab52697bef5"
}

And after successful install when we check the install status we get the response like-
https://api.hubapi.com/extensions/ecomm/v1/installs/status?appId=62834&hapikey=5********************...
{
"installCompleted":true,
"ecommSettingsEnabled":false
}
Is it something related with ecommSettingsEnabled.
Please suggest.

Digital Marketing & Inbound Expert In Growth Hacking Technology
0 Upvotes
lsmith
HubSpot Product Team
HubSpot Product Team

Insufficient permissions while testing the settings PUT/GET

SOLVE

Hi @himanshurauthan,

I haven't been able to replicate the problem you are seeing.

Make sure to include your HubSpot API Key as a query param in the request. If you are developing an application then you should use your developer portal's hapikey, and if you are using ecomm bridge directly with your marketing/sales portal then you should use that portal's hapikey.