2.1 Getting Started

To access our API endpoints, one would first need to generate an Client ID and Secret Key pair at app.sipametrics.com.


Part 1

  1. Login with your credentials at app.sipametrics.com.

  2. Click on the profile icon:

    image-20260519-070558.png
  3. A pop-up dialog would be shown with your profile information. Switch to the “Personal Tokens” tab:

  4. image-20260519-071107.png

    Click “Generate Token” button:

    image-20260519-071201.png
  5. Enter a description and select the token expiry accordingly, then click “Create” button:

    image-20260519-071507.png
  6. Copy the Client ID and Secret Key to a safe location.

    image-20260519-071733.png


Access (bearer) token is configured to expire after 24 hours. Please exchange a new access token with your Client ID and Secret Key when it is near to the expiry.


Part 2

  1. For Python API package:

    1. Use the Client ID and Secret Key directly.

  2. For REST API:

    1. Use the Client ID and Secret Key to exchange for an access (bearer) token with your preferred coding language.

    2. Use the access token in API endpoints.


Sample Code in Python

Python
import httpx

AUTH_API_URL = "https://sso.sipametrics.com"

def exchange_access_token(client_id: str, secret_key: str) -> dict:
    """
    Exchange a client_id + secret for a JWT access token
    using the OAuth 2.0 client_credentials grant.
    """
    url = f"{AUTH_API_URL}/oauth/token"

    payload = {
        "client_id": client_id,
        "client_secret": secret,
        "grant_type": "client_credentials",
    }

    response = httpx.post(url, json=payload)
    response.raise_for_status()

    return response.json()

def main():
    CLIENT_ID = "<your_client_id>"
    SECRET_KEY = "<your_secret_key>"
    token_data = exchange_access_token(client_id=CLIENT_ID, secret_key=SECRET_KEY)
    print(token_data)

if (__name__ == "__main__"):
    main()

Sample Response

JSON
{
  "token_type": "Bearer", 
  "access_token": "ey...4A", 
  "id_token": "ey..4A", 
  "refresh_token": "<random_guid>",
  "expires_in": 86400
}


With REST API client, please ensure the Authorization header comes with the Bearer prefix, e.g.:
Authorization: Bearer ey…4A