We've Moved! Please visit our new and improved forum over at our new portal: https://portal.plumvoice.com/hc/en-us/community/topics

Variables & Rest API integration

Questions and answers about Plum Fuse+

Moderators: admin, support

Post Reply
cnoyes
Posts: 37
Joined: Wed Mar 01, 2017 3:03 pm

Variables & Rest API integration

Post by cnoyes »

Hello, thanks for providing access to Beta.

We want to construct an IVR application that calls an individual and asks them to confirm their identity. "Am I speaking with <first name> <last name>? Press 1 if Yes" - I think we figured out how to use the "+" button on the prompt to add a dynamic variable but I am wondering how we can pull this information from a REST Api?

Also, in general, if you can give us a complex example application that has REST API connectivity for variables that would be great.

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

Re: Variables & Rest API integration

Post by support »

Please take a look at this screenshot:

https://drive.google.com/open?id=0B2RqW ... 3l5ODBVWXc

In this example, we are POSTing to a REST webservice that returns JSON. The REST webservice URL is http://example.com/get_name

We are POSTing a variable named caller_id. caller_id is the ANI, or caller ID as defined in the JS module (the first first module). To access the result of a REST module that returns JSON, you should use dot notation. So in the example, we named the REST module "name." That means the results of the REST webservice will be saved to name.

If you send the JSON results { first_name: "John", last_name: "Smith" }, you can access it via name.first_name and name.last_name.

Remember, if you ever need to access variables, you need to use the "+" button.

Please let us know if anything is unclear or you have further questions, and thanks for participating in our beta!

cnoyes
Posts: 37
Joined: Wed Mar 01, 2017 3:03 pm

Re: Variables & Rest API integration

Post by cnoyes »

Thank you for your reply and the example. I don't think the caller_id is relevant in our case because this is OUTBOUND. We are placing the call. Theoretically we know who we are calling, but we want them to verify that it is them in case someone else picks up. We can't tell them about our health care program if we do not get confirmation from them that it is who we intend. In this scenario, am I correct in assuming we do not need the caller_id Javascrip execution module?

I also don't understand why in your example, the name REST module is using caller_id?

Also if the proper api call returns name, which includes name.first_name and name.last_name, how and where are these two variables stored locally in the application. For example, maybe at the very end of a long IVR application I want to say "Thank you name.first_name name.last_name"

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

Re: Variables & Rest API integration

Post by support »

We included the caller ID so we could show you how to pass a parameter using the REST module. Of course you don't have to pass caller ID to your REST webservice, you can pass any variable you'd like.

Your entire Fuse app has a flat namespace, which means any variable you declare in your app is available everywhere in the app. So if you get name.first_name and name.last_name on the first page, you can still use these variables anywhere else, including the last page.

Some notes about that though:
- If you choose to run another app, that app has its own namespace, so you'll have to specifically pass variables into the other app. But all variables are available within their own application.

- Be sure not to accidentally overwrite variables later on your application. Each variable should have a unique name, per application.

cnoyes
Posts: 37
Joined: Wed Mar 01, 2017 3:03 pm

Re: Variables & Rest API integration

Post by cnoyes »

Thank you for the prompt reply. If we schedule Outbound IVR deployment of this application using an API to a select number of individuals based on some unique identification number that is tied to their phone number... how can we reference that unique identification number that the outbound IVR call was placed to inside our application? We would pass this unique ID in the REST API call to recover the information we need for the unique prompts that follow for that unique individual. It seems that there is a CSV upload and headers for the columns are implicated as variable names. If you can give us an example that shows how this can be referenced, so we can complete a draft of our IVR application that would be fantastic.

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

Re: Variables & Rest API integration

Post by support »

You can pass along metadata with each outbound request in your contacts CSV. Your Fuse+ application will have access to that metadata during the outbound call. Please refer to here:

http://www.plumvoice.com/docs/fuse/outb ... formatting

The column names will be the variables' names in the Fuse+ app. You can do this if you queue your outbound calls via the Fuse+ website, or if you use the API.

cnoyes
Posts: 37
Joined: Wed Mar 01, 2017 3:03 pm

Re: Variables & Rest API integration

Post by cnoyes »

Thank you again for your support. On this broad topic of variables and rest API integration, one other question for you at this time - how do you recommend we add additional security when making a REST API data module call? Especially as we consider more sensitive information being returned. Just entering the https address and sending a unique ID along makes it possible for someone outside of the plum application to also target the same address with ID and get potentially sensitive information. Any recommendations, steps or guidance here?

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

Re: Variables & Rest API integration

Post by support »

There are several layers of security you can add to your REST API calls.

1. You could enable IP blocking to prevent anyone other than Plum from accessing your APIs.

2. You could use HTTP AUTH. To send HTTP headers with your REST call, you should choose to "show headers" under the REST module menu.

3.. Lastly, opting into our PCI environment is the highest security we offer. We recommend this for customers who are working with sensitive financial or medical data. We would need your webserver's IP addresses for this because we block all unknown traffic, incoming and outgoing.

cnoyes
Posts: 37
Joined: Wed Mar 01, 2017 3:03 pm

Re: Variables & Rest API integration

Post by cnoyes »

I have a follow up question on inserting a variable into the call as we are testing this out, so without API functionality at this moment. I have a simple script that asks for the member by first name. I'd like to insert that first name into the prompt. The first name is on a csv file that I will upload. How do I set up that variable in the application and on the file so that the application pulls the first name into the call from the file that I have uploaded? Thanks for your help!

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

Re: Variables & Rest API integration

Post by support »

If you have included the name as a column in your CSV, you can reference to it anywhere in your application. You don't need any additional set up.

So for example, if you had a column called "first_name" in your CSV, you could play it just like this:

https://drive.google.com/file/d/0B2RqW1 ... sp=sharing

cnoyes
Posts: 37
Joined: Wed Mar 01, 2017 3:03 pm

Re: Variables & Rest API integration

Post by cnoyes »

Thank you. That makes sense. I have that set up: "This call is for first_name​". I have a csv file: "destination","first_name","last_name" with one member calling record. When I load the file I get the message: "successfully queued 0 calls" . There is a status of failed next to my phone number on the completed call tab. Am I missing something to get that record to queue to test this? Thanks!

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

Re: Variables & Rest API integration

Post by support »

Could you PM us your Fuse+ username and a copy of the CSV we are using so we can investigate? Thanks!

cnoyes
Posts: 37
Joined: Wed Mar 01, 2017 3:03 pm

Re: Variables & Rest API integration

Post by cnoyes »

Will do. Thanks. Message coming from JoAnn.

Post Reply