addarrow-downaxebreadcrumb dividercameracc-compulsarychatcontactdata-usersdebugdevelopersdismisserrorglossaryinfolinkpublisherssearchselect-dropdownsuccesswarning

Developers

APIs to manage your site, query data and build new products and services.

  1. Home
  2. Developers
  3. Publisher Admin API
  4. Sets API

Sets API

The Sets API can be used to make groups of layers, tables and documents.

Set list

GET /sets/
Lists sets

Returns a list of all the sets available to you.

This view shows all items within each set. If you don’t have permission to view an item within a set, its URL will still appear.

Response 200

Headers

Content-Type: application/json

Body

[{
    "id": 1, 
    "title": "My collection", 
    "description": "a collection of layers", 
    "description_html": "<p>a collection of layers</p>", 
    "categories": [], 
    "tags": [],
    "user": {
        "id": 3, 
        "name": "Bob Jones"
    }, 
    "items": [
        "https://{domain}/services/api/v1/layers/2/", 
        "https://{domain}/services/api/v1/layers/1/"
    ], 
    "url": "https://{domain}/services/api/v1/sets/1/", 
    "url_html": "https://koordinates.com/set/1-a-collection/", 
    "metadata": null, 
    "publish_to_catalog_services": true, 
    "permissions": "https://{domain}/services/api/v1/sets/1/permissions/", 
    "created_at": "2012-12-19T23:13:26.324Z"
}]
POST /sets/
Create a set

Required fields are:

  • title
  • description
  • Either group or user. This should be the ID or URL of the group or user you want to create the set for.

Notable other fields:

  • items: A list of layers and/or documents specified using their urls. The order of this list will be used when rendering 

Request

Headers

Content-Type: application/json

Body

{
    "title": "a collection", 
    "description": "My favourite layers", 
    "categories": [], 
    "tags": [], 
    "user": 3,
    "items": [
        "https://{domain}/services/api/v1/layers/2/", 
        "https://{domain}/services/api/v1/layers/1/"
    ]
}

Response 201

Headers

Content-Type: application/json
Location: https://{domain}/services/api/v1/sets/123/

Body

{
    "id": 123,
    "title": "a collection",
    "description": "My favourite layers",
    "description_html": "<p>My favourite layers</p>",
    "categories": [],
    "tags": [],
    "user": {
        "id": 3, 
        "name": "Bob Jones"
    }, 
    "items": [
        "https://{domain}/services/api/v1/layers/2/",
        "https://{domain}/services/api/v1/layers/1/"
    ],
    "url": "https://{domain}/services/api/v1/sets/123/",
    "url_html": "https://koordinates.com/set/123-a-collection/",
    "metadata": null,
    "publish_to_catalog_services": false,
    "permissions": "https://{domain}/services/api/v1/sets/123/permissions/",
    "created_at": "2015-05-12T21:54:21.276Z"
}

Set detail

GET /sets/{id}/
Get set detail

Displays details of a set.

Response 200

Body

{
    "id": 1, 
    "title": "My collection", 
    "description": "a collection of layers", 
    "description_html": "<p>a collection of layers</p>", 
    "categories": [], 
    "tags": [],
    "user": {
        "id": 3, 
        "name": "Bob Jones"
    },  
    "items": [
        "https://{domain}/services/api/v1/layers/2/", 
        "https://{domain}/services/api/v1/layers/1/"
    ], 
    "url": "https://{domain}/services/api/v1/sets/1/", 
    "url_html": "https://koordinates.com/set/1-a-collection/", 
    "metadata": null, 
    "publish_to_catalog_services": true, 
    "permissions": "https://{domain}/services/api/v1/sets/1/permissions/", 
    "created_at": "2012-12-19T23:13:26.324Z"
}
PUT sets/{id}/
Update a set

The following fields are editable (other fields will be ignored):

  • title
  • description
  • categories
  • tags
  • user / group
  • items (note: existing items will be removed if they’re not specified here)

Request

Headers

Content-Type: application/json

Body

{
    "description": "Important Layers"
}

Response 200

Headers

Content-Type: application/json

Body

{
    "id": 1, 
    "title": "My collection", 
    "description": "Important Layers", 
    "description_html": "<p>Important Layers</p>", 
    "categories": [], 
    "tags": [],
    "user": {
        "id": 3, 
        "name": "Bob Jones"
    },  
    "items": [
        "https://{domain}/services/api/v1/layers/2/", 
        "https://{domain}/services/api/v1/layers/1/"
    ], 
    "url": "https://{domain}/services/api/v1/sets/1/", 
    "url_html": "https://koordinates.com/set/1-a-collection/", 
    "metadata": null, 
    "publish_to_catalog_services": true, 
    "permissions": "https://{domain}/services/api/v1/sets/1/permissions/", 
    "created_at": "2012-12-19T23:13:26.324Z"
}
DELETE /sets/{id}/
Delete a set

Delete this set.

Response 204