When i create new entry with API with POST, rows stay empty

I post this :

record = {
“EAN”: 0,
“KEYWORDS”: “string”,
“Store”: “string”,
“IMAGE_URL”: “string”,
“longitude”: 0,
“latitude”: 0,
“PRICE”: “string”,
“Time”: “2019-08-24T14:15:22Z”,
“Name”: “toto”,
“CITY”: “string”
}

shops_endpoint = “https://api.adalo.com/v0/apps/xxxxxxxxx/collections/blblblblb

headers ={}
headers[“Accept”] = “application/json”
headers[“Authorization”] = “Bearer blabla”
resp = requests.post(shops_endpoint, headers=headers, data=record)

the row is created, but in adalo, the row stay empty.
How to fix it ?
Thanks

Two things,

  1. It should be headers["Content-Type"]="application/json"
  2. If should be requests.post(shops_endpoint, headers=headers, json=record)


2 Likes

super, thanks !!!