Skip to content

API Authorization in IPMonitor

IPMonitor's REST API offers a robust way to manage assets, check system health, and access user profile information programmatically. To ensure secure and controlled access, API endpoints require proper authorization through API keys. This guide will explain how to generate and use API keys within IPMonitor.

Generating an API Key

  1. Navigate to API Tokens: In your IPMonitor account, select the "API Tokens" link from the left side menu. Make sure you are in the correct project environment before proceeding.

  2. Create New API Token:

    • Provide a name for your new API token.
    • Choose the permissions you wish to assign to this token.
    • Click the "CREATE" button.
  3. Token Generation: Your new API token will be generated and displayed.

WARNING ⚠️

It's crucial to keep your API tokens secure and confidential. Do not share your API tokens publicly.

Using the API Token

  • Adding to API Requests: Include the generated API token in the "Authorization" header of your API requests as a bearer token. For example:
    curl -X 'GET' \
      'https://ipmonitor.mydomain.com/api/v1/system-check' \
      -H 'accept: */*' \
      -H 'Authorization: Bearer your_api_token_here'
    curl -X 'GET' \
      'https://ipmonitor.mydomain.com/api/v1/system-check' \
      -H 'accept: */*' \
      -H 'Authorization: Bearer your_api_token_here'

Understanding API Responses

  • Successful Request: If the API token is valid, you will receive a 200 OK HTTP response code along with a response indicating the system's status, such as:

    {
      "status": "ok",
      "message": "System is up and running"
    }
    {
      "status": "ok",
      "message": "System is up and running"
    }
  • Unauthorized Access: In case the API token is invalid or missing, the API will return a 401 Unauthorized HTTP response code.