webflow / js-webflow-api

Node.js SDK for the Webflow Data API
https://www.npmjs.com/package/webflow-api
296 stars 95 forks source link

API Issue: Date/Time is not a valid format. #109

Closed AdityaBorkar closed 1 year ago

AdityaBorkar commented 1 year ago

This is an issue with reference to Webflow Documentation and not the SDK. I do not know where to report it.

Request from API Playground on https://developers.webflow.com/reference/create-field

const options = {
  method: 'POST',
  headers: {
    accept: 'application/json',
    'content-type': 'application/json',
    authorization: 'Bearer ************'
  },
  body: JSON.stringify({isRequired: true, type: 'Date/Time', displayName: 'Manufacturing Date'})
};

fetch('https://api.webflow.com/beta/collections/************/fields', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));

Returns:

{
  "message": "Validation Error: Invalid field type: Date/Time",
  "code": "validation_error",
  "externalReference": null,
  "details": []
}

Solution I tried using the format type "DateTime" instead of "Date/Time" and it worked.

Requesting you make the changes in the documentation.

RodneyU215 commented 1 year ago

Thanks for reporting this issue! I'll get this resolved.

RodneyU215 commented 1 year ago

This has been fixed and deployed!