cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
603
Views
0
Helpful
2
Replies

UCCX - SCRIPT- MAKE REST CALL - EMPTY BODY FIELD

pablo.beraldi
Level 1
Level 1

I am putting together a script in the contact center, which must make queries to an external base by Make rest Call.
I must make a POST to a database so that it brings me a TOCKEN and then when that works, with that token I must validate myself and make a GET to bring me users.

The problem is that I can't make the first POST work, although I put together a stream that I see sends the correct values, on the client side, it tells me that the BODY field arrives empty.

I share the script to see if you can help me.

 

BODY:

"----WebKitFormBoundary7MA4YWxkTrZu0gW" +System.lineSeparator()+
"Content-Disposition: form-data; name=" + '\"' + "grant_type"+ '\"' +System.lineSeparator()+
System.lineSeparator()+
"password" +System.lineSeparator()+
"----WebKitFormBoundary7MA4YWxkTrZu0gW" +System.lineSeparator()+
"---WebKitFormBoundary7MA4YWxkTrZu0gW" +System.lineSeparator()+
"Content-Disposition: form-data; name=" + '\"' + "client_secret" + '\"' +System.lineSeparator()+
System.lineSeparator()+
"l493T8GYETfpdIf7WXIHIuj0Gb22MGhkts00K4FJ" +System.lineSeparator()+
"----WebKitFormBoundary7MA4YWxkTrZu0gW" +System.lineSeparator()+
"Content-Disposition: form-data; name=" + '\"' + "username" + '\"' +System.lineSeparator()+
System.lineSeparator()+
"bghtechpartner@avalian.com" +System.lineSeparator()+
"----WebKitFormBoundary7MA4YWxkTrZu0gW" + '\"' +System.lineSeparator()+
"Content-Disposition: form-data; name=" + '\"' + "password" + '\"' +System.lineSeparator()+
System.lineSeparator()+
"bghtechpartner@Avalian2021" +System.lineSeparator()+
"----WebKitFormBoundary7MA4YWxkTrZu0gW"

 

Thank you

2 Replies 2

Can you post what your REST step looks like?

 

david

pablo.beraldi
Level 1
Level 1

I share the script.

The parameters requested by the client are these:

 

Datos de acceso:
grant_type: password
client_id:324
client_secret: l493T8GYETfpdIf242343242MGhkts00K4FJ
username: userneme
password: password
 
If I try this in postman it works correctly:
 
2022-02-17 10_20_31-Postman.png
 
The output I see through RTMT is the following:
 
 
862888781: Dec 27 13:59:36.721 ART %MIVR-STEP_REST-7-UNK: [MIVR_ENG_TASKS-31-25-TASK:0x7af0649e8_ACASALUD/Avalian/TEST_RESAP_PabloI.aef] com.cisco.wfapi.impl.WFTracingLogImpl Task: 33001196008 The parameters for the REST call are URL=https://api-test.acasalud.com.ar/aca_salud_test/public/oauth/token, USERNAME=bghtechpartner@avalian.com CONTENT-TYPE=multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
api.impl.WFTracingLogImpl Task: 33001196008 The input body is: ----WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="grant_type"

password
----WebKitFormBoundary7MA4YWxkTrZu0gW
---WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="client_secret"

l493T8GYETfpdIf7WXIHIuj0Gb22MGhkts00K4FJ
----WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="username"

bghtechpartner@avalian.com
----WebKitFormBoundary7MA4YWxkTrZu0gW"
Content-Disposition: form-data; name="password"

bghtechpartner@Avalian2021
----WebKitFormBoundary7MA4YWxkTrZu0gW

862888785: Dec 27 13:59:37.381 ART %
 

But on the client side, it tells me that the body field is empty.

What am I doing wrong?

Thanks