cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1003
Views
4
Helpful
7
Replies

UCCX - Use authorization with JSON

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:

OmranAlHussamieh_0-1686424759491.png

 

How to achieve this using the UCCX script?

Thanks in advanced,

3 Accepted Solutions

Accepted Solutions

This would be what @Thomas G. Johannesen suggested that you'd need to do.

image.png

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.



Response Signature


View solution in original post

Your first request will look something like this:

 

url?client_id=<clientID>&client_secret=<clientSecret>

Look at this page:

Get OAuth 2.0 Token (POST) | Authorization Server OAuth 2.0 Token Service | Akana OAuth API | Akana Documentation

This will return your token (in XML og JSON), that you can use in your next request

Please rate helpful posts and if applicable mark "Accept as a Solution".
Thanks, Thomas G. J.

View solution in original post

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.

View solution in original post

7 Replies 7

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,

 

Please rate helpful posts and if applicable mark "Accept as a Solution".
Thanks, Thomas G. J.

Thank you for your reply, I'm trying to do the authorization as the below:

OmranAlHussamieh_0-1686641866191.png

OmranAlHussamieh_1-1686641895492.pngOmranAlHussamieh_2-1686641929774.png

That's how its working in Postman, but couldn't apply it in the rest-call in the ccx script.

This would be what @Thomas G. Johannesen suggested that you'd need to do.

image.png

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.



Response Signature


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

Your first request will look something like this:

 

url?client_id=<clientID>&client_secret=<clientSecret>

Look at this page:

Get OAuth 2.0 Token (POST) | Authorization Server OAuth 2.0 Token Service | Akana OAuth API | Akana Documentation

This will return your token (in XML og JSON), that you can use in your next request

Please rate helpful posts and if applicable mark "Accept as a Solution".
Thanks, Thomas G. J.

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/

https://<url>/oauth/oauth2.0/token

with same error

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.