Wemap REST / Content API
The Wemap platform offers a REST API to create/update pinpoints and events from your own CMS or sources.
The Wemap content API is accessible upon request. All calls need to be authenticated by using a Bearer token in the Authorization header.
You can find the documentation here.
For access to or questions about the Wemap content API, please contact us.
This document provides a list of data fields and APIs which are supported. Any data field or API which is not explicitly listed here must not be used, as it may be changed or removed at any time.
All Wemap APIs live on the following host: https://api.getwemap.com
Getting started
Before you can make use of the REST API, you need to register your applications. From the Wemap Pro portal click on your name in the upper right corner then select "Developer settings".
Create your application and make a note of the client id and client secret.
You can now request an OAuth2 access token using Basic authentication as follows.
Example request:
POST /v3.0/oauth2/token HTTP/1.1
Authorization: Basic c29tZS1jbGllbnQtaWQ6c29tZS1jbGllbnQtc2VjcmV0
Content-Type: application/x-www-form-urlencoded
client_id=some_client_id&grant_type=client_credentials
Example response:
HTTP/1.1 200 OK
Content-Type: application/json
{
"access_token": "JGTEVsbnhfjtKXoyJRriYgwDlGHsun",
"expires_in": 36000,
"scope": "write read",
"token_type": "Bearer"
}
Making requests
All Wemap API calls need to be authenticated by using a Bearer token in the Authorization header:
GET /some/endpoint HTTP/1.1
Authorization: Bearer <Access-Token>
Requests take either no data or JSON data as input, and return data as JSON. Make soure you set the correct Content-Type header when sending JSON:
POST /some/endpoint HTTP/1.1
Content-Type: application/json
Pagination
All Wemap APIs which return lists of objects make use of pagination. When you make a request, you will receive the first page of results along with a pointer to the page of results. If you wish to retrieve additional results, you must make use of the provided URL. Do not attempt to construct an URL yourself as the precise URL format is subject to change at any time.
Example request:
GET /v3.0/someapi HTTP/1.1
Authorization: Bearer <Access-Token>
Example response:
HTTP/1.1 200 OK
Content-Type: application/json
{
"next": "https://api.getwemap.com/v3.0/someapi?cursor=something",
"previous": null,
"results": [
{
"id": 1,
"name": "First object"
},
{
"id": 2,
"name": "Second object"
}
]
}