No API Key

Status
Not open for further replies.

bcurrie@clyde

Silver Partner
Basic Certified
Joined
Mar 12, 2020
Messages
2
Reaction score
0
Hi All,

Trying to get a custom integration setup with a CRM platform but I cant seem to get past the first hurdle.

I created the template using the generator and have tried entering the API key in the debug section, but I'm just getting an non secsessful return, the API key does not seem to be being sent to the server with the request?

Has anyone else had this issue, I've tried changing some of the values to see if it will send over but still no results, I've attached the error below if someone could help advise that would be great

Thanks

Blair

System.Exception: Server returned a non successful status code - HTTPStatusCode=Unauthorized - Reason=Unauthorized - Content=Api Key was not provided
at CrmIntegration.ScenarioProcessorBase.ProcessRequest(ScenarioRequest request, IValueManager customManager, HttpClient client, CancellationToken token)
at CrmIntegration.ScenarioProcessorBase.ProcessScenario(ProtocolScenario scenario, IValueManager customManager, CancellationToken token)
at CrmIntegration.ScenarioProcessorBase.Execute(ProtocolScenario scenario, CancellationToken token)
at CrmIntegration.CrmProcessor.GetContactInfoFromCrm(List`1 result, IEnumerable`1 scenariosToProcess, IValueManager customManager, Func`2 filterResultsFunctor, Func`1 createContactRecordFunctor, CancellationToken token)
at CrmIntegration.CrmProcessor.GetContactInfo(String contactNumber, InteractionTypes interactionType, CancellationToken token)
 
When you configure the template with the 3CX CRM Generator wizard, and select Basic Authentication + API Key, the generated template will configure the requests to be sent with the Authorization header set to "Basic " + Base64(APIKey + ":X"). This means, the static text "Basic ", concatenated to the API Key, a colon and an "X" character encoded as Base64. This is explained here:
https://en.wikipedia.org/wiki/Basic_access_authentication#Client_side

When a system mentions the API Key, they might be referring to different things. Maybe they need Basic Authentication with the API Key, or maybe they need that you include the API Key in a custom header, or as part of the query string. We would need to see the documentation of the API of this system to understand what you need to send.
 
  • Like
Reactions: Evolute IT
Hi,

This is the raw request that should be sent. but no matter what i put in the headers location it isn't sent.

GET https://3xctest.xxxx/api/search?number=01414162334 HTTP/1.1
User-Agent: Fiddler
Host: 3xctest.xxxx
Content-Type: application/json; charset=utf-8
APIkey: XXXXXX
Content-Length: 0

Thanks
 
So, this is not basic authentication. You must set the authentication to "No" in your XML as follows:
<Authentication Type="No" />

Then, your requests should include the header:
XML:
<Request Url="https://3xctest.xxxx/api/search?number=[Number]" RequestType="Get" ResponseType="Json">
    <Headers>
        <Value Key="APIkey">[APIkey]</Value>
    </Headers>
</Request>
 
  • Like
Reactions: Evolute IT
Status
Not open for further replies.

Latest Posts

Forum statistics

Threads
112,323
Messages
591,896
Members
165,474
Latest member
costionofrei