POST request not working - problem with quotes in body / properties

Hi, I have created a POST request in the REST API module to create record in AiTable.

From their documentation, here is how the request should look like:

curl -X POST "https://aitable.ai/fusion/v1/datasheets/dstfm9TvQFbnM70AHZ/records?viewId=viwqUaSw1wGgc&fieldKey=name"  \
  -H "Authorization: Bearer_TOKEN" \
  -H "Content-Type: application/json" \
  --data '{
  "records": [
  {
    "fields": {
      "Prénom": "Jimmy",
      "Nom": "Test",
      "email de l'inscrivant": "fan.cat.test@gmail.com",
      "Nom de l'établissement": "Test ABC",
      "Statut": "Nouvelle inscription"
    }
  }
],
  "fieldKey": "name"
}'

I have defined the endpoint and headers in REST, and following properties:

In the body, JSON format, I have entered:

'{
  "records": [
  {
    "fields": {
      "Nom":"${properties->get('nom')",
    }
  }
],
  "fieldKey": "name"
}'

In the pane with CURL preview, as you can see in screenshot, although I have put quotes in the body, they have disappeared after the value coming from properties, and request is not successful.
I have tried removing quotes in the body and putting them in the properties value, but nothing works.
Any idea why it is wrong?

website: https://step2you.divhunt.website/

image

I just tried exactly that, and it shows correctly, but I get timeout

When executing and inspecting the activity, I see that executed API request has request url and payload which does not correspond to the content of the defined API request itself. Any idea why the POST request is not really executed?

When I execute the same in another tool, it works perfectly (Postman type of tool)

@Fanny

You would need to send body data as RAW, then it works

image

:champagne: :partying_face: :star_struck:

So tiny change, but so big difference!
Thank you so much @dejan !

Now I am wondering why / how to use the JSON option :thinking:

@Fanny

It’s how they made the endpoint, so data should be sent as RAW, so all good, if it works, use it :smiley:

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.