Measure MapAPI

Create an access token

POST/auth/token
auth EnterpriseOpen Guest

A token that stands in for your key for a while, so the key never has to leave your server. Put it in an embed's address (token=), or send an Open Guest visitor to a new project of their own with it.

The token belongs to the same environment as the key: a sandbox key mints sandbox tokens. Embeds only open live projects, so use a live key for them.

Request body application/jsonoptional

Fields of AccessTokenRequest:

  • durationinteger
    How long the token works, in seconds. 3600 (an hour) when left out; at least 60 and at most 86400 (24 hours).
    Default360060 to 86400

Responses

  • AccessToken:

    • tokenstringrequired
      The token. Treat it like a password until it expires.
    • expiresOninteger(int64)required
      When the token stops working, in milliseconds since 1 January 1970 (UTC).
    • environmentstringrequired
      Which world the key, and everything made with it, belongs to. See Live and sandbox.
      One oflivesandbox

Errors

A failed request answers with one of these, in an Error body.

401unauthorized_actionThe item is not on your account or your members', the request came from a web page on a website the key does not allow, or the action is not allowed for this person.
403api_key_suspendedAPI access on your account has been suspended. Contact support.
403insufficient_scopeThe key does not have the access this endpoint needs. Create a key with that access.
403invalid_api_keyNo key was sent in the Authorization header, or the key is unknown, revoked, or past the time it kept working after being replaced.
403invalid_subscriptionYour plan has no API access. The API is part of the Enterprise and Open Guest plans.
403subscription_expiredYour subscription is not active. Update your payment method in the app.
429too_many_requestsYour account asked for more than 600 tokens in an hour. Wait a little and try again.

Try it

This key is

The key stays in this tab and goes only to the API. Use a sandbox key while you try things: requests are real, and what they change is changed.

POST https://api.measuremaponline.com/api/v1/auth/token

Fill in your API key to send.

As a cURL command
Shell
curl -X POST 'https://api.measuremaponline.com/api/v1/auth/token' \
  -H "Authorization: $MMO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "duration": 3600
}'