I’m trying to code using a latest API "webflow-api": "^2.3.1"
and using Typescript to code the solution.
I can’t seem to figure out where code the collection for the call.
Here’s the start of the code:
const collectionItemFieldData : Webflow.CollectionItemFieldData = {
name: '',
slug: '',
}
const collectionItem : Webflow.CollectionItem = {
id: '1234',
isArchived: false,
isDraft: true,
fieldData: collectionItemFieldData
}
const response = await webflow.collections.items.createItem(webflowCmsCollectionId, collectionItem);
But the CollectionItemFieldData doesn’t appear to accept an array of items based on the interface definitions. Just name and slug attributes.
I didn’t see any good examples here:
I may just use the raw JSON Rest Services and the API suggestions instead if I can’t figure out how to build a full key value pairs using the classes provided in the API.