Skip to content
This repository was archived by the owner on Mar 2, 2021. It is now read-only.

MapCatalog API Reference

nicolas-f edited this page Oct 9, 2012 · 13 revisions

This is a draft of the API Specification of the MapCatalog.

Errors

In any of the API calls below, any input error will return

Status: 400 Bad Request

The content of the response can contain a plain text explanation of the problem.

Authentication

##Acquiring an API key When the response status code of the API is 401, the client need to acquire or renew the API Key.

Using Basic_access_authentication through HTTPS, the response body is the API Key.

GET auth/

Response

Status: 200 OK
PoIhZGlKjUNlc2FtIG9wZW4=

Using API key

The authentication key (managed by the application) has to be given with the following parameter key=value

Ex : To list workspaces with the key GET /map/workspaces?key=Jdj7oOplmlsS

List workspaces

GET /workspaces

Parameters

None

Response

Status: 200 OK
<?xml version="1.0" encoding="utf-8"?>
<workspaces>
  <workspace>
    <name>default</name>
  </workspace>
  <workspace>
    <name>toto</name>
  </workspace>
  ...
</workspaces>

Get all map contexts in a workspace

GET /workspaces/:name/contexts

Parameters

  • name (required): the name of the workspace

Response

Status: 200 OK
<?xml version="1.0" encoding="utf-8"?>
<contexts>
  <context id="0" date="2012-09-12">
    <title xml:lang="en">My custom context</title>
    <abstract xml:lang="en">Some text here.</abstract>
  </context>
  <context id="1" date="2012-08-22" path="personal/">
    <title xml:lang="en">My context</title>
    <abstract xml:lang="en">Some interesting text here.</abstract>
  </context>
  ...
</contexts>

Get a specific context

GET /workspaces/:name/contexts/:id

Parameters

  • name (required): the name of the workspace
  • id (required): the identifier of the map context to retrieve

Response

Status: 200 OK
<?xml version="1.0" encoding="utf-8"?>
<OWSContext id="3" version="0.4.2" xsi:schemaLocation="http://www.opengis.net/ows-context 
  http://geosysin.iict.ch/ogc_schemas/owc/owsContext_0.4.2.xsd">
  ...
  <!-- the content of the context here -->
</OWSContext>

Upload a new context

POST /workspaces/:name/contexts
POST /workspaces/:name/contexts/*path

Parameters

  • name (required): the name of the workspace
  • path (optional): the path of the map context

Input

<?xml version="1.0" encoding="utf-8"?>
<OWSContext version="0.4.2" xsi:schemaLocation="http://www.opengis.net/ows-context 
  http://geosysin.iict.ch/ogc_schemas/owc/owsContext_0.4.2.xsd">
  ...
  <!-- the content of the context here -->
</OWSContext>

Response

Status: 201 Created
<?xml version="1.0" encoding="utf-8"?>
<context id="1" date="2012-08-22">
  <title>My context</title>
  <abstract>Some interesting text here.</abstract>
</context>

Update a context

POST /workspaces/:name/contexts/:id

Parameters

  • name (required): the name of the workspace
  • id (required): the identifier of the map context to retrieve

Input

<?xml version="1.0" encoding="utf-8"?>
<OWSContext id="1" version="0.4.2" xsi:schemaLocation="http://www.opengis.net/ows-context 
  http://geosysin.iict.ch/ogc_schemas/owc/owsContext_0.4.2.xsd">
  ...
  <!-- the content of the context here -->
</OWSContext>

Response

Status: 200 OK
<?xml version="1.0" encoding="utf-8"?>
<context id="1" date="2012-08-22">
  <title>My context</title>
  <abstract>Some interesting text here.</abstract>
</context>
# Remove a context

DELETE /workspaces/:name/contexts/:id

## Parameters
 * **name** (required): the name of the workspace
 * **id** (required): the identifier of the map context to retrieve
## Response

Status: 200 OK

Clone this wiki locally