06-10-2023 12:20 PM - edited 06-10-2023 01:13 PM
Hello Dears,
I have to use rest call step in UCCX script to call JSON API, the customer asked me to use authorization as below:
How to achieve this using the UCCX script?
Thanks in advanced,
Solved! Go to Solution.
06-13-2023 04:45 AM
This would be what @Thomas G. Johannesen suggested that you'd need to do.
So in CCX you'd need to do two REST calls, the first one to get the Token and then you use that in the next REST call.
06-14-2023 12:52 AM
Your first request will look something like this:
url?client_id=<clientID>&client_secret=<clientSecret>
Look at this page:
This will return your token (in XML og JSON), that you can use in your next request
06-14-2023 05:19 AM
I got it, I use "application/x-www-form-urlencoded" in the first request, so i can get the token.
Then I can use this token in the second request "application/json"
Everything is working fine now, thanks a lot dears.
06-12-2023 01:10 AM
I think you have to make 2 rest calls.
First for getting the access token, second for getting the data (With the access token).
Try to look at this.
Solved: Debugging UCCX Rest call - Cisco Community
So instead of putting it in the headers section, put it in the URL paramters section,
06-13-2023 12:39 AM
Thank you for your reply, I'm trying to do the authorization as the below:
That's how its working in Postman, but couldn't apply it in the rest-call in the ccx script.
06-13-2023 04:45 AM
This would be what @Thomas G. Johannesen suggested that you'd need to do.
So in CCX you'd need to do two REST calls, the first one to get the Token and then you use that in the next REST call.
06-13-2023 11:22 PM
Cool, my issue how to get the parameters that i have to use depends on the OAuth2.0 that i have used in the postman
06-14-2023 12:52 AM
Your first request will look something like this:
url?client_id=<clientID>&client_secret=<clientSecret>
Look at this page:
This will return your token (in XML og JSON), that you can use in your next request
06-14-2023 02:55 AM - edited 06-14-2023 02:56 AM
I tried to use it in the postman first to check if it's working, i tried it as the following but not working:
{
"client_id": "ABC",
"client_secret": "XYZ",
"grant_type": "client_credentials"
}
I'm getting error Invalid_Client,
I tried the following urls:
https://<url>/oauth/oauth2.0/
https://<url>/oauth/oauth2.0/token
with same error
06-14-2023 05:19 AM
I got it, I use "application/x-www-form-urlencoded" in the first request, so i can get the token.
Then I can use this token in the second request "application/json"
Everything is working fine now, thanks a lot dears.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide