Authentication

Authenticate with the Netzo API.

You need to provide valid authentication information to make requests to the Netzo API. To authenticate with the Netzo API, you can use either an API key or a JSON Web Token (JWT).

API Keys

API keys are tokens you can use to authenticate with the Netzo API. Before you continue, make sure you have created an API key. Once you have a valid api Key, you can pass it any of the following two ways.

1. Via the x-api-key header:

This is the way of passing an API key as it is the most secure.

const response = await fetch("https://api.netzo.io/RESOURCE", {
  headers: { "x-api-key": NETZO_API_KEY }
})

const data = await response.json()

2. Via the apiKey query parameter:

This is discouraged, as the API key might be exposed to third parties in the URL.

const response = await fetch(
  "https://api.netzo.io/RESOURCE?apiKey=NETZO_API_KEY"
)

const data = await response.json()

JSON Web Tokens

JSON Web Tokens (JWTs) are used by the Netzo Platform to authenticate and authorize users.

We recommend you use API keys instead of JWTs for authenticating with the Netzo API.
const response = await fetch("https://api.netzo.io/authentication", {
  method: "POST",
  headers: { "authentication": "Bearer NETZO_JWT" }
})

const data = await response.json()