How to send SMS using api?

Hello,

how is it possible to send an SMS using the API?
It's not clear from the docs..

  • Do I need to create a conversation for that?
  • Is there a simple way to do that if I have an SMS number I bought from PureCloud?
  • Do I need an external service for that?

You can read more about ACD SMS routing in PureCloud here: https://help.mypurecloud.com/articles/about-acd-messages/

SMS messaging is handled via the /api/v2/conversations/messages/* API resources.

Thanks I read those, and I think but I'm not sure, would be great to get a bit more in-depth explanation.

Use POST /api/v2/conversations/messages to send an outbound SMS message. There's only a couple properties in the request, and the documentation on them is pretty straightforward. Let me know if you have specific questions.

I saw, but it seems that it's telling me that my user is not part of the queue I'm trying to send from, how can I find my user when using client credentials?

There is no user when using client credentials; you have to authenticate as a user using one of the other Authorization methods.

Okay I see, and are those token only time limited, meaning I need user interaction again once in a while in order to allow my servers to send sms message and do activities on behalf of a user?

Or is that something I need to do once and then I can use the access code again and again to generate new tokens for my app?

You can't create conversations of any type without a user. The user must log in to your app to authorize it the first time, and every time after that when the token expires. There is no option for an unattended server application to create outbound conversations (other than predictive/power/agentless outbound voice campaigns). You can request new product features at https://purecloud.ideas.aha.io/ideas.

I see, with google oauth it works.

  • Do the access code expire? Or only the access token expires?
    Can I just use the same access code again and again to generate new tokens when one expires?
  • How long until the access token expires?

Access codes are for one-time use. Access tokens expire based on how you've chosen to configure your oauth client. As mentioned before, when the token expires, the user must re-authorize; there is no way to authorize an app once and have it stay logged in forever, or even for a long time. Access tokens have a max lifetime of 48 hours.

If you're trying to build an unattended outbound SMS campaign, you'd be better served integrating with a 3rd party SMS service that is built for bulk outbound messaging. SMS in PureCloud is currently only intended for inbound/outbound conversations with an agent and comes with caveats that will make an unattended or bulk solution nearly impossible.

Thanks, any suggestion for such 3rd party that integrates easily with PureCloud?

You'd be integrating the SMS provider into your app, not into PureCloud directly. If you want to use PureCloud APIs in the app also, that's possible. We don't generally make recommendations for 3rd party services, especially paid ones. If you search for something like "bulk SMS provider" you'll find plenty of results.

On a related note, the project for outbound SMS campaigns has just kicked off and is targeting late 2019 to early 2020 for release.

Can I use the purecloud sms number to send sms using a 3rd party? Or is the sms number locked to the purecloud system?

@tim.smith Can I use the purecloud sms number with 3rd party providers to send sms, or is it locked down to purecloud only?

To use SMS in PureCloud, you must use our number service.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.