This API allows users to manage their favorite videos and photos from Vimeo and Flickr.
You can :
- Access the list of your bookmarks
- Access a single bookmark
- Add a bookmark
- Update a bookmark
- Delete a bookmark
- Add a keyword to a bookmarks
- Remove a keyword from a bookmarks
- Modify a keyword
- If not already done, install Docker Compose
- Run
docker-compose up --build
(the logs will be displayed in the current shell)
# PHPCsFixer
docker-compose exec php composer lint
docker-compose exec php composer lint:fix
# PHPStan
docker-compose exec php composer phpstan
# PHPUnit
docker-compose exec php composer phpunit
Open Postman or use curl in your terminal.
POST http://localhost:801/bookmarks
{
"url" : "https://vimeo.com/470201160",
"title" : "An awesome video !",
"keywords" : [
{
"name" : "shark"
},
{
"name" : "swim"
}
]
}
Only url
property is required. If you don't specify any title
, by default, the video/photo title will be chosen.
You can add keywords
.
GET http://localhost:801/bookmarks/{id}
It will return the following response :
{
"id": 1,
"title": "An awesome video !",
"url": "https://vimeo.com/470201160",
"createdDate": "2021-04-14T12:58:08+00:00",
"height": 240,
"width": 426,
"duration": 103,
"type": "video",
"keywords": [
{
"id": 3,
"name": "shark"
},
{
"id": 4,
"name": "swim"
}
],
"author": "Les coops de l'information"
}
GET http://localhost:801/bookmarks
DELETE http://localhost:801/bookmarks/{id}
PUT http://localhost:801/bookmarks/{id}
You can also add keywords
on specific bookmark if you forget it :
POST http://localhost:801/bookmarks/{id}/keywords
[
{
"name" : "Awe"
},{
"name" : "Some !"
}
]
Or remove it :
DELETE http://localhost:801/bookmarks/{id_bookmark}/keywords/{id_keyword}
If you've made a spelling mistake in your keyword, don't panic, you can edit it !
PUT http://localhost:801/keywords/{id}
{
"name" : "Sharks"
}