- Joined
- Jan 5, 2022
- Messages
- 5
- Reaction score
- 0
Hi,
I have a problem getting verified on the CRM. The CRM document points to receive authentication/token with basic authentication and in response I receive a token. This token must be used to obtain bearer authentication. Very well. Adding the header I can't get the token in the Bearer Token Athentication. In the 3CX CRM Integration tool I receive as responce text the token.Any suggestions are welcome.
Exception:
System.Exception: Server returned a non successful status code - HTTPStatusCode=Unauthorized - Reason=Unauthorized - Content={"message":"Authorization has been denied for this request."}
at CrmIntegration.ScenarioProcessorBase.ProcessRequest(ScenarioRequest request, IValueManager customManager, HttpClient client, CancellationToken token)
<Parameters>
<Parameter Name="Username" Type="String" Parent="General Configuration" Editor="String" Title="Username:" Default="" />
<Parameter Name="Password" Type="String" Parent="General Configuration" Editor="String" Title="Password:" Default="" />
<Parameter Name="Domein" Type="String" Parent="General Configuration" Editor="String" Title="Domein:" Default="" />
</Parameters>
<Authentication Type="Scenario">
<Value>Auth</Value>
</Authentication>
<Scenarios>
<Scenario Id="Auth" Type="REST">
<Request SkipIf="" Url="https://[Domein]/api/authenticate" MessagePasses="0" Message="" RequestContentType="application/json" RequestEncoding="Json" RequestType="Post" ResponseType="PlainText">
<PostValues>
<Value Key="Username" Passes="0" Type="String">[Username]</Value>
<Value Key="Password" Passes="0" Type="String">[Password]</Value>
</PostValues>
</Request>
<Rules>
<Rule Type="Any">access_token</Rule>
</Rules>
<Variables>
<Variable Name="AccessToken" Path="access_token">
<Filter />
</Variable>
</Variables>
<Outputs AllowEmpty="false">
<Output Type="AccessToken" Value="[AccessToken]"/>
<Output Type="BearerExpiration" Value="3600"/>
</Outputs>
</Scenario>
<Scenario Id="" Type="REST">
<Request Url="https://[Domein]/api/Search?query=[Number]&mask=2" MessagePasses="0" RequestEncoding="Json" RequestType="Get" ResponseType="Json">
<Headers>
<Value Key="Authorization">Bearer [AccessToken]</Value>
</Headers>
</Request>
<Rules>
<Rule Type="Any">id</Rule>
</Rules>
<Variables>
<Variable Name="ContactID" Path="id">
<Filter />
</Variable>
<Variable Name="FirstName" Path="firstName">
<Filter />
</Variable>
<Variable Name="LastName" Path="lastName">
<Filter />
</Variable>
<Variable Name="CompanyName" Path="organizationName">
<Filter />
</Variable>
<Variable Name="Email" Path="email">
<Filter />
</Variable>
<Variable Name="PhoneMobile" Path="GSM">
<Filter />
</Variable>
</Variables>
<Outputs Next="" AllowEmpty="false">
<Output Type="ContactID" Passes="0" Value="[ContactID]" />
<Output Type="FirstName" Passes="0" Value="[FirstName]" />
<Output Type="LastName" Passes="0" Value="[LastName]" />
<Output Type="CompanyName" Passes="0" Value="[CompanyName]" />
<Output Type="Email" Passes="0" Value="" />
<Output Type="PhoneMobile" Passes="0" Value="[PhoneMobile]" />
<Output Type="ContactUrl" Passes="0" Value="https://[Domein]/api/contact/[ContactID]/info" />
<Output Type="EntityId" Passes="0" Value="[ContactID]" />
<Output Type="EntityType" Passes="0" Value="Contacts" />
</Outputs>
</Scenario>
</Scenarios>
</Crm>
Thanks,
I have a problem getting verified on the CRM. The CRM document points to receive authentication/token with basic authentication and in response I receive a token. This token must be used to obtain bearer authentication. Very well. Adding the header I can't get the token in the Bearer Token Athentication. In the 3CX CRM Integration tool I receive as responce text the token.Any suggestions are welcome.
Exception:
System.Exception: Server returned a non successful status code - HTTPStatusCode=Unauthorized - Reason=Unauthorized - Content={"message":"Authorization has been denied for this request."}
at CrmIntegration.ScenarioProcessorBase.ProcessRequest(ScenarioRequest request, IValueManager customManager, HttpClient client, CancellationToken token)
<Parameters>
<Parameter Name="Username" Type="String" Parent="General Configuration" Editor="String" Title="Username:" Default="" />
<Parameter Name="Password" Type="String" Parent="General Configuration" Editor="String" Title="Password:" Default="" />
<Parameter Name="Domein" Type="String" Parent="General Configuration" Editor="String" Title="Domein:" Default="" />
</Parameters>
<Authentication Type="Scenario">
<Value>Auth</Value>
</Authentication>
<Scenarios>
<Scenario Id="Auth" Type="REST">
<Request SkipIf="" Url="https://[Domein]/api/authenticate" MessagePasses="0" Message="" RequestContentType="application/json" RequestEncoding="Json" RequestType="Post" ResponseType="PlainText">
<PostValues>
<Value Key="Username" Passes="0" Type="String">[Username]</Value>
<Value Key="Password" Passes="0" Type="String">[Password]</Value>
</PostValues>
</Request>
<Rules>
<Rule Type="Any">access_token</Rule>
</Rules>
<Variables>
<Variable Name="AccessToken" Path="access_token">
<Filter />
</Variable>
</Variables>
<Outputs AllowEmpty="false">
<Output Type="AccessToken" Value="[AccessToken]"/>
<Output Type="BearerExpiration" Value="3600"/>
</Outputs>
</Scenario>
<Scenario Id="" Type="REST">
<Request Url="https://[Domein]/api/Search?query=[Number]&mask=2" MessagePasses="0" RequestEncoding="Json" RequestType="Get" ResponseType="Json">
<Headers>
<Value Key="Authorization">Bearer [AccessToken]</Value>
</Headers>
</Request>
<Rules>
<Rule Type="Any">id</Rule>
</Rules>
<Variables>
<Variable Name="ContactID" Path="id">
<Filter />
</Variable>
<Variable Name="FirstName" Path="firstName">
<Filter />
</Variable>
<Variable Name="LastName" Path="lastName">
<Filter />
</Variable>
<Variable Name="CompanyName" Path="organizationName">
<Filter />
</Variable>
<Variable Name="Email" Path="email">
<Filter />
</Variable>
<Variable Name="PhoneMobile" Path="GSM">
<Filter />
</Variable>
</Variables>
<Outputs Next="" AllowEmpty="false">
<Output Type="ContactID" Passes="0" Value="[ContactID]" />
<Output Type="FirstName" Passes="0" Value="[FirstName]" />
<Output Type="LastName" Passes="0" Value="[LastName]" />
<Output Type="CompanyName" Passes="0" Value="[CompanyName]" />
<Output Type="Email" Passes="0" Value="" />
<Output Type="PhoneMobile" Passes="0" Value="[PhoneMobile]" />
<Output Type="ContactUrl" Passes="0" Value="https://[Domein]/api/contact/[ContactID]/info" />
<Output Type="EntityId" Passes="0" Value="[ContactID]" />
<Output Type="EntityType" Passes="0" Value="Contacts" />
</Outputs>
</Scenario>
</Scenarios>
</Crm>
Thanks,