Skip to main content

Authentication

To use our APIs, you need to authenticate your requests. At Natech, we support two methods of authentication:

API Key Authentication​

Include your API key in the header of each request:

Authorization: Bearer YOUR_API_KEY

OAuth 2.0​

For more secure applications, we recommend using OAuth 2.0[https://oauth.net/2/]. Here's how to get an access token:

  1. Redirect the user to our authorization URL
  2. Receive the authorization code
  3. Exchange the code for an access token
curl -X POST https://api.example.com/oauth/token \\
-d "grant_type=authorization_code" \\
-d "client_id=YOUR_CLIENT_ID" \\
-d "client_secret=YOUR_CLIENT_SECRET" \\
-d "code=AUTHORIZATION_CODE"