diff --git a/docs/server-api.md b/docs/server-api.md index f95f6b4..8be737a 100644 --- a/docs/server-api.md +++ b/docs/server-api.md @@ -2,4 +2,15 @@ title: Server API --- -TODO: describe API usage +### Authentication + +The authentication is implemented via cookies. In order to obtain a valid cookie, one must simply copy the `auth_token` one from the browser's console and use to for desired API calls. + +![cookie](/img/content/server-api/cookie.png) + +For example, in order to update a given player's skill, one can execute the following command: + +```bash +$ curl -b "auth_token=" -X PUT -H "Content-Type: application/json" -d '{"scout":4,"soldier":6,"demoman":3,"medic":2}' https://api.tf2pickup.eu/players/76561199195756652/skill +{"scout":4,"soldier":6,"demoman":3,"medic":2} +``` diff --git a/static/img/content/server-api/cookie.png b/static/img/content/server-api/cookie.png new file mode 100644 index 0000000..d3ab49c Binary files /dev/null and b/static/img/content/server-api/cookie.png differ