What am I missing to Post to Cms Api?

Hey Guys,

Testing with postman here to figure out webflows api.

So far I know how to get the site: the collection: the collection Items and a single item.

When reading Dev docs it says add header values:

-H "Authorization: Bearer token" \
  -H 'accept-version: 1.0.0' \
  -H "Content-Type: application/json" \

did that,
I have 1 collection named Authors.
There is only 1 field : Name

In Body Raw / json
I added
“fields”:{
“_archived”: false,
“_draft”: false,
“name”: “Asa blu”,
“slug”: “asa-blu”
}

response is.

{
“msg”: “Invalid request body”,
“code”: 400,
“name”: “ValidationError”,
“path”: “/collections/5de60dea4a5986883b6242d0/items”,
“err”: “ValidationError: Invalid request body”
}

If I take Feilds away it asks for Fields
“msg”: “‘fields’ is required”,
“code”: 400,
“name”: “ValidationError”,

What am I doing wrong here, any help would nice.

Try placing these values in quotes.

Here is an example of the curl data for a put.

-d '{
      "fields": {
      	"name": "5 Great Web Design Resources",
    	"post-body": "<p>Image Test</p><p><img src=\"https://www.gstatic.com/webp/gallery/4.sm.jpg\"></p>",
    	 "_archived":"false",
    	"_draft":"false",
    	"slug":"5-great-web-design-resources"
      }
}
    
'

Thank You WebDev,

So everything in “”

Ill try this out and get back with you.

webflow-api would wrap the values, but, watch for required fields you define in the collection. In case you miss it API would give a quite similar vague response.