EZW’s API uses JWT Authentication for accessing user data. In order to request any tasks, first you must retrieve your token by signing in.
All API requests that expect user data should include an Authorization
HTTP header as follows:
Authorization: Bearer JWT_TOKEN
It is possible to make requests to the API using curl
from the command line as follows:
curl https://api_url/task \\
-X POST
-H "Content-Type: application/json" \\
-H "Authorization: Bearer $JWT_TOKEN" \\
-d '{
"title": "Do the chores",
"contents": "This includes doing the laundry, washing the dishes, and mopping the floors.",
"completed": false
}'
Upon completion of request, a JSON is returned of the results of the request. In this case, a JSON with HTTP code 200 StatusOK
should return if we were correct in authentication and nothing went wrong on our end.
GET <https://api.ezw.com/tasks
>
Retrieves all tasks’ basic information for the user defined by their JWT. To retrieve further information, retrieve by ID.