Creating Location Providers

To create a new location provider we need to do a POST request to /locationProviders with the application/json content-type request header and a JSON object containing the specified properties in the request body.

Properties

Name Mandatory Type Length Example
id false string(*1) 36 "bd4be9b3-913f-4481-b363-88d490b95099"
name true string 128 "Test"
details false string(*2) - "{\"email\": \"test@abc.com\"}"
locationsSource.endpoint false string(*3) 256 "http://remote.locations"
archivingPeriod true int(*4) - 7

Notes

  1. If not provided locations service will automatically assign a new id.
  2. Must be well formed json, as specified in RFC 4627
  3. If specified then indicates that this is a remote location provider. Location services will use provided url to fetch locations.
  4. Archiving period must be in the range 1-30

Required Permission

can-create-location-providers

See Auth* (scopes).

Request

Create location provider:

POST /locationProviders
Content-Type: application/json
{
  "id": "68144875-24e5-4a31-ae74-f0924d2c513e",
  "name": "Test",
  "details": "{\"tag\":\"test\"}",
  "locationsSource": {
    "endpoint": "http://remote-locations"
  },
  "archivingPeriod": 7
}

Response

HTTP/1.1 201 CREATED
{
   "rel":"self",
   "href":"/locations/68144875-24e5-4a31-ae74-f0924d2c513e"
}

Failure

Request error; e.g. invalid JSON object:

HTTP/1.1 400 BAD REQUEST
{
   "error":"Invalid property: 'deetails'"
}

User doesn't have the required permission:

HTTP/1.1 403 FORBIDDEN

Other errors:

HTTP/1.1 500 INTERNAL SERVER ERROR

results matching ""

    No results matching ""