Telenor Open APIs

The Telenor Sweden external APIs lets you access data, manage subscriptions and services, create quotations and place orders for your specific agreement including account management on your user's behalf.

Initial Setup

In order to get started you must sign an agreement with Telenor to consume the API products. Please contact your Telenor key account manager to proceed with this. When the signed agreement is processed you will receive the user credentials, both for production and test environments. Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, or similar.

Authentication

Authentication will be using OAuth2 Client Credentials protocol. Telenor support two types of tokens, access tokens and JSON Web Tokens (JWT). When signing up you will get details of what token to use. Before any requests can be made towards Telenor APIs you must first request a token.

Example request for an access token

	
curl -X POST https://<baseURL>/openapi/oauth2/token \
  -H 'Accept: application/json' \
  -H 'Authorization: Basic <base64-encoded-key-and-secret>' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d grant_type=client_credentials"
	

Example request for a JWT

	
curl -X POST https://<baseURL>/oauth2/token \
  -H 'Accept: application/json' \
  -H 'Authorization: Basic <base64-encoded-key-and-secret>' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d grant_type=client_credentials"
	
Change the Authorization header to a base64 encoding of your key pair i.e. Base64(<Consumer Key>:<Consumer Secret>). The available baseURL are:

Select and use APIs

On successful token request you will receive JSON object:

	
    {
      "access_token": "iLsXI22AbszY1J3cA7lYusO0PAbG",
      "expires_in": "3599",
      "scope": "openapi"
    }
	

All subsequent requests must use the HTTP Header Authorization: Bearer <access_token>. The different APIs are available in the 'Choose API' menu option. All APIs are documented using OpenAPI format (see OpenAPI Initiative)

Example of an API call

	
curl -X 'GET' \
  'https://<baseURL>/corporate/fixed-network/product-catalog/product-offers' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer <access_token>
	

The access token is valid for 1 hour, after that we will return a 401 HTTP response, with the body explaining that the token has expired and a new one must be requested.