Authorization Question

I am getting a 401 unauthorized when testing the Get Token API. What is the dev CloudLink portal URL so I can confirm/reset my credentials for the Dev account 327410625? Thanks

Hi Josh! You shouldn’t need to touch the credentials, I think your issue is likely the endpoint that you’re hitting. The documentation right now directs you to the Production endpoints, you’ll want the Sandbox endpoints which are:

{service}.dev.api.mitel.io

In the case of the Get Token, you’ll want to use https://authentication.dev.api.mitel.io/2017-09-01/token

Let me know if that fixes your issue. Thanks for pointing this out, we’ll see about getting the documentation updated to reflect the different environments.

Thanks. I’m still having an issue. I am using the post command and variables in the body that were provided via the screen shot on our call yesterday.

POST: https://authentication.dev.api.mitel.io/2017-09-01/token

Body
grant_type
username
password
account_id

Leaving blank give me the same 401 unauthorized error.

Thanks

Are you saying that you’re leaving the values in the body blank? If so, you do need to populate it:

grant_type: “Password”
username: {username}
password: {password}
account_id: “327410625”

When you go to refresh the token later, you don’t need to supply the username and password again and can instead use the “refresh_token” provided with the initial token to get an updated set:

grant_type: “refresh_token”
refresh_token: {refresh_token}

No. I initially used my email address as username and what I thought was my password. Since I received the 401 unauthorized, I kicked off this request to determine what my credentials were or to reset them. Thanks

Hi Josh - Sorry for the confusion here. You can access your account through https://accounts.dev.mitel.io

If your credentials work there, then they should also work for the POST Token API call. If they don’t work, then you can reset your password.

All this said, I did make a mistake in my earlier post. The Auth request doesn’t use JSON for the content-type, it uses application/x-www-form-urlencoded…however I suspect you already knew that :wink:

For reference, here’s a screenshot of a call that works for me using my credentials (just in case you’re doing something different):

Thanks. I was able to reset the password and I can get a token now. Appreciate it.

1 Like

Related question. I received token and tried to use it for subsequent API call (create conversations) by putting token within header but getting unauthorized error. I can’t find details on where to place within the request

Nevermind. I got past that part but now I am getting data.originalParticipants(0).type should be equal to one of the allowed values.

What are the allowed values for this parameter?

If you expand the ‘OriginalParticipants’ object here, you’ll see the allowed values for ‘type’ are “SMS”, “User” or “Workflow”. I suspect you’ll want “User”.

Thanks,

I actually did do that before, but I used “User” and got the error message. Did not realize that I had to type “USER” in all caps for it to work.

That’s a good catch! We’ll make sure to make a note of case sensitivity as we improve the documentation.

Hi,
I am just started learning Mitel API for Application integration and got confused with credentials .so can you please guide me where I can get the username, password and account_id .I already have Mitel credentials but that are not working for me .I am using postman for sending /token request and got invalid credentials response.

Thanks

Hi there XLD, welcome to the community forum!

Do the Mitel credentials that you have work with the CloudLink Accounts Portal (https://accounts.mitel.io)? If you can, then you’ll be able to find your accountId easily from there.

If you can’t login, then the credentials you have aren’t CloudLink credentials. I’ll need to know if you’re a Mitel Authorized Partner (feel free to PM me) and we can go from there.

Thanks for the response budd .
Budd, I am not able to login using my credentials’ need your guidance for integrating my ERP with Mitel cloudLink platform .right know i have some information that i mention below
1.PDF document named “System OAI Toolkit Specifications Manual”
2.On premises devices setup
3.and the name of the product is Mitel5000.

that info i have can you please guide me further

Thanks

Hi XLD,

I’m not familiar with the PDF document you’re referring to, but it looks like it might be an OAI integration guide for the MiV5000 which is for directly integrating with that PBX, something quite different from the CloudLink APIs and is currently outside the scope of the Developer Portal and Community Forums.

You will need a few things you typically need to get started, there’s a good guide here: Getting Started.

That said, your account information implies you may actually be from the ERP vendor? If that’s the case, you will need to at least be a Mitel Technology Partner in order to obtain a CloudLink account and use the APIs. Typically in your scenario you would use the account information for the Mitel customer that you are creating the integration for.

If I’m wrong and you are from a Mitel Authorized or Mitel Technology Partner, someone in your organization should have your CloudLink information. You can try logging into https://miaccess.mitel.com/ and see if you have ‘CloudLink Account Console’ in the navigation menu. If you can’t login to MiAccess or know who in your organization has the information you need, you will need to reach out to your Mitel Channel (or Technical) Account Manager.

In regards to the integration you’re looking to build with an ERP, I’m happy to provide some guidance around using the APIs to achieve your goals, I just need some details around what exactly you’re looking to accomplish.

Hi budd,
Thanks for the details

I got some info like
1.They have Linux platform where Mitel system is setup.
2.also got an IP address. a technical person said to me that you can integrate using IP address via TCP IP socket.
3.Mitel authorized partner is Patriot Communications (owner Robert Murray)

can you please help me with above mention info.

My Goal is to make call from my ERP system and download call logs with recording.

Thanks

Hi XLD,

To authenticate you’ll need to reach out to Patriot Communications and have them provide you with the relevant CloudLink account and user information. We recommend that initial development be performed in a dedicated sandbox environment.

You will most likely also want to Create a Client with the Admin API, which will in turn be used by your integration to authenticate against the APIs. The client in this case acts like a service account, so you don’t need to use a real user account or create a dummy one (use grant_type = client_credentials when requesting the token).

Once you’re able to authenticate, you can use the Call History resource, however that’s typically used for getting specific call records. Alternatively you can make use of the Notifications API to receive notifications when a call has completed as it contains a fair amount of information about the call. For an integration with an ERP system, when you create the Subscription you will most likely want to set it up to send you notifications via webhooks as opposed to creating a websocket connection (though that’s possible to do).