Deleting Resources

DELETE /(endpoint_url)/(resource_id)

Similar to the GET of all resources, one can DELETE a given resource by supplying the resource’s ID in the following format /(endpoint_url)/(resource_id). Most commonly, the deleting of a resource can yield two response statuses. Such are as follows:

Status Codes:

Sample delete job request:

DELETE /job/2997d716d3244db0849da662ca426a09 HTTP/1.1
Host: api.fieldaware.net
Authorization: Token 34550715062af006ac4f
Cache-Control: no-cache

Successfull response:

HTTP/1.1 204 NO CONTENT

Not found response:

HTTP/1.1 404 NOT FOUND
Content-Type: application/json

{
  "error": {
    "message": "No Job with id=2997d716d3244db0849da662ca426a09 exists",
    "name": "NotFoundError"
  }
}

Archiving Users

PUT /user/(user_ref)

Similar to deleting resources, one can also archive FieldAware users. An archived user has the following attributes:

  • cannot be updated

  • cannot be deleted

  • cannot log into the FieldAware web application

  • cannot log into the FieldAware mobile applications

  • cannot make any requests against the FieldAware API

One can archive and unarchive a user though updating their archived attribute.

Sample archive:

PUT /user/4a1de64d6b184abfb5692d2443dfa4d2 HTTP/1.1
Host: api.fieldaware.net
Authorization: Token 34550715062af006ac4f
Content-Type: application/json
Accept: application/json

{
  "archived": "true"
}

Sample unarchive:

PUT /user/4a1de64d6b184abfb5692d2443dfa4d2 HTTP/1.1
Host: api.fieldaware.net
Authorization: Token 34550715062af006ac4f
Content-Type: application/json
Accept: application/json

{
  "archived": "false"
}

Sample response:

HTTP/1.1 204 NO CONTENT