I was able to verify those setting, I removed the imageUrl that you indicated was an issue and tried again but received the same 400 Bad Request. We do have OAuth setup and use it for all our other API calls, should I even be using this extensions/ecomm/v1/settings endpoint. If I can’t get past the 400 Bad Request how would I make changes to the mappings?
I have since removed this mapping, but could you share the full settings you are trying to upsert (assuming they are different than your initial post)?
Even though you use OAuth for all your other API requests, upserting settings must be done with your developer API key, per this documentation. This is because you editing the settings of your app and not data in an account which has installed your app.
That could be part of the issue, however I was just able to add and remove another dummy contact property mapping using http://api.hubapi.com/extensions/ecomm/v1/settings?hapikey=your_developer_api_key&appId=your_app_id.
If you share the full set of mappings you’re trying to upsert, I’d like to try again myself.
I believe I know what was causing my Bad Request. In my headers I had a nullvalue for Content-Length. I corrected that and now I’m receiving {“message”:“Value from portalId does not match hub-id implied by authorization used: 3977210 (oauth) vs 4445704 (portalId)”,“correlationId”:“202f9d86-bfdc-4f33-94a2-d5355e54fd3b”,“requestId”:“2fe5c8789c482412f5179b5a1a658459”} error.
Update I was able to process a successful mappings setting. I removed the Authorization’,'Bearer from the header. I thought I had to include this since we do use OAuth for our transactional emails. Is this not the case?
Even though you use OAuth for all your other API requests, upserting settings must be done with your developer API key, per this documentation. This is because you editing the settings of your app and not data in an account which has installed your app.
Said differently, HubSpot wouldn’t recognize the OAuth token for one particular account (Hub ID) because you are trying to change the settings of your app across all accounts.
Thus, you should never have to use both an OAuth token and your developer API key. You will only ever use one or the other. In this case, the endpoints only accept your developer API key.
I’m attempting to sync messages to this end point http://api.hubapi.com/extensions/ecomm/v1/sync-messages/PRODUCT and the attached code trying the developer HPIKEY , the app APIKEY or the OAuth and each time I receive this response {“message”:“This OAuth token (CM7nyu…) has not authorized the required scopes to complete this action, requires all of the following: [integration-sync]. Visit Working with OAuth - HubSpot docs for more information.”,“correlationId”:“22a72400-d9ef-484d-8f0b-9e14a2d3d41b”,“requestId”:“0c8664d9a684827dbf0cdfba0eb4d571”} even though I have intergration sync setup. Is there a step I need to do before this step. How is this step different than the import process