Solved Prospect CRM API Authentication

Status
Not open for further replies.

jonnip

Free User
Joined
Jan 11, 2024
Messages
7
Reaction score
4
Hi,

I'm struggling to create the Custom CRM Integration XML to use just a Bearer Token.

I have this working in Postman but I'm not sure how to set this in the Template Wizard. Can anyone help?

I've tried setting it up as basic Authentication and manually adding the below to each scenario but that returns: Server returned a non successful status code - HTTPStatusCode=Unauthorized
<Headers>
<Value Key="Authorization" Type="String">Bearer [APIkey]</Value>
</Headers>

Prospect API Documentation - https://docs.prospect365.com/en/articles/2455275-getting-started-with-the-odata-api

Thanks!
 
Try without the "Bearer" prefix. Just the API key directly.
 
If you want to use that Authorization header, that's not basic authentication. Change the authentication type to "No", and then add the header as you did.
 
Thanks both, I think it's close but still not working.

@edossantos I have made the changes you suggested but I still get HTTPStatusCode=Unauthorized.

Would you mind taking a look at the file to check I've not done something stupid?
ProspectCRM.xml
 
Do you have your API documentation so we understand how you need to authenticate?
 
Actually, I know what's wrong, you're adding the headers after you close the request.

This is what you have:
XML:
<Request Url="https://crm-odata-v1.prospect365.com/Contacts?$filter=PhoneNumber eq '[Number]'&amp;$select=ContactId,Forename,Surname,Email,PhoneNumber,MobilePhoneNumber,RecordLink&amp;$expand=Division($select=Name)" MessagePasses="0" RequestEncoding="UrlEncoded" RequestType="Get" ResponseType="Json" />
<Headers>
    <Value Key="Authorization">Bearer [APIkey]</Value>
</Headers>

And this is what you should do:
XML:
<Request Url="https://crm-odata-v1.prospect365.com/Contacts?$filter=PhoneNumber eq '[Number]'&amp;$select=ContactId,Forename,Surname,Email,PhoneNumber,MobilePhoneNumber,RecordLink&amp;$expand=Division($select=Name)" MessagePasses="0" RequestEncoding="UrlEncoded" RequestType="Get" ResponseType="Json" >
    <Headers>
        <Value Key="Authorization">Bearer [APIkey]</Value>
    </Headers>
</Request>
 
Thanks @edossantos! It's authenticating correctly now.
 
  • Like
Reactions: edossantos
Status
Not open for further replies.