Create an access token
POST
/auth/tokenA 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:
durationintegerHow 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
tokenstringrequiredThe token. Treat it like a password until it expires.expiresOninteger(int64)requiredWhen the token stops working, in milliseconds since 1 January 1970 (UTC).- Which world the key, and everything made with it, belongs to. See Live and sandbox.One of
livesandbox
Errors
A failed request answers with one of these, in an Error body.
401
unauthorized_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.403
insufficient_scopeThe key does not have the access this endpoint needs. Create a key with that access.403
invalid_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.403
invalid_subscriptionYour plan has no API access. The API is part of the Enterprise and Open Guest plans.429
too_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/tokenFill in your API key to send.
As a cURL command
curl -X POST 'https://api.measuremaponline.com/api/v1/auth/token' \
-H "Authorization: $MMO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"duration": 3600
}'