Thank you Frederick,
i have tried going through the wizard with oauth2 instead of basic, but i am a little bit unsure on where to put my application token so it goes to the body of the request
"authCode=token"
I have tried in the request content of the Auth Scenario, but on contact lookup it returns "no API token specified"
The authentication here is not exactly OAuth2, it's just a similar procedure. So the Wizard will create a template for OAuth2, and you will need to edit it.
To spot the differences:
OAuth2:
1) The template will create an "Autorize" button/parameter.
2) You click the Authorize button in the 3CX configuration, the CRM page is launched so you can login, and once you grant access, the CRM provides an authorization code to 3CX.
3) 3CX will use this authorization code to get a refresh token.
4) 3CX will use this refresh token to get an access token.
5) 3CX will include the access token in the Authorization header of every HTTP request sent to the CRM.
Your CRM:
1) You get an application token from your CRM.
2) 3CX will use this application token to get an access token.
3) 3CX will include the access token in the Authorization header of every HTTP request sent to the CRM.
So, the template will generate the scenarios to deal with OAuth2, including:
1) A parameter that you need to delete:
<Parameter Parent="General Configuration" Name="RefreshToken" Type="OAuth" ....... />
2) A scenario with
Id="OAuthGetRefreshToken" used to send the authorization code and get the refresh token back, which you need to delete as well.
3) A scenario with
Id="Auth" used to send the refresh token and get the access token back. You need to edit this, and instead of sending the refresh token, you need to send yur application token obtained from your CRM. You will need to adjust this scenario also when processing the response, because OAuth2 returns the value in the property
"access_token", but your CRM returns
"AccessToken".
That should be pretty much what you need to change.