Using API calls in a Customer Agent

Hi there!
I’m trying to create a Customer Agent to support customers. I want to use the API feature so the Agent can make call to Prestashop endpoints, to give feedback on customers orders, for instance, but I’m struggling to make it work. Anybody out there having the same problem?

Thanks

Oscar

Hey @Oscar_B - thanks for posting in the Community!
Can you clarify what you mean by “I’m struggling to make it work?” Specifically, are you seeing any error(s), are you looking for general insight on setup, etc?
Shane, Senior Community Moderator

Thanks Shane for replying.

Yes, I’m geeting a 401 error (see the below screenshot). But I can do the same API call from outside Hubspot and I receive data back from Prestashop.

This is how I have set up set the API in Hubspot:

Regards

Oscar

Hey @Oscar_B - thank you for providing these screenshots!
I’d like to tag in some Community experts to see if they have any insight for us! @PBaxter, @Mike_Eastwood, and @Ben_M - any thoughts on this error?
Shane, Senior Community Moderator

Hard to see from the screenshots but almost certainly an authentication issue: probably the default hubspot api configuration isn’t structuring the required header. If you can view the logs at the prestashop end you should be able to compare the headers from hubspot calls vs the ones from the external tests that worked.

best guess is that the authentication required is a basic header with username = api key and no password, rather than a bearer token.

Hi PBaxter,
Although the name of the credential is shown as Bearer, I confirm that the
authentication is a basic header with the username as the api key and no
password. There’s no other option in hubspot.
I’ll try to look at the logs in Prestashop for the 2 connections.
For your reference, I’m attaching the screenshots so you can see them more
clearly.
I’ll get back to you with more info.
Best regards
Oscar

Hi there!

Thanks all for your contribution. I manage to make it worked creating a static key with the api key using the ws_key parameter, and putting ‘None’ as Authentication Type… although this is not safe as the key is visible to everybody…