How to Use Plivo’s SMS API with ChatGPT
Posted: Wed Dec 04, 2024 3:37 am
SMS API
How to Use Plivo’s SMS API with ChatGPT
Have you jumped on the ChatGPT bandwagon yet? We’ve been brainstorming how OpenAI’s AI-adjacent natural language processing tool might help Plivo customers. Ideas have ranged from applications as simple as a natural language autoresponder to an application that runs a script based on voice or SMS input to a more complex use chinese overseas europe data case such as an SMS chatbot emulation. (We’d be interested in hearing about anything you’ve already built, or that you’re thinking about.)
Plivo and ChatGPT can interact in two ways — think of them as “to” and “from.” A Plivo action (such as an incoming call or text message) could be a trigger to invoke ChatGPT. For instance, someone might text a question with an #askChatGPT hashtag. Plivo could use ChatGPT APIs to pass that query to ChatGPT and return the answer to the person who initiated the query.

Another use case, for data going in the other direction, would have someone invoke something from ChatGPT that triggers a Plivo action. For instance, you could go to the OpenAI’s Playground page and ask ChatGPT to text everyone in a list a weather report for their area.
ChatGPT can’t use Plivo APIs to call Plivo directly. Any application that wants to allow ChatGPT to use its APIs has to write an OpenAI plugin — and plugins are just leaking out in beta form, so a Plivo plugin won’t be available by the time you read this.
However, Plivo partners with Zapier, an application integration tool, and Zapier is developing a plugin for ChatGPT that lets Playground users call zaps — and it’s easy to write a zap that triggers a Plivo action. How well can three very different platforms work together?
We thought a post that walks you through how to send messages through Plivo to ChatGPT, and from ChatGPT to recipients via Plivo, would be valuable. We start with having a Plivo action invoke ChatGPT.
→ From Plivo to ChatGPT in code →
To see how a Plivo action could trigger ChatGPT, we wanted to write a little proof-of-concept code that takes the text of any SMS message that comes in on a specific number, calls OpenAI’s API with that text, and replies to the SMS with ChatGPT’s answer.
And in the spirit of keeping things simple, we thought we’d give ChatGPT a chance to write the code for us. We gave it a prompt:
How to Use Plivo’s SMS API with ChatGPT
Have you jumped on the ChatGPT bandwagon yet? We’ve been brainstorming how OpenAI’s AI-adjacent natural language processing tool might help Plivo customers. Ideas have ranged from applications as simple as a natural language autoresponder to an application that runs a script based on voice or SMS input to a more complex use chinese overseas europe data case such as an SMS chatbot emulation. (We’d be interested in hearing about anything you’ve already built, or that you’re thinking about.)
Plivo and ChatGPT can interact in two ways — think of them as “to” and “from.” A Plivo action (such as an incoming call or text message) could be a trigger to invoke ChatGPT. For instance, someone might text a question with an #askChatGPT hashtag. Plivo could use ChatGPT APIs to pass that query to ChatGPT and return the answer to the person who initiated the query.

Another use case, for data going in the other direction, would have someone invoke something from ChatGPT that triggers a Plivo action. For instance, you could go to the OpenAI’s Playground page and ask ChatGPT to text everyone in a list a weather report for their area.
ChatGPT can’t use Plivo APIs to call Plivo directly. Any application that wants to allow ChatGPT to use its APIs has to write an OpenAI plugin — and plugins are just leaking out in beta form, so a Plivo plugin won’t be available by the time you read this.
However, Plivo partners with Zapier, an application integration tool, and Zapier is developing a plugin for ChatGPT that lets Playground users call zaps — and it’s easy to write a zap that triggers a Plivo action. How well can three very different platforms work together?
We thought a post that walks you through how to send messages through Plivo to ChatGPT, and from ChatGPT to recipients via Plivo, would be valuable. We start with having a Plivo action invoke ChatGPT.
→ From Plivo to ChatGPT in code →
To see how a Plivo action could trigger ChatGPT, we wanted to write a little proof-of-concept code that takes the text of any SMS message that comes in on a specific number, calls OpenAI’s API with that text, and replies to the SMS with ChatGPT’s answer.
And in the spirit of keeping things simple, we thought we’d give ChatGPT a chance to write the code for us. We gave it a prompt: