Add a person search REST ressource.
[Project_proches_de_moi-server.git] / tests / curl.txt
... / ...
CommitLineData
1* Create a user:
2curl --request POST http://localhost:8000/api/person/register --data "{ \"firstname\": \"James\", \"lastname\": \"Elbow\", \"email\": \"james@elbow.com\", \"password\": \"FD3CC7719AB1776B81D70B65170D8A51119E127488C106622E0D2E680C1B3FFF\" }" --header "Content-Type: application/json"
3
4* Delete a user with id 1:
5curl --request DELETE http://localhost:8000/api/person/1
6
7* Update a user with id 1:
8curl --request PUT http://localhost:8000/api/person/1 --data "{ \"firstname\": \"Jamesson\", \"lastname\": \"Elbow\", \"email\": \"jamesson@elbow.com\" }" --header "Content-Type: application/json"
9
10* Authenticate a user with email and password:
11curl --request POST http://localhost:8000/api/person/authenticate --data "{ \"email\": \"jamesson@elbow.com\", \"password\": \"FD3CC7719AB1776B81D70B65170D8A51119E127488C106622E0D2E680C1B3FFF\"}" --header "Content-Type: application/json"
12
13* Update/add a user with id 1 localisation:
14curl --request POST http://localhost:8000/api/person/1/localisation --data "{ \"timestamp\": \"$(date --iso-8601=seconds)\", \"latitude\": \"43.23\", \"longitude\": \"5.43\" }" --header "Content-Type: application/json"
15
16* Update a user online status:
17curl --request PUT http://localhost:8000/api/person/1/online
18curl --request PUT http://localhost:8000/api/person/1/offline
19
20* Search a user with a keyword:
21curl --request POST http://localhost:8000/api/person/search --data "{ \"keyword\": \"isabelle\"}" --header "Content-Type: application/json"
22
23* Show a user with id 1:
24curl --request GET http://localhost:8000/api/person/1
25
26* Show a user with id 1 friends:
27curl --request GET http://localhost:8000/api/person/1/friends
28
29* Show a user with id 1 friends with me:
30curl --request GET http://localhost:8000/api/person/1/friendswithme
31
32* Show a user with id 1 localisation:
33curl --request GET http://localhost:8000/api/person/1/localisation
34
35* Show a user with id 1 fuzzy localisation at a distance of 300 meters:
36curl --request GET http://localhost:8000/api/person/1/localisation/fuzzy/300
37
38* Show a user with id 1 localisations:
39curl --request GET http://localhost:8000/api/person/1/localisations
40
41* Show a user with id 1 fuzzy localisations at a distance of 300 meters:
42curl --request GET http://localhost:8000/api/person/1/localisations/fuzzy/300