NAV
shell javascript php

Introduction

Welcome to the ExpressMaps API. You can use our API to manage your ExpressMaps API keys including the following operations:

We have language bindings in cURL / Shell, JavaScript and PHP. You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right.

Authentication

We use Bearer authentication for requests to the ExpressMaps API endpoints.

Before you can use this API, you'll need to retrieve one of your API Management keys. These can be found on your ExpressMaps Console / Settings page. You should have two keys:

Read-Only Key - used for read only operations (for example, listing your keys or reading a specific key)

Read-Write Key - required when adding, editing or deleting a key

We suggest you use the Read-Write key to get started.

Authenticate your requests by passing one of these keys in the Authorization header as "Bearer {your-api-key}".

Authorization: Bearer your-api-key

Keys

List all keys

Copy to Clipboard
curl -X GET https://api.expressmaps.com/keys \ -H 'Accept: application/json' \ -H 'Authorization: Bearer {your-api-key}'

The above command returns JSON structured like the following:

Copy to Clipboard
{ "keys": [ { "name": "Friendly key name", "uuid": "em7fa91fbc9d344ec1994e4ccf2d3d00", "created": 1601018765, "modified": 1601020595, "status": "Enabled", "referrer_restrictions": [ "example.com", "other-website.com" ], "ip_restrictions": null }

GET /keys

This endpoint retrieves all keys in your account and returns them in a JSON array of keys.

Create a key

Copy to Clipboard
curl -X POST https://api.expressmaps.com/keys \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer {your-api-key}'

Body Parameters

Copy to Clipboard
{ "name": "Key name", "status": "Disabled", "referrer_restrictions": [ "new-url.com" ] }

POST /keys

This endpoint creates a new API key. Once the key is created, it is immediately activated and can be used to access ExpressMaps mapping services.

By default, the key is not restricted in any way so we recommend adding domain restrictions to the key using the Update a key method.

Parameter In Description
name body The key name [Required]
status body 'Enabled' or 'Disabled' (defaults to 'Enabled')
referrer_restrictions body A JSON array of domain names (defaults to none)

The above command returns JSON structured like the following:

Copy to Clipboard
{ "key": { "uuid": "ea6a3c647c5847bbbfa601d723b2612b", "name": "My Key name", "created": 1619956381, "modified": "", "status": "Enabled" }, "status_message": "OK" }

Update a key

Copy to Clipboard
curl -X PATCH https://api.expressmaps.com/keys/{keyUUID} \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer {your-api-key}'

Body Parameters

Copy to Clipboard
{ "name": "New key name", "status": "Disabled", "referrer_restrictions": [ "new-url1.com", "new-url2.com" ] }

PATCH /keys/{keyUUID}

This endpoint updates an existing API key. The key can be renamed, enabled or disabled and the domain restrictions can be updated.

By default, the key is not restricted in any way so we recommend adding domain restrictions to the key using the Update a key method.

Parameter In Description
keyUUID path The uuid of the key that you are updating [Required]
name body The new key name
status body "Enabled" or 'Disabled'
referrer_restrictions body A JSON array of domain names or either an empty array or a null value to clear all existing restrictions

The above command returns JSON structured like the following:

Copy to Clipboard
{ "key": { "uuid": "ea6a3c647c5847bbbfa601d723b2612b", "name": "My Key name", "created": 1619956381, "modified": "", "status": "Enabled" }, "status_message": "OK" }

Delete a key

Copy to Clipboard
curl -X DELETE https://api.expressmaps.com/keys/{keyUUID} \ -H 'Authorization: Bearer {your-api-key}'

DELETE /keys/{keyUUID}

This endpoint deletes an existing API key.

Parameter In Description
keyUUID path The uuid of the key that you are deleting [Required]

The above command returns JSON structured like the following:

Copy to Clipboard
{ "status_message": "OK" }