Skip to content

REST API Documentation

aenygma edited this page Feb 28, 2020 · 1 revision

Endpoints:

  • List Incidents: /list
  • Report Incident: /report
  • Register Account: /register

List Incidents:

Get a list of recorded incidents.

URL : /list

Method : GET

Auth required : YES

Permissions required : None

Success Response

Code : 200 OK

Content examples

For a User with ID 1234 on the local database where that User has saved an email address and name information.

{
    "id": 1234,
    "first_name": "Joe",
    "last_name": "Bloggs",
    "email": "[email protected]"
}

For a user with ID 4321 on the local database but no details have been set yet.

{
    "id": 4321,
    "first_name": "",
    "last_name": "",
    "email": ""
}

Notes

  • If the User does not have a UserInfo instance when requested then one will be created for them.

Report Incidents:

Get a list of recorded incidents.

URL : /list

Method : GET

Auth required : YES

Permissions required : None

Success Response

Code : 200 OK

Content examples

For a User with ID 1234 on the local database where that User has saved an email address and name information.

{
    "id": 1234,
    "first_name": "Joe",
    "last_name": "Bloggs",
    "email": "[email protected]"
}

For a user with ID 4321 on the local database but no details have been set yet.

{
    "id": 4321,
    "first_name": "",
    "last_name": "",
    "email": ""
}

Notes

  • If the User does not have a UserInfo instance when requested then one will be created for them.

Register:

Get a list of recorded incidents.

URL : /register

Method : GET

Auth required : YES

Permissions required : None

Success Response

Code : 200 OK

Content examples

For a User with ID 1234 on the local database where that User has saved an email address and name information.

{
    "id": 1234,
    "first_name": "Joe",
    "last_name": "Bloggs",
    "email": "[email protected]"
}

For a user with ID 4321 on the local database but no details have been set yet.

{
    "id": 4321,
    "first_name": "",
    "last_name": "",
    "email": ""
}

Notes

  • If the User does not have a UserInfo instance when requested then one will be created for them.