Introduction to API usage
This API will allow the application to fetch information about a company's accounts. Access is limited to the System User used. See guides and examples for details
Below is a quick-view of the API doc.
For developers, the raw swagger doc for the whole API product can be found in one place here
Please use only version 2 of corporate-accounts, corporate-mobile-subscriptions and corporate-agreements since version 1 of these APIs is deprecated.
corporate-accounts
GET
/corporate-accounts/v2/accounts
Get a list of the user's accounts
Implementation notes
Get a paginated list of accounts in the organization(s) that the application has access to.
Parameters
-
Authorization*
-
The authorization header containing the access token. See the oauth-v2 API for how to obtain the token. Example: "Authorization: Bearer 065d160140eea13e72cde31a7b857bbfa37390e5"
-
header
-
string
-
page
-
The page to start search from. Default is 0.
-
query
-
string
-
pageSize
-
The pageSize of results to use in the search. 1-1000.
-
query
-
string
Response class (Status 200)
- idstring
- A number containing up to 8 digits – at the invoice this is shown with the prefix 55
- accountReference1string
- A text field that is free to use by the customer. May contain references or information that gives extra value for the customer and their systems. This reference will occur at the 2. line on the invoice address field. Note that this is visible in the channel where invoice information is displayed. This reference will also be mapped to "deres referanse" in the ehf-format
- ownerOrganization
- The juridical owner of the account. Will always be an organization
- personalPayerPerson
- Will be set if the payer is a person
- invoiceInvoice
- Post address and format of invoice
- statusstring
- Status of the account. Will show PASSIVE if account has been created but not activated, OPEN if both created and activated, and CANCELLED if cancelled
- typestring
- NORMAL means that there may be multiple subscriptions on the account. RESERVED means that only onesubscription is allowed on the account. RING_KONTANT means pre-paid subscriptions on the account
- accountReference2string
- A text field that is free to use by the customer. May contain references or information that gives extra value for the customer and their systems. Note that this will also be visible in invoice reports
- accountReference3string
- A text field that is free to use by the customer. May contain references or information that gives extra value for the customer and their systems. Note that this will also be visible in invoice reports
Organization
- orgNumberstring
- The organization number
- namestring
- The organization name
Person
- firstNamestring
- First name
- lastNamestring
- Last name
- middleNamestring
- Middle name.
Invoice
- address
- The address that the invoice will be sent to
- formatstring
- The format in which the invoice will be sent. This will usually be EHF (Elektronisk handelsformat) for organizations.
[{ "id": "1234567", "accountReference1": "Telenor ASA - IT department", "owner": { "orgNumber": "914742315", "name": "TELENOR" }, "personalPayer": { "firstName": "Ola", "lastName": "Nordmann", "middleName": "Roger" }, "companyPayer": { "orgNumber": "914742315", "name": "TELENOR" }, "invoice": { "address": { "streetName": "Innherredsveien", "streetAddress": "1A", "entranceCode": "H0101", "postalCode": "7018", "postalPlace": "Trondheim" }, "format": "string" }, "status": "string", "type": "string", "accountReference2": "DevOps team", "accountReference3": "Linus Torvalds" }]
Error responses
- 400
- Bad Request:
Error code 40001 - Missing or invalid enduserId
Error code 400034 - Invalid page, must be a positive number or 0
Error code 400035 - Invalid page size, must be between 1 and 1000
- 401
- Unauthorized:
Error code 40101 - Invalid resource
Error code 40102 - Missing authorization header
Error code 40103 - No API product found
Error code 40104 - Not authorized to use given MSISDN
Error code 40105 - Invalid access token
Error code 40106 - Access token expired
Error code 40107 - Basic authentication not allowed for external access or not allowed for client
Error code 40108 - Invalid client id or secret for basic authentication
- 403
- Forbidden:
Error code 40301 - Invalid scope
- 404
- Not Found:
Error code 40401 - Path or method not found
Error code 4042000 - Path or method not found on back-end server
- 429
- Too Many Requests:
Error code 42901 - Rate limit quota violation
Error code 42902 - Spike arrest violation
- 500
- Internal Server Error:
Error code 50001 - Internal Server Error
Error code 50002 - Failed to validate acr
Error code 50003 - Failed to validate subscription
Error code 500100 - Internal server error
- 503
- Service Unavailable:
Error code 503200 - External server error
GET
/corporate-accounts/v2/accounts/{accountId}/mobile-subscriptions
Get all subscriptions for an account.
Implementation notes
Get a paginated list of all subscriptions belonging to an account. Expect up to 5 minutes before changes to mobile subscriptions are reflected in the returned data when using this endpoint.
Parameters
-
Authorization*
-
The authorization header containing the access token. See the oauth-v2 API for how to obtain the token. Example: "Authorization: Bearer 065d160140eea13e72cde31a7b857bbfa37390e5"
-
header
-
string
-
accountId*
-
The account id that the mobile subscriptions should be retrieved for. Use the "/accounts" resource in order to retrieve all accounts available for your user. Example: 1234567
-
path
-
string
-
page
-
The page to start search from. Default is 0.
-
query
-
string
-
pageSize
-
The pageSize of results to use in the search. 1-1000.
-
query
-
string
Response class (Status 200)
- msisdnstring
- The mobile number of the subscription
- typeSubscriptionType
- The subscription type
- userReference1string
- A text field that is free to use by the customer. May contain references or information that gives extra value for the customer and their systems. If userReference1 is used, it will be displayed instead of the name of the user on the invoice
- userReference2string
- A text field that is free to use by the customer. May contain references or information that gives extra value for the customer and their systems. Will only be displayed on invoice reports
- userReference3string
- A text field that is free to use by the customer. May contain references or information that gives extra value for the customer and their systems. Will only be displayed on invoice reports
- validFromDatestring
- Valid from date. Will always be set
- validToDatestring
- Valid to date. Will only be set if the subscription is terminated
- statusstring
- Indicates whether a subscription is active or barred
- userUser
- The user of a subscription. Is either a person or an organization
SubscriptionType
- namestring
- The subscription product name
User
- person
- Will be set if the user is a person
- organization
- Will be set if the user is a company
{ "msisdn": "4799887766", "type": { "name": "Bedrift Total Netto" }, "userReference1": "482930/Ola Nordmann", "userReference2": "Device number 330", "userReference3": "IT department", "validFromDate": "2011-09-22", "validToDate": "2011-09-22", "status": "string", "user": { "person": { "firstName": "Ola", "lastName": "Nordmann", "middleName": "Roger" }, "organization": { "orgNumber": "914742315", "name": "TELENOR" } } }
Error responses
- 400
- Bad Request:
Error code 40001 - Missing or invalid enduserId
Error code 400034 - Invalid page, must be a positive number or 0
Error code 400035 - Invalid page size, must be between 1 and 1000
- 401
- Unauthorized:
Error code 40101 - Invalid resource
Error code 40102 - Missing authorization header
Error code 40103 - No API product found
Error code 40104 - Not authorized to use given MSISDN
Error code 40105 - Invalid access token
Error code 40106 - Access token expired
Error code 40107 - Basic authentication not allowed for external access or not allowed for client
Error code 40108 - Invalid client id or secret for basic authentication
- 403
- Forbidden:
Error code 40301 - Invalid scope
- 404
- Not Found:
Error code 404004 - Account not found
Error code 40401 - Path or method not found
Error code 4042000 - Path or method not found on back-end server
- 429
- Too Many Requests:
Error code 42901 - Rate limit quota violation
Error code 42902 - Spike arrest violation
- 500
- Internal Server Error:
Error code 50001 - Internal Server Error
Error code 50002 - Failed to validate acr
Error code 50003 - Failed to validate subscription
Error code 500100 - Internal server error
- 503
- Service Unavailable:
Error code 503200 - External server error