API Call body issue - prevent ASCII character conversion

through the API call standard action , I need to send in the body a token

token example : Echg5JtWntpOJ/NUnetyZeUz
so in the body :
“JWT_tid”: “Echg5JtWntpOJ/NUnetyZeUz”

I checked on the API server receiving the call and the token was converted to :

“Echg5JtWntpOJ & #x2F;NUnetyZeUz”
where & #x2F; represent the ASCII value for the “/”

I already checked and my header has the raw json format required with utf-8 ?

“Authorization”: “Token test;Tokenv=1234”,
“Content-Type”: “application/json;charset=utf-8”

what am I missing ?
Thanks for your insights

I couldn’t reproduce this with latest version.

Making a “Call API” skill:

Sniffing the traffic (e.g. with Wireshark):


Hi @asashour, thanks for your reply .
so, to share more insights :smiley:
OS : Ubuntu 18.04.2 LTS
Botpress version : 12.3.1

When I run a tcpdump on the host machine ( command : tcpdump -c 20 -s 0 -A host YYYYY )
here is the extract lines ( note that I put a space after the ASCII code as otherwise the forum editor translate it properly :

08:26:08.304943 IP ip-XXXXXXX.us-east-2.compute.internal.42270 > YYYYYYYY.us-east-2.compute.amazonaws.com.http-alt: Flags [P.], seq 1:599, ack 1, win 211, options [nop,nop,TS val 2034628192 ecr 2727048786], length 598: HTTP: POST /server-api/assert?uid=john&did=1&aid=ticket_API&sid=b24a8ae4-0dec-4e20-9851-405b16fbaf70 HTTP/1.1
yE.`…vRPOST /server-api/assert?uid=john&did=1&aid=ticket_API&sid=b24a8ae4-0dec-4e20-9851-405b16fbaf70 HTTP/1.1
Accept: application/json, text/plain, /
Content-Type: application/json; charset=utf-8
Authorization: Token test;tid=test
User-Agent: axios/0.19.0
Content-Length: 253
Host: YYYYYY:80
Connection: close

“jwt_id”: “9L6pA6X+uF2fwUDHL&#x2F ;Fz4+mn”,
“action”: “authentication”,
“data”: {
“approval_id”: “846a4813-8421-462c-901b-ab566456e1bf”

and of course, in the server logs , I have :

2020-01-05 08:26:06.769 ERROR [default] [96c024_3024] AssertionHandler$ : Unexpected exception on assertion request processing; user id: [john], session: [b24a8ae4-0dec-4e20-9851-405b16fbaf70, auth session: [fc037fce-e5b1-418d-a68d-18cec7491880])
java.util.NoSuchElementException: Assertion of type ‘authentication’ with id ‘9L6pA6X+uF2fwUDHL&#x2F ;Fz4+mn’ not found

Now to give you more insights on previous steps ( which can be involved in the problem ) :
I’m performing a first API call , storing result in temp.response var.
I’m then extracting value and assigning them to temp variables ( in a custom action ) :

temp.approval_id = temp.response.body.data.control_flow[0].methods[0].approval_id
temp.assertion_id = temp.response.body.data.control_flow[0].methods[0].assertion_id
temp.ssid = temp.response.body.headers[0].session_id

and then so, in the 2nd API call , the body in botpress is :

“jwt_id”: “{{temp.assertion_id}}”,
“action”: “authentication”,
“data”: {
“approval_id”: “{{temp.approval_id}}”

Any insights then ? am I doing something wrong ?
Thx !

Try to use three curly brackets instead of two, i.e. {{{temp.assertion_id}}}, so the value is sent without XML escaping.

Thanks a lot, it works :D, basic trick … I’m a newbie …
I have now an issue looping for the API call , but it is a different topic, I will create a new post …
Thx !