VoiceGuide IVR Software Main Page
Jump to content

converting result to string

Recommended Posts

Hi , 

I have result from RESTApi GET  call  like 

{{"today":{"times":{"id":"Persembe_0","checked":true,"time":"09:00"}}}}

I am trying to pass  "time":"09:00" to next RESTApi  POST as JSON.

But if I try to send  POST data like 
 

{"rzv":{
"username":$RV[TC_NO_SES],
"time" :$RV[CheckTC_today_times_time],
"type" : "today"
}
}

it replace 

"time" :$RV[CheckTC_today_times_time]  to =>  "time" :09:00 

 and it give JSON parse error. Because 09:00 not a string. 

How can I convert it to String?  I tried adding  

"time" :$RV[CheckTC_today_times_time_string]

but it gave me not found error like below


225249.359   8   2   2      3       rv    replace start 
------------------------------
{"rzv":{
"username":$RV[TC_NO_SES],
"time" :$RV[CheckTC_today_times_time_string],
"type" : "today"
}
}
------------------------------
225249.359   8   2   2      3       rv    dbg   rv_retrieve did not find [CheckTC_today_times_time_string]
225249.359   8   2   2      3       rv    replace end   
------------------------------
{"rzv":{
"username":11111111111,
"time" :,
"type" : "today"
}
}
------------------------------

 

 

 

 

Share this post


Link to post

Please try using:

{"rzv":{
"username":"$RV[TC_NO_SES]",
"time" : "$RV[CheckTC_today_times_time]",
"type" : "today"
}
}

Note the double quotes added around the $RV placeholders.

The $RVs are replaced with the text the contain only. If you would like to have quotes etc. around the replaced value then those need to be included by you in the template.

 

Also, if a $RV is not defined then it is replaced with an empty string. The $RV[CheckTC_today_times_time_string] was most likely not defined. The Web Service module does not create "_string" etc. subtyped versions of $RVs.

The vgEngine trace shows all the $RVs created during the call by each of the modules in the script. The vgEngine trace is in VoiceGuide's \log\ subdirectory.

Please let us know if you have any questions,

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×