Contents |
URL
https://api.geoloqi.com/1/layer/create
Description
Create a new layer for the current user.
Supported Request Methods
POST
Scope
layer
Parameters
- name RequiredThe name of the layer to create.
- key OptionalA unique identifier for the layer. See the page on De-Duplication for more information
- descriptionThe description of the layer, will appear in layer lists.
- iconA URL pointing to an image to use as the layer icon. The image should be exactly 57 pixels square
- urlIf specified, this URL will be displayed in the app when users browse to the layer
- is_appEither 1 or 0. If set to 1, users will first see an OAuth connection screen when visiting the layer URL which will then provide an access token you can use.
- group_tokenIf provided, associates this layer with the specified group. The group token will be returned in future calls to layer/info.
- latitudeSpecify a latitude, longitude and radius to query for nearby layers with API/layer/nearby
- longitudeSpecify a latitude, longitude and radius to query for nearby layers with API/layer/nearby
- radiusRadius in meters
- publicEither 1 or 0. If set to 1, other users will be able to see and subscribe to this layer.
- extraA hash of keys and values to store along with the layer. Whatever you store here will be returned whenever the layer info is read. See Extra Parameters for more details.
Example Request
{ "name":"MapAttack", "latitude":45.5246, "longitude":-122.6843, "radius":500 }
Response
Success
If the layer was created successfully, you will get the layer ID in the response and a "200 OK" response code.
HTTP/1.1 200 OK {"layer_id":"C8f233"}
Errors
Layers must be named uniquely per user. If a layer already exists with the name provided, you will get a "409 Conflict" response code, but the response body will be identical to a successful request. Additionally, there will be a "Location" header with the URI of the existing layer.
HTTP/1.1 409 Conflict Location: http://api.geoloqi.com/1/layer/info/C8f233 {"layer_id":"C8f233"}
If there was an error, you will get a different response code such as "400 Bad Request" and the JSON returned will contain a descriptive error message. See Error Codes for more information.
{ "error": "invalid_input", "error_description": "Input data must be an array of data points" }