Skip to content

Commit ef19e6a

Browse files
committed
Create README.md, add psr-4 autoload
1 parent a65f66f commit ef19e6a

File tree

2 files changed

+95
-14
lines changed

2 files changed

+95
-14
lines changed

README.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
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+

composer.json

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
{
2-
"name": "expertlead/webflow-php-sdk",
3-
"description": "PHP SDK for the Webflow CMS API",
4-
"type": "library",
5-
"require": {
6-
"ext-curl": "*"
7-
},
8-
"license": "MIT",
9-
"authors": [
10-
{
11-
"name": "Oleksii Antypov",
12-
"email": "[email protected]"
13-
}
14-
],
15-
"minimum-stability": "stable"
2+
"name": "expertlead/webflow-php-sdk",
3+
"description": "PHP SDK for the Webflow CMS API",
4+
"type": "library",
5+
"require": {
6+
"ext-curl": "*"
7+
},
8+
"license": "MIT",
9+
"authors": [
10+
{
11+
"name": "Oleksii Antypov",
12+
"email": "[email protected]"
13+
}
14+
],
15+
"autoload": {
16+
"psr-4": {
17+
"Webflow\\": "src/"
18+
}
19+
},
20+
"minimum-stability": "stable"
1621
}

0 commit comments

Comments
 (0)