Location Permits

This API allows listing, retrieving, creating, updating, and deleting of Location Permits, as well as associating them to locations and users.

Permits required for a location can be set via the /location endpoint, as described in Associate Location Permit to a Location.

Location Permits held by users can be set via the /user endpoint, described in Associate Location Permit to a User.

Warning

The endpoints described in this page are only accessible if the location_access_permits toggle has been enabled.

List Location Permits

GET /permit/

List all permits.

Sample request:

GET /permit/ HTTP/1.1
Host: api.fieldaware.net
Authorization: Token 9dcae3660ec84eac94bb506e09a9af40
Accept: application/json

Sample response:

HTTP/1.1 200 OK
Content-Type: application/json

{
  "count": 100,
  "items": [
    {
      "name": "Safety Permit",
      "uuid": "d6d22438096503fe72a7c161201c9373",
      "archived": false,
    },
    {
      "name": "Police vetting",
      "uuid": "28a01f359aabafb4ff28347bddd9a24f",
      "archived": false,
    },
    {
      "name": "Security Certification",
      "uuid": "6a360274f3fa2e224e17ba9ece3f4b0a"
      "archived": true,
    }
  ],
  "page": 0,
  "pageSize": 3,
  "sortedBy": []
}
Query Parameters:
  • sortedBy – Available sorting criteria: name

  • name – A filtering value for permit name

  • archived – filtered by archived

Get Location Permit

GET /permit/(permit_ref)

Retrieve a given Location Permit.

Sample request:

GET /permit/d6d22438096503fe72a7c161201c9373 HTTP/1.1
Host: api.fieldaware.net
Authorization: Token 9dcae3660ec84eac94bb506e09a9af40
Accept: application/json

Sample response:

HTTP/1.1 200 OK
Content-Type: application/json

{
  "name": "Security Certification",
  "uuid": "d6d22438096503fe72a7c161201c9373".,
  "archived": false
}

Create Location Permit

POST /permit/

Create a new Location Permit.

Sample request:

POST /permit/ HTTP/1.1
Host: api.fieldaware.net
Authorization: Token 9dcae3660ec84eac94bb506e09a9af40
Accept: application/json

{
  "name": "A new Location Permit"
}
Request JSON Object:
  • name (string) – Name of the permit (required)

Sample response:

HTTP/1.1 201 Created
Content-Type: application/json

{
  "name": "A new Location Permit",
  "uuid": "00bd62a92a004faea233951510167cad"
}

Update Location Permit

PUT /permit/(permit_ref)

Update a given Location Permit. Updates cannot be performed on archived permits.

Sample request:

PUT /permit/d6d22438096503fe72a7c161201c9373 HTTP/1.1
Host: api.fieldaware.net
Authorization: Token 687fe20baeef448bb30db579139dad33
Accept: application/json

{
  "name": "Updated Permit"
}

Sample response:

HTTP/1.1 204 NO CONTENT
Status Codes:

Archive Location Permit

PUT /permit/(permit_ref)/archive

Archives a given Location Permit. By archiving a Location Permit it will be removed from any customers or locations using it.

Sample request:

PUT /permit/d6d22438096503fe72a7c161201c9373/archive HTTP/1.1
Host: api.fieldaware.net
Authorization: Token 687fe20baeef448bb30db579139dad33
Accept: application/json

Sample response:

HTTP/1.1 204 NO CONTENT
Status Codes:

Unarchive Location Permit

PUT /permit/(permit_ref)/unarchive

Unarchives a previously archived Location Permit.

Sample request:

PUT /permit/d6d22438096503fe72a7c161201c9373/unarchive HTTP/1.1
Host: api.fieldaware.net
Authorization: Token 687fe20baeef448bb30db579139dad33
Accept: application/json

Sample response:

HTTP/1.1 204 NO CONTENT
Status Codes:

Delete Location Permit

DELETE /permit/(permit_ref)

Delete a given permit. Only archived Location Permits, and those non-archived that have not being linked to any users and/or locations can be deleted from the system.

Sample request:

DELETE /permit/00bd62a92a004faea233951510167cad HTTP/1.1
Host: api.fieldaware.net
Authorization: Token 687fe20baeef448bb30db579139dad33
Accept: application/json

Sample response:

HTTP/1.1 204 No Content
Status Codes: