Page 1 of 1

REST and returned values

Posted: Tue Mar 21, 2017 6:51 am
by dlanders
Hi,

Thanks for the opportunity to beta fuse+.

We are trying to do a simple proof of concept with a quick REST integration. It all seems to be going ok until we try to use the returned values from our endpoint. For now it is just a hard coded JSON string with a valid flag and an account balance. When I try to use the acctBal variable it hangs up. I have followed a couple examples but I cannot seem to get the returned value to be usable. Can you point us in the right direction?

Thanks!
Doug

Re: REST and returned values

Posted: Tue Mar 21, 2017 11:37 am
by support
Hi Doug,

When working with REST webservices, we find using the logs the easiest way to figure out what's going on. If you click on "Logs" on the top menu, you will see a list of all past phone calls. If you click through, you can see the call's details.

For each webservice call, you can click the + icon to see even more details, like the request that was sent, and the raw response.

We took a look at your call log, and it looks like your acctBal variable is actually wrapped in an array. So you should either modify your REST webservice to directly return the object, without the additional array, or you can refer to acctBal like result_variable[0].acctBal. However, we recommend the first option for cleaner variables names.

Re: REST and returned values

Posted: Wed Mar 22, 2017 6:39 am
by dlanders
Got it! Thanks for the quick response!