Streaming live at 10am (PST)

Create New Collection Item : err":"ValidationError: 'fields' is required"

When i try to submit request to create a CMS item it’s display Error
{“msg”:"‘fields’ is required",“code”:400,“name”:“ValidationError”,“path”:"/collections/5b8fc640345da665caccdcd6/items",“err”:“ValidationError: ‘fields’ is required”}400

i try to submit data array with curl post method :

Here is my requested array format:

{ “fields”: { “name”: “99 Norfolk Street”, “slug”: “99-norfolk-street”, “_archived”: false, “_draft”: false, “property-id”: 10398, “address-1”: “SA1 6JE”, “town”: “Swansea”, “postcode”: “SA1 6JE”, “property-location”: “Mount Pleasant”, “display-address”: “Norfolk Street, SA1”, “location-town”: “Swansea” “location-county”: “Swansea” “price-text”: “£250 Monthly”, “price-monthly”: “250”, “pre-reduction-price”: “”, “beds”: 6, “baths”: 1, “receptions”: 1, “status”: “AV_LET”, “long-description”: " Available for the 2018/2019 academic year Charles Perrett Property are delighted to present this spacious six bedroom student property for rent. The property has an open plan kitchen with large lounge and benefits from five double bedrooms and one good sized single (Don’t worry the rent is cheaper on this room!). There is also a bathroom, WC and separate shower room. Viewing comes highly recommended! ", “short-description”: "A spacious six bedroom student property for rent. The property has an open plan kitchen with large lounge and benefits from five double bedrooms and one good sized single (Don’t worry the rent is cheaper on this room!). ", “garden”: “”, “remaining-lease”: “”, “price-reduced-date”: “”, “available-from”: “01/07/2018”, “furnished”: “F”, “photo-1”: { “fileId”: “580e63fe8c9a982ac9b8b749”, “url”: “https://d1otoma47x30pg.cloudfront.net/580e63fc8c9a982ac9b8b744/580e63fe8c9a982ac9b8b749_1477338110257-image20.jpg” }, “updated-on”: “2018-09-12T08:11:14.269Z”, “updated-by”: “Person_5a95c05c41e04900018a4914”, “created-on”: “2018-09-10T11:17:50.440Z”, “created-by”: “Person_5a95c05c41e04900018a4914”, “published-on”: “”, “published-by”: “” }

help me to understand.

Can you post the full curl command you ran which resulted in that error (with the API token censored!) please?

I have the exact same problem.
I am making requests with the python requests library.

It is done exactly as mentioned above, and “fields” is included in the payload.
Whether I try to send bytes or a dict or a json string, I can’t get around this error and this may be a show stopper.

The documentation is not exactly helpful here.

Appreciate guidance.

Make sure that you are providing the required information. Check each field in the schema.

http://developers.webflow.com/#get-collection-with-full-schema

I have checked and am constructing the request accordingly. Please note that it does not ask for a certain field, it asks for “fields”, which is the key to the field values. I am of course including this.

I can’t see your JSON data, I can’t see your API call, nor your schema. So I have no way of knowing what you are actually doing. When I first got my hands on the webflow API, I used postman to work out my issues. I’m not having any now.

Spent a couple hours looking at this because i was having a similar problem. When using Python’s requests library , use the json= parameter instead of the data= parameter to correctly pass the “fields” JSON object to the Webflow API.

ie:

#creating a new item
r = requests.request("POST", 
        "https://api.webflow.com/collections/<collection_id>/items", 
        headers=headers, 
        json=body)

For fellow Googlers: fields is required code 400 or fields must be of object type code 400