Update notes authored by ekes's avatar ekes
......@@ -21,7 +21,7 @@ The radar database consists of the following entities:
Each entity comes with a set of fields. All entities have a common field UUID which uniquely identifies an entity instance.
This documentation follows json only, it is possible to change to other formats including xml by altering the extension.
This documentation follows json only, it is possible to change to other formats including xml by altering the url extension, or the Accept header in the GET request.
# Entity Endpoints
......@@ -382,4 +382,30 @@ This is where there will usually be facets to cover the requirement.
# Authentication
For retrieving entities, and searching, you don't need to authenticate. To post you will. To post via the API it's best to ask radar@squat.net for permission for the account to be used, as this can be restricted at any time.
To authenticate at the moment you need to get a cookie and token using the username and password associated with the account.
```
POST https://radar.squat.net/api/1.2/user/login
Content-Type: application/json
Accept: application/json
Content: { 'username' => USERNAME, 'password' => PASSWORD }
```
For which you will get a response including the required cookie and in the body of the response the `token` for to be used in all future requests as the `X-CSRF-Token` header.
# Posting entities
The end points are the same as for retrieving entities. If you POST to /api/1.2/node you will get a UUID assigned to a new entity. If you PUT to /api/1.2/node/[uuid] you can set the UUID of the entity.
```
POST https://radar.squat.net/api/1.2/
Content-Type: application/json
Accept: application/json
Cookie: see above
X-CSRF-Token: see above
Content: {
}
```
\ No newline at end of file