Skip to content
Last updated

API Basics

To ensure a successful integration, this documentation covers all necessary guidelines, rules, formats, and environment configurations you’ll need. Follow the instructions carefully to develop and go live with Mozrest smoothly.

Happy coding!

Authentication

Provide your API key to authenticate all requests. Keep it secret! No password is required.

Important:

  • Only HTTPS requests are accepted.
  • Your API key will be provided by the Mozrest team.

Example Request

curl "https://api-sandbox.mozrest.com/v1/rms" -H "Authorization: Bearer {api_key}"

Errors

Mozrest uses standard HTTP response codes to indicate request success or failure.

HTTP Status Code Summary

CodeStateDescription
200OKEverything worked as expected
400Bad requestMissing a required parameter
401UnauthorizedAPI key not valid
402Request FailedParameters were valid but request failed
403ForbiddenAccess forbidden
404Not FoundThe requested item does not exist
5xxServer errorsSomething went wrong on Mozrest's server

Versioning

Mozrest releases new API versions when making breaking changes. The current version is v1.

Translations

Mozrest supports translations for certain entities. Provide translations in payloads with the translations object.

Default locale

The default locale can be defined at 2 levels:

  • Globally by Partner
  • On each Venue

Providing translation

PAYLOAD EXAMPLE:

{
  "name": "English translation as a default locale",
  "translations": [
    {
      "locale": "de",
      "data": [
        {
          "field": "name",
          "content": "German translation for the field 'name'"
        }
      ]
    },
    {
      "locale": "es",
      "data": [
        {
          "field": "name",
          "content": "Spanish translation for the field 'name'"
        }
      ]
    }
  ]
}

When providing translation on a creation or update, a translations property must be provided with the following structure:

KeyTypeDescription
localeStringLocate to translate in ISO2 format
data[field]StringThe field to translate.
Example: name, description
data[content]StringThe translation in the desired locale

Get localized data

EXAMPLE REQUEST:

curl GET "https://api-sandbox.mozrest.com/v1/rms/venues/{venueId}/areas/{areaId}" \
  -H "Authorization: Bearer {{api_key}}" \
  -H "x-locale: es"

In order to get the data localized, x-locale the parameter must be provided on the request Headers.

The x-locale parameter must be provided in ISO2 format.

Pagination

Mozrest utilizes offset-limit pagination, using the parameter offset and limit.

KeyConstraintsDefaultDescription
offset0 to ...0The first requested element
limit0 to 5010The requested number of elements

Environments

Production:
https://api.mozrest.com/

Sandbox:
https://api-sandbox.mozrest.com/