Skip to content

Conversation

@wf-d-whitely
Copy link
Contributor

Adding new methods and passing data into the delete method.

const Webflow = require('webflow-api');

const api = new Webflow({
  token: "<access_token>",
});

Promise.all([
  api.publishItems({
    collectionId: "<collection_id>",
    itemIds: [
      "<item_id_1>",
      "<item_id_2>",
      "<item_id_x>",
    ],
  }),
  api.deleteItems(
    {
      collectionId: "<collection_id>",
      itemIds: [
        "<item_id_1>",
        "<item_id_2>",
        "<item_id_x>",
      ],
    },
    { live: true }
  ),
]).then((x) => console.log(x));

returns

[
  {
    publishedItemIds: [
      "<item_id_1>",
      "<item_id_2>",
      "<item_id_x>",
    ],
    errors: [],
    _meta: { rateLimit: { limit: 60, remaining: 57 } }
  },
  {
    unpublishedItemIds: [
      "<item_id_1>",
      "<item_id_2>",
      "<item_id_x>",
    ],
    errors: [],
    _meta: { rateLimit: { limit: 60, remaining: 56 } }
  }
]

@wf-d-whitely wf-d-whitely marked this pull request as ready for review August 15, 2022 17:33
@johnagan johnagan merged commit a866abd into webflow:master Aug 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants