API not accepting fields that can be found in Webflow

I am having this weird issue where the API is returning the following error, even though the fields are in webflow.

"msg": "Validation Failure",
"code": 400,
"name": "ValidationError",
"path": "/collections/5ec30089e5ad983217e86c24/items",
"err": "ValidationError: Validation Failure",
"problems": [
    "Field 'url': Field not described in schema",
    "Field 'longitude': Field not described in schema",
    "Field 'latitude': Field not described in schema"
],
"problem_data": [
    {
        "slug": "url",
        "msg": "Field not described in schema"
    },
    {
        "slug": "longitude",
        "msg": "Field not described in schema"
    },
    {
        "slug": "latitude",
        "msg": "Field not described in schema"
    }
],

The request Iā€™m sending to Webflow:
{
ā€œfieldsā€:{
ā€œnameā€:ā€œA Placeā€,
ā€œslugā€:ā€œa-placeā€,
ā€œtypeā€:ā€œhouseā€,
ā€œaddress-line-1ā€:ā€œ19 Forster Crescentā€,
ā€œaddress-line-2ā€:ā€œā€,
ā€œsuburbā€:ā€œYARRALUMLAā€,
ā€œstateā€:ā€œACTā€,
ā€œpostcodeā€:ā€œ2600ā€,
ā€œcountryā€:ā€œAUSTRALIAā€,
ā€œurlā€:ā€œhouses.realestate.comā€,
ā€œlongitudeā€:149.117685,
ā€œlatitudeā€:-35.303123,
ā€œ_archivedā€:false,
ā€œ_draftā€:false
}
}

Iā€™m so stumped as to what to do. Iā€™ve tried deleting them and using string instead of url. Iā€™ve tried republishing them. Iā€™ve tried pulling them on the Get Collection API (they donā€™t appear).

I might be misunderstanding here, but you canā€™t ask for specific fields in the query. Just the collection items (which will return all fields anyways).

Edit: Oh wait, youā€™re trying to post? tried using case sensitive field names?

Yes Iā€™m trying to POST. Tried case sensitive field names. That doesnā€™t work

Any resolution? Having same issue

The field name that you see in the CMS Editor (in the designer) might not be the actual name of the field. You need to request the schema for that specific collection list and work with the slugs presented in the JSON response

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

3 Likes

It would be great is we could control the publish date from the API. Otherwise when I update it, it updates the publish date which is weird.

Iā€™m helping a screen recorder CloudApp with their site and they need some major changes done to the blog so Iā€™m trying to use the API to do them but because Iā€™m not setting the Date Published values manually in the web interface it is just resetting the published date. Is there a field that I can hit that isnā€™t private that would allow me to prevent this issue?

I was facing the same issues trying to update my e-commerce collection item using this API https://developers.webflow.com/?javascript#update-product , then I found I could do the update using https://developers.webflow.com/?javascript#patch-collection-item as well and it worked alright for me.
PS: The API uses PATCH method instead of POST