Share feedback, ideas and get community help

Updated 2 months ago

Question about the body of http requests

At a glance

The community member is having an issue with an API that requires integer parameters, but their application only stores strings or arrays. They tried passing the variables without quotes, but that didn't work. Another community member suggested putting the number in a list, but that also didn't solve the issue. Eventually, the community member discovered the problem was with the variable they were using, not the data type. While the API only accepts integers, the community member was unable to determine the exact mechanism behind how the values were being converted to integers.

Hello everyone, how are you?
The question in question is about the request body.
I save some data in variables that I later need to send to an API to retrieve other data. However, this API has some cases where it validates numbers as integer and since Typebot only stores strings or arrays of them, I am not able to communicate with it efficiently.
Is there any way to make the https request by passing some parameters as integers instead of strings?

Excuse my English.

Thanks in advance
L
M
m
6 comments
Fala Marcos! Imagino que seja BR...
Então, não seria só colocar a variável fora de aspas?

Por exemplo, em uma requisição comum, passando strings seria algo assim:

{
"nome": "{{variavelNome}}",
"telefone": "{{variavelTelefone}}"
}

Imagino que para passar o telefone como um inteiro, por exemplo, basta passar assim:

{
"nome": "{{variavelNome}}",
"telefone": {{variavelTelefone}}
}

Espero ter ajudado
opa, sou msm kkk.. tentei assim mas não funciona.. se vc não coloca a aspas ele passa o body da requisição como uma unica string
Putz mano, achei que o problema fosse mais simples...

E se colocar dentro de uma lista?

{
"texto": "teste",
"numero": [123]
}

No caso só teria que acessar o item no destino, com numero[0] (dependendo do destino, óbvio)
Send a example of your body json payload
I discovered the problem. I was putting the wrong variable when sending. Even so, the API only accepts int, but I don't know how the type works behind the scenes that ends up sending the value to int.
Anyway, thanks for your attention, I'll be closing the topic
Add a reply
Sign up and join the conversation on Discord