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

Rest API call not seeming to function

Questions and answers about Plum Fuse+

Moderators: admin, support

Post Reply
thomas.carroll
Posts: 9
Joined: Tue May 09, 2017 11:14 am

Rest API call not seeming to function

Post by thomas.carroll »

Team I am attempting to use my Rest api when i make the call i am not seeing any returns. I am using my itmgrs credentials, and the initial ivr script. you can test with 3476585 as a file number.

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

Re: Rest API call not seeming to function

Post by support »

Hello,

We looked at your call log and there is definitely data coming back from your web service (you can see it by looking at the log and clicking the + symbol next to "17 May 2017 09:14:51 AM -0600: SRI_Rest, [rest] - Success"). This will give you full debug details about what was sent and returned by your REST API. Inside of the return value you can see that it is an array of objects being returned. Therefore your data should be accessed as an array then an object. For example:

SRI_Rest[0].first_name

Your current prompt references "SRI_Rest.first_name" which is throwing an error because SRI_Rest is not an object it is an array.

thomas.carroll
Posts: 9
Joined: Tue May 09, 2017 11:14 am

Re: Rest API call not seeming to function

Post by thomas.carroll »

I have attempted to call the return data as you suggested. can you please exam what i have implemented and see why I am not receiving the expected returns.

thomas.carroll
Posts: 9
Joined: Tue May 09, 2017 11:14 am

Re: Rest API call not seeming to function

Post by thomas.carroll »

I was able to pull the Information from the return.

can you please look at my comparison on the menu page of the PmtAmt and the SRI_Rest.Balance for some reason the comparison is not returning what it should.

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

Re: Rest API call not seeming to function

Post by support »

Hello,

The issue you are experiencing is caused by the fact that both of the values you are comparing are strings. In Javascript string comparisons are considered on a character by character basis. For example, both of the following statements are true:

Code: Select all

"2" > "1"
"2" > "100"
The solution for this is to use the "parseInt()" function to cast the variables to integers before you perform the comparison. For example https://drive.google.com/open?id=0B2RqW ... XRmNy1HMnM. This will allow the comparison to work as expected by comparing the values as integers rather than strings. Let us know if you run into any other issues.

Regards,
Plum Support

Post Reply