Introduction

We’ve introduced a REST API to allow you to leverage GIS Cloud’s features in your own apps, as well as help you integrate your data with our platform. This is an introductory guide; we also have a REST API reference.

If your client cannot produce all 4 HTTP verbs (GET, POST, PUT, DELETE) you can specify them using the _method parameter in the URL, e.g. https://api.giscloud.com/1/maps.json?_method=POST

In the examples we use curl, a useful command line utility that can produce all 4 HTTP verbs, making it useful for testing REST API’s. You can use it for trying out our API in order to get a feel for what kind of responses you need to parse, etc. On Linux you can install it via the system’s package manager, on Mac OS X it’s probably already installed on your machine, and on Windows you can download it from the project’s download page.

When it comes to actually using our API, you can of course use any HTTP client or library of your choice.

The information contained on this page is valid for the entire API. For details regarding specific API calls, see the REST API reference.

Protocols

GIS Cloud API uses and requires HTTPS to help guarantee confidentiality, authenticity, and integrity. HTTPS provides a stronger guarantee that a client is communicating with the real API and receiving back authentic contents. It also enhances privacy for applications and users using the API.

Versioning

The version is a mandatory part of all requests.

  • set the version through the URL: .../<version>/...
  • or set the version through a request header: API-Version: <version> If both are used, the version in the URL has priority.

API Keys

Don’t authenticate over HTTP

Keys and tokens should only be used over an HTTPS connection. Using a key or token over HTTP is susceptible to eavesdropping. This puts your key/token (and through this, your data) at risk.

Please store it safely. If the API is accessed with your key through a non secure connection you’ll get a warning in your email.

  • authorize through a request param: api_key=<API_KEY>
  • authorize through a request header: API-Key: <API_KEY>

If both are used, the key sent through the URL has priority.

Key in URL Example

curl "https://api.giscloud.com/1/maps.json?api_key=d41d8cd98f00b204e9800998ecf8427e"

Key in Header Example

curl -H "API-Key: d41d8cd98f00b204e9800998ecf8427e" https://api.giscloud.com/1/maps.json

Creating an API key

An API key is a 32 character long secret word that enables you to access your private data and maps through the API.

It can be created through the GIS Cloud Application. After logging in, click on “My Account” on the top right of the screen. Choose the “API Access” tab, and under the “API Keys” heading, click “Add key”.

Format

Supported format for all API calls is 'json'.

You can specify a format by appending .json to the url or by setting the Content-Type header.

Format over Content-Type header: application/json.

If both are used, the format sent through the URL has priority.

Example with URL

curl https://api.giscloud.com/1/maps.json

Example with Content-Type header

$ curl -H "Content-Type: application/json" https://api.giscloud.com/1/maps.json

Pagination

When requesting large lists of resources, it helps to receive them in chunks instead of one, possibly enormous, list. With the page and perpage parameters, you can choose the size of pages that will be received, as well as which page you currently want.

Example

https://api.giscloud.com/1/maps.json?perpage=3

To view the seventh page, add the page parameter:

https://api.giscloud.com/1/maps.json?perpage=3&page=7

Sorting

Lists of resources can be sorted by any attribute using the order_by query parameter. Set order_by to the desired attribute, and (optionally) add the sorting direction, to have the list sorted.

For example, sorting maps by name looks like this:

https://api.giscloud.com/1/maps.json?order_by=name

Sorting by name in descending order looks like this:

https://api.giscloud.com/1/maps.json?order_by=name:desc

The Map object

Attributes

  • idNumberReadonlyExpandableMap id
  • nameStringRequiredMap name
  • ownerUserObjectExpandableMap owner object. This value only appears if the expand parameter contains the key 'owner'
  • epsgNumberEPSG map projection code
  • proj4StringProj4 map projection
  • unitsStringMap units (meter, foot or foot_us)
  • maxzoomNumberMaximum zoom
  • bgcolorStringMap background color
  • modifiedNumberLast time map was modified (UNIX timestamp)
  • accessedNumberLast time map was accessed (UNIX timestamp)
  • createdNumberTime when map was created (UNIX timestamp)
  • visitedNumberNumber of map views
  • descriptionStringMap description
  • archivedNumberIs map archived (0 or 1)
  • resourceResourceObjectExpandableMap resource object
  • permissions|Array of permissions|ExpandableShows current user's permissions on this resource: READ, EDIT, SHARE, INSERT_MDC, UPDATE_MDC, OWNER
  • optionsArray of optionsExpandableList of options tied to this resource. This value only appears if the expand parameter contains the key 'options'

Map object

{
   "id":"1198",
   "name":"City of Zagreb",
   "owner":{
      "id":"2",
      "username":"test"
   },
   "epsg":"900913",
   "active":"1",
   "copyright":"",
   "proj4":"+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs",
   "units":"meter",
   "maxzoom":"0",
   "bgcolor":"#ff0000",
   "modified":1602773958,
   "accessed":1602773958,
   "created":1593945880,
   "description":"",
   "units_proj4":"meter",
   "visited":"302",
   "resource_id":"14124",
   "measure_unit":"meter",
   "archived":"f",
   "visible":"t",
   "resource":{
      "id":"14124",
      "type":"5",
      "location":null,
      "target_resource_id":"1198",
      "owner_id":"2",
      "parent_id":null,
      "payment_subscription_id":null,
      "payment_id":null,
      "payment_id_obs":null,
      "archived":"0",
      "disabled":null,
      "created":"1593945880",
      "modified":"1593945880"
   },
   "permissions":[
      "OWNER"
   ],
   "bounds":"{\"xmin\":0,\"xmax\":0,\"ymin\":0,\"ymax\":0}"
}

List all maps

GEThttps://api.giscloud.com/rest/1/maps.json

Get list of all maps readable by current user. Read access on a resource is allowed to all users or groups that have reading permissions (or higher) on that resource. Granting reading permissions on a resource to the anonymous user makes that resource publicly readable.

Query Parameters

Attribute name Description
type Filter by visibility: 'public', 'private', 'shared' or 'private,shared'
perpage Number of results per page to display (Default: 100, Maximum: 1000)
page Page number to display
order_by Order by, format '{created|modified|created}:[asc|desc]' E.g. order_by=accessed:desc
expand Expand by 'owner', 'options' and 'permissions'
nototal Total of results is not counted and displayed; improves response time; used for getting the response faster
query_on Fields on which the query will be performed
query Search query

Responses

Code Description
200 Operation successful

Example request

curl -H "API-Key: {USER_API_KEY}" https://api.giscloud.com/rest/1/maps.json

Example response

{
  "type": "maps",
  "total": 199,
  "page": 1,
  "data": [{
    "id":"1198",
    "name":"City of Zagreb",
    "owner":{
        "id":"2",
        "username":"test"
    },
    "epsg":"900913",
    "active":"1",
    "copyright":"",
    "proj4":"+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs",
    "units":"meter",
    "maxzoom":"0",
    "bgcolor":"#ff0000",
    "modified":1602773958,
    "accessed":1602773958,
    "created":1593945880,
    "description":"",
    "units_proj4":"meter",
    "visited":"302",
    "resource_id":"14124",
    "measure_unit":"meter",
    "archived":"f",
    "visible":"t",
    "resource":{
        "id":"14124",
        "type":"5",
        "location":null,
        "target_resource_id":"1198",
        "owner_id":"2",
        "parent_id":null,
        "payment_subscription_id":null,
        "payment_id":null,
        "payment_id_obs":null,
        "archived":"0",
        "disabled":null,
        "created":"1593945880",
        "modified":"1593945880"
    },
    "permissions":[
        "OWNER"
    ],
    "bounds":"{\"xmin\":0,\"xmax\":0,\"ymin\":0,\"ymax\":0}"
  },
  // ...
  ]
}

Retrieve a map

GEThttps://api.giscloud.com/rest/1/maps/{MAP_ID}.json

URI Parameters

Code Description
{MAP_ID} Map ID

Get map by ID.

Read access on a resource is allowed to all users or groups that have reading permissions (or higher) on that resource.

Granting reading permissions on a resource to the anonymous user makes that resource publicly readable.

Query Parameters

Attribute name Description
expand Expand by 'owner', 'options' and 'permissions'

Responses

Code Description
200 Operation successful
404 Resource not found

Example request

curl -H "API-Key: {USER_API_KEY}" "https://api.giscloud.com/rest/1/maps/123.json?expand=permisssions"

Example response

{
   "id":"1198",
   "name":"City of Zagreb",
   "owner":{
      "id":"2",
      "username":"test"
   },
   "epsg":"900913",
   "active":"1",
   "copyright":"",
   "proj4":"+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs",
   "units":"meter",
   "maxzoom":"0",
   "bgcolor":"#ff0000",
   "modified":1602773958,
   "accessed":1602773958,
   "created":1593945880,
   "description":"",
   "units_proj4":"meter",
   "visited":"302",
   "resource_id":"14124",
   "measure_unit":"meter",
   "archived":"f",
   "visible":"t",
   "resource":{
      "id":"14124",
      "type":"5",
      "location":null,
      "target_resource_id":"1198",
      "owner_id":"2",
      "parent_id":null,
      "payment_subscription_id":null,
      "payment_id":null,
      "payment_id_obs":null,
      "archived":"0",
      "disabled":null,
      "created":"1593945880",
      "modified":"1593945880"
   },
   "permissions":[
      "OWNER"
   ],
   "bounds":"{\"xmin\":0,\"xmax\":0,\"ymin\":0,\"ymax\":0}"
}

Create a map

POSThttps://api.giscloud.com/rest/1/maps.json

Create a new map. The user performing this operation is set as the resource's owner.

Responses

Code Description
201 Operation successful

Example request

curl -X POST -d '{"name": "New map name"}' https://api.giscloud.com/1/maps.json

Update a map

PUThttps://api.giscloud.com/rest/1/maps/{MAP_ID}.json

URI Parameters

Code Description
{MAP_ID} Map ID

Update a map.

Responses

Code Description
200 Operation successful
403 Action forbidden
404 Resource not found

Example request

curl -X PUT -d '{"name": "Updated map name"}' https://api.giscloud.com/1/maps.json

Delete map

DELETEhttps://api.giscloud.com/rest/1/maps/{MAP_ID}.json

Delete a map by ID.

Responses

Code Description
200 Operation successful
403 Action forbidden
404 Resource not found

Example request

curl -X DELETE https://api.giscloud.com/1/maps/123.json

Render map

GEThttps://api.giscloud.com/rest/1/maps/{MAP_ID}/render.{FORMAT}

Produces map rendered as image (png,jpg) or as interactive map in an iframe.

URI Parameters

Code Description
{MAP_ID} Map ID
{FORMAT} Using this parameter you can choose image format, it can be in 'jpg' or 'png' for images or 'iframe' for an interactive map.

Query Parameters – render an image of a map

Attribute name Default Description
phender true Starts the rendering engine
timestamp Date/time of creation or modification.
width 256 Image width in pixels.
height 256 Image height in pixels.
layerlist false Set layerlist to visible.
bounds Set bounds of rendered map. E.g. bounds=1674429.541,5684163.171,1876223.296,5816093.482
download false Downloads the rendered map
numscale false Set scale number, e.g. numscale=20000
invalidate false Invalidate cache
justgenerate Just generate the image without saving
saveto Set path to save image

Query Parameters – render an image of a map

Attribute name Default Description
toolbar false Set toolbar to visible.
layerlist false Set layerlist to visible.
popupus false Enable info popups in iframe when feature is selected.
layer_id Set layer id.
feature_id Set feature id.
bounds Set bounds of rendered map.
width 100% Set width of iframe
height 100% Set height of iframe
visibility Set visible layers, e.g. visibility=1011,2121,1543
expressions Set visible expressions for a layer
f Set features field to zoom into
v Set the features field value
numscale Set scale number
layerlist_expanded Set expanded layerlist visible
scalebar Set scalebar visible
noattrib Sets noattrib class, removes attribution from the map
noctrl Sets noctrl class, removes controllers from the map
no3d Disables hardware-accelerated CSS 3D transforms for positioning
lockzoom Disables zoom
style Sets the css file to use

Example request - PNG image

https://api.giscloud.com/1/maps/123/render.png

Example request - interactive map

https://api.giscloud.com/1/maps/124/render.iframe

List map layers

GEThttps://api.giscloud.com/rest/1/maps/{MAP_ID}/layers.json

URI Parameters

Code Description
{MAP_ID} Map ID

List layers in a map, also alternative entry point to /layers.

Responses

Code Description
200 Operation successful
403 Action forbidden
404 Resource not found

Example request

curl -H "API-Key: {USER_API_KEY}" https://api.giscloud.com/rest/1/maps/123/layers.json

Delete map cache

DELETEhttps://api.giscloud.com/rest/1/map_cache/{MAP_ID}/{init}

URI Parameters

Code Description
{MAP_ID} Map ID
init Do map cache reinitialization. Possible values are: 1 and 2

Query Parameters

Attribute name Description
layers List of layer IDs for more specific map layer recaching. E.g. layers=123,125

This operation is required in order for the GIS Cloud application to see modifications to the map made through the API. Currently, the init parameter must have the value of 2.

You can choose to delete cache for select layers by adding the layers parameter and setting layer ids.

Responses

Code Description
204 Operation successful
404 Resource not found

Example request

curl -X DELETE "https://api.giscloud.com/1/map_cache/123/init/2?layers=100,200"

The Layer object

Attributes

  • idNumberReadonlyLayer id
  • nameStringRequiredLayer name
  • ownerUserObjectReadonlyExpandableLayer owner
  • typeStringLayer geometry type. Possible values are 'point', 'line', 'polygon', 'tile' and 'wms'.
  • map_idNumberMap ID that layer belongs to
  • sourceLayerSourceObjectMap ID that layer belongs to
  • datasource_idNumberDatasource ID of the layer data source
  • resource_idNumberResource ID of the layer
  • epsgNumberDatasource EPSG code
  • onscaleNumberSet scale on which layer is visible
  • offscaleNumberSet scale on which layer is hidden
  • labelStringAttribute name of the datasource to use for a line label
  • modifiedNumberLast time map was modified (UNIX timestamp)
  • createdNumberTime when map was created (UNIX timestamp)
  • x_minNumberReadonlyLayer bound X min coordinate
  • x_maxNumberReadonlyLayer bound X max coordinate
  • y_minNumberReadonlyLayer bound Y min coordinate
  • y_maxNumberReadonlyLayer bound Y max coordinate
  • textfieldStringAttribute name of the datasource to use as a text field
  • stylesLayerStyleObjectComplex layer style object for layer styling
  • alphaNumberLayer transparency
  • encodingStringLayer datasource encoding
  • marginNumberText field margin
  • openedStringFor folder layer open/close boolean value, 't' or 'f'
  • visibleStringControls layer visibility, 't' or 'f'
  • lockStringControls layer interactivity, 't' or 'f'
  • parentNumberParent folder layer ID
  • tooltipStringTooltip that appears on the layer features mouse hover
  • hidegeometryStringHide layer geometry. Can be useful if we want to show only labels
  • use_info_windowStringShow layer features info in a map popup
  • orderNumberLayer Z index
  • optionsArray of optionsExpandableList of options tied to this resource. This value only appears if the expand parameter contains the key 'options'
  • datasourceDatasourceObjectExpandableLayer datasource object
  • formFormObjectExpandableShow form object attached to the layer
  • columnsArray of datasource columnsExpandableShow layer datasource columns

Layer object

{
    "id": "3827",
    "name": "Open Street Map",
    "owner": "2",
    "type": "tile",
    "map_id": "1198",
    "source": "{\"type\":\"tile\",\"src\":\"osm\"}",
    "datasource_id": null,
    "resource_id": "14125",
    "epsg": "900913",
    "onscale": null,
    "offscale": null,
    "label": null,
    "created": 1593945880,
    "modified": 1593945880,
    "x_min": "-20037508.342789",
    "x_max": "20037508.342789",
    "y_min": "-20037508.342789",
    "y_max": "20037508.342789",
    "textfield": null,
    "styles": null,
    "alpha": "100",
    "encoding": null,
    "margin": null,
    "opened": null,
    "visible": "t",
    "lock": "f",
    "exportable": "t",
    "parent": null,
    "tooltip": null,
    "label_placement": null,
    "hidegeometry": "f",
    "geometry_offset": null,
    "use_info_window": "f",
    "order": "0"
}

List all layers

GEThttps://api.giscloud.com/rest/1/layers.json

Get list of all layers readable by current user.

Query Parameters

Attribute name Description
perpage Number of results per page to display (Default: 100, Maximum: 1000)
page Page number to display
expand Expand by 'form', 'options', 'columns' and 'datasource'
nototal Total of results is not counted and displayed; improves response time; used for getting the response faster
query_on Fields on which the query will be performed
query Search query

Responses

Code Description
200 Operation successful

Example request

curl -H "API-Key: {USER_API_KEY}" https://api.giscloud.com/rest/1/layers.json

Retrieve a layer

GEThttps://api.giscloud.com/rest/1/layers/{LAYER_ID}.json

URI Parameters

Code Description
{LAYER_ID} Layer ID

Get layer by ID.

Query Parameters

Attribute name Description
expand Expand by 'form', 'options', 'columns' and 'datasource'

Responses

Code Description
200 Operation successful
403 Action forbidden
404 Resource not found

Example request

curl -H "API-Key: {USER_API_KEY}" "https://api.giscloud.com/rest/1/layers/123.json?expand=columns,form"

Example response

{
    "id": "3827",
    "name": "Open Street Map",
    "owner": "2",
    "type": "tile",
    "map_id": "1198",
    "source": "{\"type\":\"tile\",\"src\":\"osm\"}",
    "datasource_id": null,
    "resource_id": "14125",
    "epsg": "900913",
    "onscale": null,
    "offscale": null,
    "label": null,
    "created": 1593945880,
    "modified": 1593945880,
    "x_min": "-20037508.342789",
    "x_max": "20037508.342789",
    "y_min": "-20037508.342789",
    "y_max": "20037508.342789",
    "textfield": null,
    "styles": null,
    "alpha": "100",
    "encoding": null,
    "margin": null,
    "opened": null,
    "visible": "t",
    "lock": "f",
    "exportable": "t",
    "parent": null,
    "tooltip": null,
    "label_placement": null,
    "hidegeometry": "f",
    "geometry_offset": null,
    "use_info_window": "f",
    "order": "0"
}

Create a layer

POSThttps://api.giscloud.com/rest/1/layers.json

Create a new layer

Responses

Code Description
201 Operation successful

Example request

curl -X POST -d '{"mid": <MAP_ID>, "name":"New layer,"type": "point", "source": "{\"type\":\"pg\",\"src\":\"<TABLE_NAME>\"}"}' https://api.giscloud.com/1/layers.json

Update a layer

PUThttps://api.giscloud.com/rest/1/layers/{LAYER_ID}.json

URI Parameters

Code Description
{LAYER_ID} Layer ID

Responses

Code Description
200 Operation successful
404 Resource not found

Example request

curl -X PUT -d '{"name": "Updated layer name"}' https://api.giscloud.com/1/layers.json

Delete layer

DELETEhttps://api.giscloud.com/rest/1/layers/{LAYER_ID}.json

Delete a layer by ID.

Responses

Code Description
204 Operation successful
404 Resource not found

Example request

curl -X DELETE https://api.giscloud.com/1/layers/123.json

Render layer

GEThttps://api.giscloud.com/rest/1/layers/{LAYER_ID}/render.{FORMAT}

Produces single layer rendered as interactive map in an iframe.

URI Parameters

Code Description
{LAYER_ID} Layer ID
{FORMAT} Using this parameter you can choose image format, it can be 'iframe' for an interactive map.

Query Parameters

Attribute name Default Description
width 256 Image width in pixels.
height 256 Image height in pixels.
invalidate false Invalidate cache

Example request - interactive map

https://api.giscloud.com/1/layers/124/render.iframe

Export layer

GEThttps://api.giscloud.com/rest/1/layers/{LAYER_ID}/export.{FORMAT}

Export single layer. If result of export is more than 1 file result will be stored into a zip archive and delivered in that way.

URI Parameters

Code Description
{LAYER_ID} Layer ID
{FORMAT} Using this parameter you can choose layer export format, it can be 'shp', 'mif', 'kml', 'gpx', 'dxf', 'gml', 'csv' (optional .zip)

Query Parameters

Attribute name Default Description
zip delivers result in a zip archive (optional)

Responses

Code Description
200 Operation successful + exported file
404 Resource not found

Example request - PNG image

https://api.giscloud.com/1/layers/123/render.png

Columns

GEThttps://api.giscloud.com/rest/1/layers/{LAYER_ID}/columns.json

Get the columns of a layer.

URI Parameters

Code Description
{LAYER_ID} Layer ID

Responses

Code Description
204 Operation successful
404 Resource not found

Example request

curl -H "API-Key: {USER_API_KEY}" https://api.giscloud.com/1/layers/123/columns.json

The Feature object

Attributes

  • __idNumberReadonlyFeature ID
  • __ownerNumberReadonlyFeature owner
  • __modifiedNumberReadonlyLast time feature was modified (UNIX timestamp)
  • __createdNumberReadonlyTime when feature was created (UNIX timestamp)
  • __x_minNumberReadonlyFeature bound X min coordinate
  • __x_maxNumberReadonlyFeature bound X max coordinate
  • __y_minNumberReadonlyFeature bound Y min coordinate
  • __y_maxNumberReadonlyFeature bound Y max coordinate
  • __geometryStringExpandableFeature geometry.
  • dataObjectFeature attribute data

Feature object

{
    "__id": 2,
    "__owner": 0,
    "__modified": 1521019799,
    "__created": 1521019799,
    "__ymax": -1509726.678482,
    "__ymin": -1516754.052273,
    "__xmax": 5384616.27791,
    "__xmin": 5378882.208595,
    "__geometry": "// WKT Geometry",
    "data": {
        "pop_densit": 1197.019565,
        "sr": 94.47,
        "p90": 31999,
        "p80": 23941,
        "p70": 24075,
        "p60": 25173,
        "name3": "N.A.",       
        "perimeter": 0.173,
        "area": 0.002
    }
}

List all features

GEThttps://api.giscloud.com/rest/1/layers/{LAYER_ID}/features.json

Get list of all layer features.

URI Parameters

Code Description
{LAYER_ID} Layer ID

Query Parameters

Attribute name Description
perpage Number of results per page to display (Default: 100, Maximum: 1000)
page Page number to display
geometry Format in which geometry will be packed. Possible values: 'geojson', 'wkt', 'kml' and 'gml'.
epsg EPSG code for the output projection. if not specified default map projection is used.
proj4 Proj4 string for the output projection. Alternative to the epsg parameter.
bounds Bounding box used for spatial filtering
where SQL type where clause – used for attribute filtering
noattrib Feature attributes are not displayed

Responses

Code Description
200 Operation successful
404 Resource not found

Example request

curl -H "API-Key: {USER_API_KEY}" https://api.giscloud.com/rest/1/layers/123/features.json

Example response

{
    "type": "features",
    "total": 197,
    "page": 1,
    "data": [{
        "__id": 1,
        "__owner": 0,
        "__modified": 1521019799,
        "__created": 1521019799,
        "__ymax": -1419646.877283,
        "__ymin": -1459747.128513,
        "__xmax": 5035603.070479,
        "__xmin": 5013602.777329,
        "data": {
            "pop_densit": 197.87547,
            "sr": -99.99,
            "p90": 73677,
            "p80": 50877,
            "p70": 36251,
            "p60": 25394,
            "demoflag": 1,
            "name3": "N.A.",
            "name2": "N.A.",
            "name1": "Ile de Mayotte (Fr.)",
            "country": "COM",
            "adminid": 174040000,
            "code": "IS",
            "admsqkm": 372.3,
            "sqkm": 372.3,
            "afall_id": 3315,
            "afall_": 4523,
            "perimeter": 1.542,
            "area": 0.031
        }
    }, {
        "__id": 2,
        "__owner": 0,
        "__modified": 1521019799,
        "__created": 1521019799,
        "__ymax": -1509726.678482,
        "__ymin": -1516754.052273,
        "__xmax": 5384616.27791,
        "__xmin": 5378882.208595,
        "data": {
            "pop_densit": 1197.019565,
            "sr": 94.47,
            "p90": 31999,
            "p80": 23941,
            "p70": 24075,
            "p60": 25173,
            "demoflag": 0,
            "name3": "N.A.",
            "name2": "Nosy-Be",
            "name1": "Antsiranana",
            "country": "MDG",
            "adminid": 450060800,
            "code": "IS",
            "admsqkm": 319.2,
            "sqkm": 26.7,
            "afall_id": 3333,
            "afall_": 4557,
            "perimeter": 0.173,
            "area": 0.002
        }
    }]
}

Get a feature

GEThttps://api.giscloud.com/rest/1/layers/{LAYER_ID}/features/{FEATURE_ID}.json

Get list of all layer features.

URI Parameters

Code Description
{LAYER_ID} Layer ID
{FEATURE_ID} Feature ID

Query Parameters

Attribute name Description
geometry Format in which geometry will be packed. Possible values: 'geojson', 'wkt', 'kml' and 'gml'.
epsg EPSG code for the output projection. if not specified default map projection is used.
proj4 Proj4 string for the output projection. Alternative to the epsg parameter.

Responses

Code Description
200 Operation successful
404 Resource not found

Example request

curl -H "API-Key: {USER_API_KEY}" https://api.giscloud.com/rest/1/layers/123/features/2.json

Example response

{
    "__id": 2,
    "__owner": 0,
    "__modified": 1521019799,
    "__created": 1521019799,
    "__ymax": -1509726.678482,
    "__ymin": -1516754.052273,
    "__xmax": 5384616.27791,
    "__xmin": 5378882.208595,
    "data": {
        "pop_densit": 1197.019565,
        "sr": 94.47,
        "p90": 31999,
        "p80": 23941,
        "p70": 24075,
        "p60": 25173,
        "demoflag": 0,
        "name3": "N.A.",
        "name2": "Nosy-Be",
        "name1": "Antsiranana",
        "country": "MDG",
        "adminid": 450060800,
        "code": "IS",
        "admsqkm": 319.2,
        "sqkm": 26.7,
        "afall_id": 3333,
        "afall_": 4557,
        "perimeter": 0.173,
        "area": 0.002
    }
}

Create a feature

POSThttps://api.giscloud.com/rest/1/layers/{LAYER_ID}/features.json

Create a new feature

Responses

Code Description
201 Operation successful
404 Resource not found

Example request

curl -X POST -d '{"data": {"name": "myname", "value": 995}, "geometry": "POINT(15 45)"}' https://api.giscloud.com/1/layers/123/features.json

Update a feature

PUThttps://api.giscloud.com/rest/1/layers/{LAYER_ID}/features/{FEATURE_ID}.json

URI Parameters

Code Description
{LAYER_ID} Layer ID
{FEATURE_ID} Feature ID

Responses

Code Description
200 Operation successful
404 Resource not found

Example request

curl -X PUT -d '{"data": {"name": "new name", "value": 999}, "geometry": "POINT(16 43)"}' https://api.giscloud.com/1/layers/123/features/1.json

Delete feature

DELETEhttps://api.giscloud.com/rest/1/layers/{LAYER_ID}/features/{FEATURE_ID}.json

Delete a feature by ID.

URI Parameters

Code Description
{LAYER_ID} Layer ID
{FEATURE_ID} Feature ID

Responses

Code Description
204 Operation successful
404 Resource not found

Example request

curl -X DELETE https://api.giscloud.com/1/layers/123/features/2.json

Get a feature media file

GEThttps://api.giscloud.com/rest/1/layers/{LAYER_ID}/features/{FEATURE_ID}/{ATTRIBUTE_NAME}/{FILE_NAME}.json

URI Parameters

Code Description
{LAYER_ID} Layer ID
{FEATURE_ID} Feature ID
{ATTRIBUTE_NAME} Name of the attribute which contains media files; separate multiple files with commas
{FILE_NAME} Attached file name

Query Parameters

Attribute name Description
download Force browser to download the file like an attachment

Responses

Code Description
200 Operation successful
404 Resource not found

Example request

curl -H "API-Key: {USER_API_KEY}" https://api.giscloud.com/rest/1/layers/123/features/2.json

The Table object

Attributes

  • idNumberReadonlyTable id
  • nameStringRequiredTable name
  • primary_keyStringTable primary key
  • sridNumberEPSG code of the table geometry
  • is_viewBooleanIs table database view
  • geometryStringTable geometry type, eg. 'MULTIPOLYGON'
  • columnsArray of TableColumnObjectTable columns

Table object

{
    "name": "counties",
    "geometry": "MULTIPOLYGON",
    "columns": {
        "name": {
            "type": "text",
            "not_null": false
        },
        "code": {
            "type": "number",
            "not_null": false
        },
        "num": {
            "type": "number",
            "not_null": false
        },
        "houses": {
            "type": "number",
            "not_null": false
        },
        "shape_leng": {
            "type": "number",
            "not_null": false
        },
        "shape_area": {
            "type": "number",
            "not_null": false
        }
    },
    "primary_key": "ogc_fid",
    "srid": 4326,
    "is_view": false
}

List all tables

GEThttps://api.giscloud.com/rest/1/tables.json

Get list of all tables readable by current user.

Query Parameters

Attribute name Description
expand Expand by 'count'
only_spatial Get only spatial tables
only_non_spatial Get only non-spatial tables

Responses

Code Description
200 Operation successful

Example request

curl -H "API-Key: {USER_API_KEY}" https://api.giscloud.com/rest/1/tables.json

Retrieve a table

GEThttps://api.giscloud.com/rest/1/tables/{TABLE_NAME}.json

URI Parameters

Code Description
{TABLE_NAME} Table name

Get table info by name.

Responses

Code Description
200 Operation successful
404 Resource not found

Example request

curl -H "API-Key: {USER_API_KEY}" https://api.giscloud.com/rest/1/tables/counties.json

Example response

{
    "name": "counties",
    "geometry": "MULTIPOLYGON",
    "columns": {
        "name": {
            "type": "text",
            "not_null": false
        },
        "code": {
            "type": "number",
            "not_null": false
        },
        "num": {
            "type": "number",
            "not_null": false
        },
        "houses": {
            "type": "number",
            "not_null": false
        },
        "shape_leng": {
            "type": "number",
            "not_null": false
        },
        "shape_area": {
            "type": "number",
            "not_null": false
        }
    },
    "primary_key": "ogc_fid",
    "srid": 4326,
    "is_view": false
}

Create a table

POSThttps://api.giscloud.com/rest/1/tables.json

Create a new table

Responses

Code Description
201 Operation successful

Example request

curl -X POST -d '{"geometry":"POINT","name":"counties","columns":{"name":{"type":"text"},"num_of_houses":{"type":"number"}}}' https://api.giscloud.com/1/tables.json

Update a table

Not supported.

Delete a table

DELETEhttps://api.giscloud.com/rest/1/tables/{TABLE_NAME}

Delete a table.

Responses

Code Description
204 Operation successful
404 Resource not found

Example request

curl -X DELETE https://api.giscloud.com/1/tables/counties

Export table

GEThttps://api.giscloud.com/rest/1/tables/{TABLE_NAME}/rows.csv

URI Parameters

Code Description
{TABLE_NAME} Table name

Responses

Code Description
200 Operation successful + exported CSV file
404 Resource not found

Example request

https://api.giscloud.com/1/tables/123/render.png

List all table rows

GEThttps://api.giscloud.com/rest/1/tables/{TABLE_NAME}/rows.json

Get all rows of the table.

URI Parameters

Code Description
{TABLE_NAME} Table name

Query Parameters

Attribute name Description
perpage Number of results per page to display (Default: 100, Maximum: 1000)
page Page number to display
geometry Format of geometry column, it can be 'false', 'wkt' or 'wkb'.
fields Only selected fields will be displayed in the response; separate multiple field names with commas

Responses

Code Description
200 Operation successful
404 Resource not found

Example request

curl -H "API-Key: {USER_API_KEY}" "https://api.giscloud.com/rest/1/tables/counties/rows.json?geometry=false"

Example response

{
    "ogc_fid": "1",
    "county_name": "Tusco",
    "houses": "20000",
    "shape_leng": "374837.195938",
    "shape_area": "2638814474.68",
    "__created": null,
    "__modified": null,
    "__owner": null
}

Create a table row

POSThttps://api.giscloud.com/rest/1/tables/{TABLE_NAME}/rows.json

Create a new table row

URI Parameters

Code Description
{TABLE_NAME} Table name

Responses

Code Description
201 Operation successful
404 Resource not found

Example request

curl -X POST -d '{"data": {"attribute_string": "some text", "attribute_int": 5, "attribute_real": 3.14}}' https://api.giscloud.com/1/tables/counties/rows.json

Example request with geometry

curl -X POST -d '{"data": {"city": "Split"}, "geometry": "POINT(16.446533203125 43.5127049046481)"}' https://api.giscloud.com/1/tables/counties/rows.json

Update a table row

PUThttps://api.giscloud.com/rest/1/tables/{TABLE_NAME}/rows/{ROW_ID}.json

URI Parameters

Code Description
{TABLE_NAME} Table name
{ROW_ID} Table row ID

Responses

Code Description
204 Operation successful
404 Resource not found

Example request

curl -X PUT -d '{"data": {"city": "New York"}}' https://api.giscloud.com/1/tables/counties/rows/1.json

Delete a table row

DELETEhttps://api.giscloud.com/rest/1/tables/{TABLE_NAME}/rows/{ROW_ID}

Delete a table row.

URI Parameters

Code Description
{TABLE_NAME} Table name
{ROW_ID} Table row ID to be deleted

Responses

Code Description
204 Operation successful
404 Resource not found

Example request

curl -X DELETE https://api.giscloud.com/1/tables/counties/rows/1

Truncate table

DELETEhttps://api.giscloud.com/rest/1/tables/{TABLE_NAME}/rows

Deletes the data inside a table, but not the table itself.

URI Parameters

Code Description
{TABLE_NAME} Table name

Responses

Code Description
204 Operation successful
404 Resource not found

Example request

curl -X DELETE https://api.giscloud.com/1/tables/counties/rows

GEThttps://api.giscloud.com/rest/1/search.json

Query Parameters

Attribute name Description
query Value to be searched
fields List of layer IDs and layer attributes to include in search, format: {layer_id}~{field1},{field2},...~[{field1:DESC},---][;{layer_id}...]
x Longitude or easting of the location
y Latitude or northing of the location
perpage Number of results per page to display (Default: 100, Maximum: 1000)
page Page number to display
replace_special_chars Replace special letters: 'å' => 'a', 'ä' => 'a', 'ö' => 'o', 'č' => 'c', 'ć' => 'c', 'đ' => 'd', 'dž' => 'dz', 'š' => 's', 'ž' => 'z'; case-insensitive
address_layer Address layer ID to be included in the search
columns_meta Include column's meta data

Notices:

  • you can list multiple layer-filed packages you want to search against – use the “;” as delimiter
  • with per_page you can setup how many records you want to get per page
  • x & y are coordinates that are used for default ordering e.g. you can order

Responses

Code Description
200 Operation successful

Example request

curl -X GET "https://api.giscloud.com/1/search.json?query=New York&fields=19~city,county~&perpage=10&x=0&y=0"

The User object

Attributes

  • idNumber
  • usernameString
  • emailString
  • activeBoolean
  • firstnameString
  • lastnameString
  • createdNumber
  • modifiedNumber
  • lastlogNumber
  • owner_idNumber
  • mobileString
  • webString
  • phoneString
  • languageString
  • file_feature_countNumber
  • db_feature_countNumber
  • storage_rasterNumber
  • storage_totalNumber
  • feature_count_limitNumberReadonly
  • storage_raster_limitNumberReadonly
  • resource_idNumberReadonly
  • oidcBooleanReadonly
  • optionsarray of OptionsObjectList of options tied to the user. This value only appears if the 'expand' parameter contains the key 'options'

User object

{
  "id": 1001,
  "username": "johnsmith",
  "email": "johnsmith@giscloud.com",
  "active": true,
  "firstname": "John",
  "lastname": "Smith",
  "created": 1496395844,
  "modified": 1496397654,
  "lastlog": 1496397654,
  "owner_id": 202,
  "mobile": "+38199123456",
  "web": "www.giscloud.com",
  "phone": "+38199123456",
  "file_feature_count": 2201171,
  "db_feature_count": 245249,
  "storage_raster": 124743678,
  "storage_total": 2130925920,
  "feature_count_limit": 20000000,
  "storage_raster_limit": 1048576000000,
  "resource_id": 18495,
  "oidc": false,
  "options": [
    {
      "name": "MY_META",
      "type": 1,
      "value": "Some extra information"
    }
  ]
}

List all users

GEThttps://api.giscloud.com/rest/1/users.json

Get list of all users readable by current user.

Read access on a resource is allowed to all users or groups that have reading permissions (or higher) on that resource.

Granting reading permissions on a resource to the anonymous user makes that resource publicly readable.

Query Parameters

Attribute name Description
per_page Number of results per page to display
Default: 100
Maximum: 1000
page Result list offset for paginating
expand A comma-seperated list of special resource object properties which can be expanded in the response object Expand options: "options"
Responses
200 Operation successful

Example request

curl -H "API-Key: {USER_API_KEY}" https://api.giscloud.com/rest/1/users.json

Example response

{
  "type": "users",
  "page": 1,
  "total": 1,
  "data": [
    {
        "id": 1001,
        "username": "johnsmith",
        "email": "johnsmith@giscloud.com",
        "active": true,
        "firstname": "John",
        "lastname": "Smith",
        "created": 1496395844,
        "modified": 1496397654,
        "lastlog": 1496397654,
        "owner_id": 202,
        "mobile": "+38199123456",
        "web": "www.giscloud.com",
        "phone": "+38199123456",
        "file_feature_count": 2201171,
        "db_feature_count": 245249,
        "storage_raster": 124743678,
        "storage_total": 2130925920,
        "feature_count_limit": 20000000,
        "storage_raster_limit": 1048576000000,
        "resource_id": 18495,
        "oidc": false,
        "options": [
            {
            "name": "MY_META",
            "type": 1,
            "value": "Some extra information"
            }
        ]
    }
  ]
}

Create a user

POSThttps://api.giscloud.com/rest/1/users.json

Create a new user resource. The user performing this operation is set as the resource's owner.

Arguments

  • usernamestringRequired
  • emailstringRequired
  • firstnamestringRequired
  • lastnamestringRequired
  • mobilestring
  • webstring
  • phonestring
  • passwordstringRequired
Responses
201 Operation successful

Example request

curl -H "API-Key: {USER_API_KEY}" -X POST https://api.giscloud.com/rest/1/users \
-d '{"username":"johnsmith","email":"johnsmith@giscloud.com","firstname":"John","lastname":"Smith"}'

Retrieve a user

GEThttps://api.giscloud.com/rest/1/users/{id}.json

URI Parameters
id Resource ID

Get user resource by ID.

Read access on a resource is allowed to all users or groups that have reading permissions (or higher) on that resource.

Granting reading permissions on a resource to the anonymous user makes that resource publicly readable.

Query Parameters

Attribute name Description
expand A comma-seperated list of special resource object properties which can be expanded in the response object Expand options: "options"
Responses
200 Operation successful
403 Action forbidden
404 Resource not found

Example request

curl -H "API-Key: {USER_API_KEY}" https://api.giscloud.com/rest/1/users/{id}.json

Example response

{
    "id": 1001,
    "username": "johnsmith",
    "email": "johnsmith@giscloud.com",
    "active": true,
    "firstname": "John",
    "lastname": "Smith",
    "created": 1496395844,
    "modified": 1496397654,
    "lastlog": 1496397654,
    "owner_id": 202,
    "mobile": "+38199123456",
    "web": "www.giscloud.com",
    "phone": "+38199123456",
    "file_feature_count": 2201171,
    "db_feature_count": 245249,
    "storage_raster": 124743678,
    "storage_total": 2130925920,
    "feature_count_limit": 20000000,
    "storage_raster_limit": 1048576000000,
    "resource_id": 18495,
    "oidc": false
}

Update a user

PUThttps://api.giscloud.com/rest/1/users/{id}.json

URI Parameters
id Resource ID

Update a user resource.

Write access on a resource is allowed to all users or groups that have editing permissions (or higher) on that resource.

Responses
200 Operation successful
403 Action forbidden
404 Resource not found

Example request

curl -H "API-Key: {USER_API_KEY}" -X PUT https://api.giscloud.com/rest/1/users/{id}.json
-d '{"username":"johnsmith","email":"johnsmith@giscloud.com","firstname":"John","lastname":"Smith"}'

Example response

{
  "id": 1001,
  "owner_id": 202,
  "created": 1496395844,
  "modified": 1496397654,
  "username": "johnsmith",
  "email": "johnsmith@giscloud.com",
  "firstname": "John",
  "lastname": "Smith",
}

Delete user

DELETEhttps://api.giscloud.com/rest/1/users/{id}.json

URI Parameters
id Resource ID

Delete a user resource by ID.

Write access on a resource is allowed to all users or groups that have editing permissions (or higher) on that resource.

Responses
204 Operation successful
403 Action forbidden
404 Resource not found

Example request

curl -H "API-Key: {USER_API_KEY}" -X DELETE https://api.giscloud.com/rest/1/users/{id}.json

The Role object

Attributes

  • idNumberRole ID
  • nameStringRole name
  • app_roleBooleanIs role app type role
  • parent_idNumberParent role ID
  • owner_idNumberRole owner
  • owner_nameStringRole owner username
  • app_instance_idNumberApp instance ID if app_role is true

Role object

{
  "id": 1001,
  "name": "App Role",
  "app_role": true,
  "parent_id": null,
  "owner_id": 202,
  "owner_name": "johnsmith",
  "app_instance_id": 147654
}

List all roles

GEThttps://api.giscloud.com/rest/1/roles.json

Get list of all roles readable by current user.

Read access on a resource is allowed to all users or groups that have reading permissions (or higher) on that resource.

Granting reading permissions on a resource to the anonymous user makes that resource publicly readable.

Query Parameters

Attribute name Description
per_page Number of results per page to display
Default: 100
Maximum: 1000
page Result list offset for paginating
Responses
200 Operation successful

Example request

curl -H "API-Key: {USER_API_KEY}" https://api.giscloud.com/rest/1/roles.json

Example response

{
  "type": "roles",
  "page": 1,
  "total": 1,
  "data": [
    {
        "id": 1001,
        "name": "App Role",
        "app_role": true,
        "parent_id": null,
        "owner_id": 202,
        "owner_name": "johnsmith",
        "app_instance_id": 147654
    },
    {
        "id": 1002,
        "name": "ADMIN",
        "app_role": false,
        "parent_id": null,
        "owner_id": 202,
        "owner_name": "johnsmith"
    }
  ]
}

Create a role

POSThttps://api.giscloud.com/rest/1/roles.json

Create a new role resource. The user performing this operation is set as the resource's owner.

Arguments

  • namestringRequired
  • parent_idinteger
Responses
201 Operation successful

Example request

curl -H "API-Key: {USER_API_KEY}" -X POST https://api.giscloud.com/rest/1/roles.json -d '{"name": "EDIT"}'

Retrieve a role

GEThttps://api.giscloud.com/rest/1/roles/{id}.json

URI Parameters
id Resource ID

Get role resource by ID.

Read access on a resource is allowed to all users or groups that have reading permissions (or higher) on that resource.

Granting reading permissions on a resource to the anonymous user makes that resource publicly readable.

Query Parameters

Attribute name Description
expand A comma-seperated list of special resource object properties which can be expanded in the response object Expand options: "owner", "options", "tags", "permissions"
Responses
200 Operation successful
403 Action forbidden
404 Resource not found

Example request

curl -H "API-Key: {USER_API_KEY}" https://api.giscloud.com/rest/1/roles/{id}.json

Example response

{
    "id": 1001,
    "name": "App Role",
    "app_role": true,
    "parent_id": null,
    "owner_id": 202,
    "owner_name": "johnsmith",
    "app_instance_id": 147654
}

Update a role

PUThttps://api.giscloud.com/rest/1/roles/{id}.json

URI Parameters
id Resource ID

Update a role resource.

Write access on a resource is allowed to all users or groups that have editing permissions (or higher) on that resource.

Responses
200 Operation successful
403 Action forbidden
404 Resource not found

Example request

curl -H "API-Key: {USER_API_KEY}" -X PUT https://api.giscloud.com/rest/1/roles/{id}.json -d '{"parent_id": 1001}'

Delete role

DELETEhttps://api.giscloud.com/rest/1/roles/{id}.json

URI Parameters
id Resource ID

Delete a role resource by ID.

Write access on a resource is allowed to all users or groups that have editing permissions (or higher) on that resource.

Responses
204 Operation successful
403 Action forbidden
404 Resource not found

Example request

curl -H "API-Key: {USER_API_KEY}" -X DELETE https://api.giscloud.com/rest/1/roles/{id}.json

Storage

The user can read and write to the cloud storage.

Download a file

GEThttps://api.giscloud.com/rest/1/storage/fs/{PATH_TO_A_FILE}

URI Parameters

Code Description
{PATH_TO_A_FILE} Path to a file

Example request

curl -H "API-Key: {USER_API_KEY}" https://api.giscloud.com/rest/1/storage/fs/my_folder/world.shp

Upload a file

POSThttps://api.giscloud.com/rest/1/storage/fs/{PATH_TO_A_DIRECTORY}

The request body must be formatted according to the multipart post method i.e. standard HTTP file upload method.

If file being uploaded is in ZIP format it will be automatically decompressed in the destination directory.

Can be sent as x-www-form-urlencoded where 'filename' and 'content' must be specified or as form-data where 'file' must be specified.

URI Parameters

Code Description
{PATH_TO_A_DIRECTORY} Path to a directory for uploading

Example request

curl -H "API-Key: {USER_API_KEY}" -F filedata=@test.csv https://api.giscloud.com/rest/1/storage/fs/my_folder

Delete a file

DELETEhttps://api.giscloud.com/rest/1/storage/fs/{PATH_TO_A_FILE}

URI Parameters

Code Description
{PATH_TO_A_FILE} Path to a file

Responses

Code Description
204 Operation successful
404 Resource not found

Example request

curl -H "API-Key: {USER_API_KEY}" -X DELETE https://api.giscloud.com/rest/1/storage/fs/my_folder/world.shp

Get features at location

GEThttps://api.giscloud.com/rest/1/geo_utils/features_at_point.json

Get features of select layers at a defined location

Query Parameters

Attribute name Description
perpage Number of results per page to display (Default: 100, Maximum: 1000)
page Page number to display
layer_id Comma-separated list of layer IDs containing features you want to query
srid Spatial reference ID of the geo-coordinate system you will use to define the location (e.g. 4326 in case of WGS84)
point_x Longitude or easting of the location
point_y Latitude or northing of the location
buffer Radius around your location in which to look for features – you can use 1m (one meter) if you don’t want a large area
srid Set the SRID (default: 4326)

Responses

Code Description
200 Operation successful
404 Resource not found

Example request

curl -H "API-Key: {USER_API_KEY}" "https://api.giscloud.com/rest/1/geo_utils/features_at_point?layer_id=5429&point_x=16&point_y=18&buffer=1000.json"

Buffer

POSThttps://api.giscloud.com/rest/1/layers/{LAYER_ID}/buffer.json

POST Body Data Parameters

Parameter name Description
name Name of the new layer
size Buffer size
units Units for the size param (meter, kilometer, mile, degree); optional (defaults to meter)
merge_geom Group all geometry together; optional (defaults to true)
border_width Width of the new layer’s features polygon border; accepts values 1-4; optional (defaults to 1)
border_color An RGB color string for the new layer’s features polygon border color; optional (defaults to 0,0,0)
fill_color An RGB color string for the new layer’s features polygon fill color; optional (defaults to 255,255,255)

Responses

Code Description
201 Operation successful + Response header: location of the newly created layer (1/maps/{MAP_ID}/layers/{LAYER_ID})
404 Resource not found

Example request

curl -X POST -d '{"name":"buffer_layer_name","size":"100","merge_geom":true,"units":"meter","fill_color":"198,45,240","border_color":"0,32,96","border_width":1}' https://api.giscloud.com/1/layers/123/buffer.json

List Permissions

GEThttps://api.giscloud.com/rest/1/resources/{RESOURCE_ID}/permissions.json

All resources that can be shared (maps, layers, datasources etc.) have their own unique resource ID. Resource ID for e.g. a map can be checked using /maps/{map_id}. Resource ID of a map is not to be confused with map ID.

URI Parameters

Code Description
{RESOURCE_ID} Resource ID, can be of the map, layer, datasource etc.

Responses

Code Description
200 Operation successful
404 Resource not found

Example request

curl -H "API-Key: {USER_API_KEY}" https://api.giscloud.com/rest/1/resources/123/permissions.json

Example response

{
    "type": "permissions",
    "total": 0,
    "page": 1,
    "data": [{
            "permissions": [{
                "type": "READ",
                "share_id": "657"
            }],
            "username": "anonymous"
        },
        {
            "permissions": [{
                "type": "OWNER",
                "share_id": "655"
            }],
            "username": "gc_user"
        }
    ]
}
// Please note “share_id” value under “permissions”, this ID is used in delete permission requests.

Get a Permission

GEThttps://api.giscloud.com/rest/1/resources/{RESOURCE_ID}/permissions/{SHARE_ID}.json

URI Parameters

Code Description
{RESOURCE_ID} Resource ID, can be of the map, layer, datasource etc.
{SHARE_ID} ID of specific permission for resource

Responses

Code Description
201 Operation successful
404 Resource not found

Example request

curl -H "API-Key: {USER_API_KEY}" https://api.giscloud.com/rest/1/resources/123/permissions/657.json

Example response

{
    "id": "657",
    "resource_id": "18393783",
    "user_id": "205535",
    "dependency_option_id": null,
    "username": "gc_user",
    "permission": "OWNER"
}

Add Permission

POSThttps://api.giscloud.com/rest/1/resources/{RESOURCE_ID}/permissions.json

URI Parameters

Code Description
{RESOURCE_ID} Resource ID, can be of the map, layer, datasource etc.

Here’s a list of all available permissions:

  • READ
  • EDIT
  • EXPORT
  • EDIT_WITH_SHARE
  • INSERT
  • INSERT_MDC
  • UPDATE
  • UPDATE_MDC
  • DELETE
  • DELETE_MDC
  • SHARE

Responses

Code Description
201 Operation successful
404 Resource not found

Example request

curl -H "API-Key: {USER_API_KEY}" -X POST -d '{"username": "gc_user", "permission": "READ"}' https://api.giscloud.com/rest/1/resources/618/permissions.json

# Example of sharing a map with resource ID ‘618’ to user ‘gc_user’ with permission ‘READ’

Remove Permission

DELETEhttps://api.giscloud.com/rest/1/resources/{RESOURCE_ID}/permissions/{SHARE_ID}.json

URI Parameters

Code Description
{RESOURCE_ID} Resource ID, can be of the map, layer, datasource etc.
{SHARE_ID} ID of specific permission for resource

Responses

Code Description
204 Operation successful
404 Resource not found

Example request

curl -H "API-Key: {USER_API_KEY}" -X DELETE https://api.giscloud.com/rest/1/resources/618/permissions/1.json

# Example of deleting permission with share ID ‘655’ from resource with ID ‘618’

The APIKey object

Attributes

  • idNumberReadonlyKey ID
  • key_descStringKey description
  • key_truncStringTruncated key
  • activeStringIs key active
  • accessedDateLast time was accessed
  • createdDateTime when key was created

APIKey object

{
    "id": "250",
    "key": "747887a8126db2ca24ee668eb5547dbb",
    "key_desc": "upload",
    "created": "2020-06-26 09:39:27.380406+02",
    "accessed": "2020-06-26 09:39:27.380406+02",
    "key_trunc": "02e4ef",
    "active": "t"
}

List all API keys

GEThttps://api.giscloud.com/rest/1/keys.json

Get all API keys for the current user.

Responses

Code Description
200 Operation successful

Example request

curl -H "API-Key: {USER_API_KEY}" https://api.giscloud.com/rest/1/keys.json

Example response

{
  "type": "keys",
  "total": 5,
  "page": 1,
  "data": [
    {
      "id": "250",
      "key": "747887a8126db2ca24ee668eb5547dbb",
      "key_desc": "upload",
      "created": "2020-06-26 09:39:27.380406+02",
      "accessed": "2020-06-26 09:39:27.380406+02",
      "key_trunc": "02e4ef",
      "active": "t"
    },
    // ...
  ]
}

Retrieve an API key

GEThttps://api.giscloud.com/rest/1/keys/{API_KEY_ID}.json

URI Parameters

Code Description
{API_KEY_ID} API key ID

Responses

Code Description
200 Operation successful
404 Resource not found

Example request

curl -H "API-Key: {USER_API_KEY}" https://api.giscloud.com/rest/1/keys/12.json

Example response

{
    "id": "250",
    "key": "747887a8126db2ca24ee668eb5547dbb",
    "key_desc": "upload",
    "created": "2020-06-26 09:39:27.380406+02",
    "accessed": "2020-06-26 09:39:27.380406+02",
    "key_trunc": "02e4ef",
    "active": "t"
}

Create an API key

POSThttps://api.giscloud.com/rest/1/keys.json

Generate a new API key

Responses

Code Description
201 Operation successful + a URL to the newly created resource in the Location header of the response
404 Resource not found

Example request

curl -X POST https://api.giscloud.com/1/keys.json

Delete an API key

DELETEhttps://api.giscloud.com/rest/1/keys/{API_KEY_ID}.json

Delete an API key.

URI Parameters

Code Description
{API_KEY_ID} API key ID to be deleted

Responses

Code Description
204 Operation successful
404 Resource not found

Example request

curl -X DELETE https://api.giscloud.com/1/keys/rows/12

The OAuth2 Client object

Attributes

  • idNumberReadonlyOAuth2 Client ID
  • nameStringRequiredOAuth2 Client name
  • descriptionStringOAuth2 Client description
  • client_idStringReadonlyOAuth2 Client ID
  • client_secretStringReadonlyOAuth2 Client secret
  • redirect_uriStringRequiredRedirect URI
  • ownerNumberReadonlyClient Owner

OAuth2 Client object

{
    "id": 2,
    "client_id": "1c6f218d947914c913ff",
    "client_secret": "secret",
    "redirect_uri": "https://myapp.giscloud.com",
    "owner": 2,
    "name": "test",
    "description": "my app"
}

List all OAuth2 Client

GEThttps://api.giscloud.com/rest/1/oauth2_clients.json

Get all OAuth2 clients for the current user.

Responses

Code Description
200 Operation successful

Example request

curl -H "API-Key: {USER_API_KEY}" https://api.giscloud.com/rest/1/oauth2_clients.json

Example response

{
  "type": "oauth2_clients",
  "total": 1,
  "page": 1,
  "data": [
    {
      "id": 2,
      "client_id": "1c6f218d947914c913ff",
      "client_secret": "secret",
      "redirect_uri": "https://myapp.giscloud.com",
      "owner": 2,
      "name": "test",
      "description": "my app"
    }
  ]
}

Retrieve an OAuth2 Client

GEThttps://api.giscloud.com/rest/1/oauth2_clients/{CLIENT_ID}.json

URI Parameters

Code Description
{CLIENT_ID} OAuth2 client ID

Responses

Code Description
200 Operation successful
404 Resource not found

Example request

curl -H "API-Key: {USER_API_KEY}" https://api.giscloud.com/rest/1/oauth2_clients/2.json

Example response

{
    "id": 2,
    "client_id": "1c6f218d947914c913ff",
    "client_secret": "secret",
    "redirect_uri": "https://myapp.giscloud.com",
    "owner": 2,
    "name": "test",
    "description": "my app"
}

Create an OAuth2 Client

POSThttps://api.giscloud.com/rest/1/oauth2_clients.json

Create a new OAuth2 Client

Responses

Code Description
201 Operation successful + URL to the newly created resource in the Location
404 Resource not found

Example request

curl -X POST -d '{"name": "New app", "redirect_uri": "https://my.redirecturi.com"}' https://api.giscloud.com/1/oauth2_clients.json

Delete an OAuth2 Client

DELETEhttps://api.giscloud.com/rest/1/oauth2_clients/{CLIENT_ID}.json

Delete an OAuth2 Client.

URI Parameters

Code Description
{CLIENT_ID} OAuth2 Client ID to be deleted

Responses

Code Description
204 Operation successful
404 Resource not found

Example request

curl -X DELETE https://api.giscloud.com/1/oauth2_clients/2

The User Approved App object

Attributes

  • idNumberReadonlyUser Approved App ID
  • uidNumberReadonlyUser ID
  • client_idNumberRequiredReadonlyOAuth2 Client ID, from REST API endpoint /1/oauth2_clients.json

User Approved App object

{
    "id": 2,
    "uid": 5,
    "client_id": 45   
}

List all User Approved Apps

GEThttps://api.giscloud.com/rest/1/userapprovedapps.json

Get all user approved apps for the current user.

Query Parameters

Attribute name Description
perpage Number of results per page to display (Default: 100, Maximum: 1000)
page Page number to display

Responses

Code Description
200 Operation successful

Example request

curl -H "API-Key: {USER_API_KEY}" https://api.giscloud.com/rest/1/userapprovedapps.json

Example response

{
  "type": "userapprovedapps",
  "total": 1,
  "page": 1,
  "data": [
    {
        "id": 2,
        "uid": 5,
        "client_id": 45   
    }
  ]
}

Retrieve an User Approved App

GEThttps://api.giscloud.com/rest/1/userapprovedapps/{USER_APPROVED_APP_ID}.json

URI Parameters

Code Description
{USER_APPROVED_APP_ID} User Approved App ID

Responses

Code Description
200 Operation successful
404 Resource not found

Example request

curl -H "API-Key: {USER_API_KEY}" https://api.giscloud.com/rest/1/userapprovedapps/2.json

Example response

{
    "id": 2,
    "uid": 5,
    "client_id": 45   
}

Create an User Approved App

POSThttps://api.giscloud.com/rest/1/userapprovedapps.json

Create a new User Approved App.

Responses

Code Description
201 Operation successful + URL to the newly created resource in the Location
404 Resource not found

Example request

curl -X POST -d '{"client_id": 2}' https://api.giscloud.com/1/userapprovedapps.json

Delete an User Approved App

DELETEhttps://api.giscloud.com/rest/1/userapprovedapps/{USER_APPROVED_APP_ID}.json

Delete an User Approved App.

URI Parameters

Code Description
{USER_APPROVED_APP_ID} User Approved App ID to be deleted

Responses

Code Description
204 Operation successful
404 Resource not found

Example request

curl -X DELETE https://api.giscloud.com/1/userapprovedapps/2