Importing our API into Postman from the OpenAPI specification, step by step

WhatsApp & APIs·· 21 views· 3 min read

The short answer: Postman reads our OpenAPI specification and builds a collection with every API request, grouped by area. Then you set your key in one place and start testing, outside the browser and with your own requests saved.

Step by step

1 Copy the specification link from the API reference, Specification section, or download the openapi.json file.
2 In Postman, click Import and paste the link, or drag the file into the window.
3 Choose to import it as a collection. If Postman offers to organise folders by tags, take it: the folders then match the areas of the documentation.
4 Create an environment with a variable for the key, for example rlx_api_key, and put your sandbox_ key in the current value.
5 On the collection, Authorization tab, choose Bearer Token and type {{rlx_api_key}}. Requests that inherit auth from the collection will use it.
6 Check the address: the import usually creates a base address variable from the specification. Make sure it points to the MozOut API.
7 Test: first GET /v1/ping, which needs no key, then GET /v1/token, which shows what the key can do.
Mind where the key lives. In Postman, the initial value of a variable is shared with everyone who has access to the workspace; the current value stays, by default, on your computer only. Put the key only in the current value, and never export or share a collection with the key inside.

Details that save surprises

Detail What to do
Error messages in Portuguese Add the Accept-Language: pt header to the requests.
POST requests Send Idempotency-Key with a unique value. In Postman, the dynamic variable {{$guid}} generates one on every send.
Operation names in English That is expected: tools read the English texts in the specification.
The API changed Import the specification again. The "Updated on" date of the reference tells you when.
Before you use a prod_ key, run the same requests with a sandbox_ key: writes are simulated and never charge. More about the file in the OpenAPI specification.

The specification link is at the end of the API reference.

See the specification

SEE ALSO

The OpenAPI specification of our API: what it is, where to download it and what it contains

Importing our API into Insomnia and other API clients, and setting the Bearer key

Generating an API client for your language from our OpenAPI specification

Your key in the API Playground: where it stays, why sandbox_ first, and the prod_ warning

An API key or token has leaked: what to do, in the right order

RECOMMENDED PRODUCT

Web hosting with cPanel

Domain and SSL included, daily backups and the panel you already know. from ₦9.900,00/mo (3-year plan, with coupon)

See plans
Was this answer helpful? Your answer helps us improve this article.