|
| 1 | +# 🔌 Arduino resource |
| 2 | + |
| 3 | +All the Arduino projects from the [projects hub](https://arduino.becauseofprog.fr) are in this endpoint. |
| 4 | + |
| 5 | +### Arduino project object |
| 6 | + |
| 7 | +| Field | Type | Description | Can be null ? | |
| 8 | +| ------------- | ---------------------------------- | ---------------------------------- | ------------- | |
| 9 | +| url | string | project's URL | | |
| 10 | +| author | [user object](User.md#user-object) | project's author | | |
| 11 | +| name | string | project's name | | |
| 12 | +| summary | string | project's summary | | |
| 13 | +| illustration | string | picture to illustrate project | ✅ | |
| 14 | +| video | string | video to illustrate project | ✅ | |
| 15 | +| link | string | link to further informations | ✅ | |
| 16 | +| description | string | project's description | ✅ | |
| 17 | +| timestamp | int | unix timestamp, project's creation | | |
| 18 | +| is_from_staff | boolean | if the project is from the staff | | |
| 19 | +| is_featured | boolean | if the project is featured | | |
| 20 | + |
| 21 | +## Get all projects |
| 22 | + |
| 23 | +`GET /arduino-projects` |
| 24 | + |
| 25 | +Get all the projects. Returns a `data` list with [arduino project objects](#arduino-project-object) inside. |
| 26 | + |
| 27 | +## Create project |
| 28 | + |
| 29 | +`POST /arduino-projects` |
| 30 | + |
| 31 | +Create a new Arduino project. Requires auth. |
| 32 | + |
| 33 | +### Required data |
| 34 | + |
| 35 | +| Field | Type | Description | |
| 36 | +| ------- | ------ | ----------------- | |
| 37 | +| url | string | project's URL | |
| 38 | +| name | string | project's name | |
| 39 | +| summary | string | project's summary | |
| 40 | + |
| 41 | +### Optional data |
| 42 | + |
| 43 | +| Field | Type | Description | |
| 44 | +| ------------ | ------ | ----------------------------- | |
| 45 | +| illustration | string | picture to illustrate project | |
| 46 | +| video | string | video to illustrate project | |
| 47 | +| link | string | link to further informations | |
| 48 | +| description | string | project's description | |
| 49 | + |
| 50 | +## Get project |
| 51 | + |
| 52 | +`GET /arduino-projects/{arduino-project.url}` |
| 53 | + |
| 54 | +Get one project by its URL. Returns a [arduino project object](#arduino-project-object) called `data`. |
| 55 | + |
| 56 | +## Edit project |
| 57 | + |
| 58 | +`PATCH /arduino-projects/{arduino-project.url}` |
| 59 | + |
| 60 | +Edit a prokect. Requires auth and to be the project's author. |
| 61 | + |
| 62 | +**Editable fields :** `name`, `summary`, `illustration`, `video`, `link`, `description`. |
| 63 | + |
| 64 | +## Delete project |
| 65 | + |
| 66 | +`DELETE /arduino-projects/{arduino-project.url}` |
| 67 | + |
| 68 | +Delete a project. Requires auth and to be the project's author. |
0 commit comments