Fix the REST ressource for getting the latest localisation of a user.
[Project_proches_de_moi-server.git] / tests / curl.txt
CommitLineData
3d47ccc8 1* Create a user:
787fc3b7 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"
3d47ccc8
JB
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:
787fc3b7 8curl --request PUT http://localhost:8000/api/person/1 --data "{ \"firstname\": \"Jamesson\", \"lastname\": \"Elbow\", \"email\": \"james@elbow.com\" }" --header "Content-Type: application/json"
3d47ccc8 9
8629835e 10* Update/add a user with id 1 localisation:
787fc3b7 11curl --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"
f0640a52 12
8629835e
JB
13* Update a user online status:
14curl --request PUT http://localhost:8000/api/person/1/online
15curl --request PUT http://localhost:8000/api/person/1/offline
16
f0640a52
JB
17* Show a user with id 1:
18curl --request GET http://localhost:8000/api/person/1
19
3d47ccc8 20* Show a user with id 1 friends:
f0640a52
JB
21curl --request GET http://localhost:8000/api/person/1/friends
22
3d47ccc8 23* Show a user with id 1 localisation:
f0640a52
JB
24curl --request GET http://localhost:8000/api/person/1/localisation
25
3d47ccc8 26* Show a user with id 1 localisations:
f0640a52 27curl --request GET http://localhost:8000/api/person/1/localisations