Skip to content

Use with Postman, Bruno or Insomnia ​

Every endpoint of the API is ready to import into the API client you already use, built from the same description as the reference. Each comes with an environment holding three variables: baseUrl, token and organization_id. None of the files contains a token.

Start with a test token from your sandbox. Its sample data is safe to change, and nothing you send there reaches a provider or the internet. Switch to a live token once your requests do what you expect.

FileFor
infranest.postman_collection.jsonPostman: every endpoint, one folder per reference page
infranest.postman_environment.jsonPostman: the environment
infranest.bruno.zipBruno: the collection as a folder of .bru files, with its environment
openapi.jsonInsomnia, Bruno, Hoppscotch and anything else that imports OpenAPI 3

The same files are kept, versioned, in infranest-openapi.

Postman ​

  1. Select Import, and drop in both infranest.postman_collection.json and infranest.postman_environment.json.
  2. Pick the InfraNest environment in the top right.
  3. Set token to your token (it is a secret variable, so Postman masks it) and organization_id to your organization's ID — the number after /organizations/ in the app's address.
  4. Open Account → Get the signed-in user and select Send: it works with any token, so it checks the token and the variables.

Requests with an ID in the path, such as a zone's records, show it as a path variable (:dnsZone_id) under Params; fill it in there.

Bruno ​

  1. Unzip infranest.bruno.zip. It holds one folder, infranest.
  2. In Bruno, select Open collection and pick the infranest folder. Keep it in your repository if you like: Bruno's files are made to be committed.
  3. Pick the InfraNest environment and set organization_id. token is a secret: Bruno keeps its value on your machine, never in the files.
  4. Send a request. Filters a request can take are listed under Params, switched off until you tick one.

Bruno can also import openapi.json directly (Import collection → OpenAPI), if you prefer its own layout.

Insomnia ​

Insomnia imports the OpenAPI description itself:

  1. Select Import, and give it https://developers.infranest.io/openapi.json (or the downloaded file).
  2. In the environment it creates, set the base URL to https://api.infranest.io and add your token as a Bearer token on the collection.

Generating a client ​

openapi.json also feeds code generators. For example, with openapi-generator:

sh
npx @openapitools/openapi-generator-cli generate \
  -i https://developers.infranest.io/openapi.json -g typescript-fetch -o ./infranest-client

Use -g python, -g php, -g go or -g csharp for those languages. Each operation carries x-infranest-scope, the scope a token needs for it.