Header Logo

Developer Portal

Postman Library

Mitel has created a library of API calls that can be imported into Postman. The library consists of an 'environment' that lets you set values to be used by the various API calls, and a collection for each of the CloudLink APIs.

The library consists primarily of useful and commonly used API calls, however it is not a complete library of all possible API calls. The library is provided as a courtesy and is not directly supported by Mitel. Please always refer to the API documentation as a primary source of information.

Installing the Library

Click here to download a Postman library for the CloudLink API. To use the Postman library, perform the following steps:

  • Download and install the Postman API tool.

  • Download the Postman library using the link above (ZIP file)

  • In Postman, click on 'Workspace' on the top toolbar, and create a new Workspace.

    • If you are using the free version of Postman, ensure that 'Visibility' is set to 'Personal' otherwise you will exceed the limit on the number of shared collections when you import the CloudLink Postman Library.


Postman - Workspace

  • Beside the Workspace name, click 'Import'


Postman - Import

  • Drag and drop the JSON files for the CloudLink Postman Library into the import window, then click 'Import'.

  • In the navigation menu, go to 'Environments' and select the 'CloudLink' environment.

    • Set your CloudLink username, password, and accountID.

    • Set your x-mitel-app header according to these instructions

    • Optionally, set the URL for each API according to the CloudLink environment you are working with.

    • Leave the access_token and refresh_token blank, these will be automatically populated when running the POST Token API call.


    Postman - Variables

  • In the navigation menu, go to 'Collections'

  • Select each of the collections and set the environment to CloudLink in the top right, saving after updating each collection.


Postman - Set Environment

Using the Library

Once you have completed the import of the CloudLink library, start by going to the Authentication collection and running POST Token to obtain an authentication and refresh token. Once that has been completed, you can run any other API call from any of the collections.

If in the future you receive an unexpected 'Unauthorized' error on an API call, it's likely that your token has expired and you will need to run the POST Refresh Token or POST Token API call.

Query Parameters

GET operations will typically include Query Parameters that you can enable under the 'Params' tab. To use these, ensure they are selected with a checkmark and enter the desired value in the 'Value' column. More information on query parameters, including Odata operations, can be found here: https://www.odata.org/documentation/odata-version-2-0/uri-conventions/

Variable Use

Most API calls will include variables:

{{Real Variables}} - Encapsulated with double braces and typically orange, hover your cursor over it to see the current value.

{User Entered Values} - Encapsulated with single braces, you will need to replace these with an appropriate value when making your API call.

Request Bodies

With a few exceptions such as the Authentication API calls, request bodies are typically in JSON format. You can find the template for the request body under the 'Body' tab for the API call.

You will need to provide your own valid values when using an API call with a request body. Please refer to the API Documentation for the specific API call to determine which fields are mandatory and what the acceptable values are.

Questions

For any questions or issues pertaining to the CloudLink Postman Library, please visit the Mitel Developer Forum.


Code Samples

Mitel has created the following code samples written in JavaScript using node.js. These code samples are provided for demonstration purposes "as-is", and neither support or functionality is guaranteed.

Authentication - OpenID Connect

This sample code accepts input of a username, password, accountId, and valid clientId (application identifier) and then uses the Open ID Connect flow to obtain an authentication token.

Download: https://github.com/mitel-networks/developer-api-program/tree/DAPI-272

Conversations - Direct Chat

Download: https://github.com/mitel-networks/developer-api-program/tree/DAPI-270

The code will run the Open ID Connect flow to obtain valid authentication tokens for each pariticipant. The code will then create a direct conversation, add both participants, send a message, then delete the conversation.

This sample code accepts input of:

  • Username, password, and accountId for participant 1

  • Username, password, and accountId for participant 2

  • A valid clientId (unique application identifier)

  • Text for a message

Notifications - Incoming Call

Download: https://github.com/mitel-networks/developer-api-program/tree/DAPI-347

This sample code makes use of the Create Subscription endpoint to create a subscription for ringing events on a range of endpoints defined by the user. Notifications will be delivered as webhooks to an endpoint defined by the user. The code will run the Open ID Connect flow to obtain valid a authentication token.

This sample code accepts input of:

  • Username, password, and accountId for an Admin user

  • A valid clientId (unique application identifier)

  • A user provided applicationId (128-bit GUID for trust/signing purposes)

  • A user provided deviceId (URL for webhooks to be delivered to)* *A useful tool for receiving test webhooks is https://webhook.site.