|
| 1 | +# PHP SDK for the Webflow CMS API |
| 2 | +Implementation based on [Webflow CMS API Reference](https://developers.webflow.com/#cms-api-reference) |
| 3 | + |
| 4 | +## Features implemented |
| 5 | +- Get Current Authorization Info |
| 6 | +- List Sites |
| 7 | +- Get Specific Site |
| 8 | +- Publish Site |
| 9 | +- List Domains |
| 10 | +- List Collections |
| 11 | +- Get Collection with Full Schema |
| 12 | +- **Get All Items for a Collection (including paginated results)** |
| 13 | +- **Find one or Create Item by Name** |
| 14 | +- Get Single Item |
| 15 | +- Create New Collection Item |
| 16 | +- Update Collection Item |
| 17 | +- Patch Collection Item |
| 18 | +- Remove Collection Item |
| 19 | + |
| 20 | +## Usage |
| 21 | + |
| 22 | +Check https://university.webflow.com/article/using-the-webflow-cms-api on how to generate `YOUR_WEBFLOW_API_TOKEN` |
| 23 | + |
| 24 | +### Get Current Authorization Info |
| 25 | +``` |
| 26 | +$webflow = new \Webflow\Api('YOUR_WEBFLOW_API_TOKEN'); |
| 27 | +$webflow->info(); |
| 28 | +``` |
| 29 | + |
| 30 | +### List Sites |
| 31 | +``` |
| 32 | +$webflow->sites(); |
| 33 | +``` |
| 34 | + |
| 35 | +### List Collections |
| 36 | +``` |
| 37 | +$webflow->collections(); |
| 38 | +``` |
| 39 | + |
| 40 | +### Get All Items for a Collection (including paginated results) |
| 41 | +``` |
| 42 | +$webflow->itemsAll($collectionId); |
| 43 | +``` |
| 44 | +### Get Single Item |
| 45 | +``` |
| 46 | +$webflow->item($collectionId, $itemId); |
| 47 | +``` |
| 48 | + |
| 49 | +### Create New Collection Item |
| 50 | +``` |
| 51 | +$fields = [ |
| 52 | + 'name' => 'New item created via API', |
| 53 | + # ... |
| 54 | +]; |
| 55 | +$webflow->createItem($collectionId, $fields); |
| 56 | +``` |
| 57 | + |
| 58 | +### Update Collection Item |
| 59 | +``` |
| 60 | +$webflow->updateItem($collectionId, $itemId, $fields); |
| 61 | +``` |
| 62 | + |
| 63 | +### Remove Collection Item |
| 64 | +``` |
| 65 | +$webflow->removeItem($collectionId, $itemId); |
| 66 | +``` |
| 67 | + |
| 68 | + |
| 69 | +## Installation |
| 70 | + |
| 71 | +``` |
| 72 | +# Install Composer |
| 73 | +composer require expertlead/webflow-php-sdk |
| 74 | +``` |
| 75 | +No extra dependencies! You are welcome ;) |
| 76 | + |
0 commit comments