pull/280/head
Piero Toffanin 2017-08-31 17:53:28 -04:00
rodzic a25456d5fe
commit 53bdc3d748
2 zmienionych plików z 4 dodań i 4 usunięć

Wyświetl plik

@ -51,6 +51,6 @@ Since applications sometimes do not allow headers to be modified, you can also a
### Token Expiration
The token expires after a set amount of time. The expiration time is dependent on WebODM's settings. You will need to request another token when a token expires.
The token expires after a predefined amount of time. The expiration time is dependent on WebODM's settings. You will need to request another token when a token expires.
You know that a token has expired if any call to an API returns a `403` status code with the JSON body `{'detail': 'Signature has expired.'}`.
You know that a token has expired if any API call returns a `403` status code with the JSON body `{'detail': 'Signature has expired.'}`.

Wyświetl plik

@ -1,6 +1,6 @@
## Handling Errors
All API calls use the status codes as described in the [Django REST Framework's Status Code Guide](http://www.django-rest-framework.org/api-guide/status-codes/), but generally you only need to check for success status code (status code `200` or `204`) and handle the special case of [Token Expiration](#token-expiration) (status code `403`) and report an error otherwise.
All API calls use the status codes as described in the [Django REST Framework's Status Code Guide](http://www.django-rest-framework.org/api-guide/status-codes/), but generally you only need to check for success status codes (`200` or `204`), handle the special case of [Token Expiration](#token-expiration) (`403`) and report an error otherwise.
### Error Status Codes
@ -13,4 +13,4 @@ Status Code | Description
400 | Malformed request
404 | Not found
For security reasons, sometimes an operation which should return `403` returns `404` to avoid disclosing IDs and other information from attackers.
For security reasons, sometimes an operation which should return `403` returns `404` to avoid disclosing IDs and other information to attackers.