RESTMessageV2 substitute parameter in URL
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-12-2015 08:53 PM
Hi
I use RESTMessageV2 to connect to external server. Some API calls have parameters in URL (/api/device/{deviceId}/sync').
I need to send POST and replace deviceId with a value. Unfortunately, setStringParameter() does not work and alternative method setQueryParameter will append the value to url.
Advice appreciated!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-12-2015 08:58 PM
Additional info: setStringParameter works fine if URL is in this form /api/lockDevice?deviceId=${deviceId}
changing API is not an option
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-12-2015 10:57 PM
Alexey,
I know you aren't stoked on recoding things... trust me, I feel your pain. But for what it's worth, we've been using setEndpoint: RESTMessageV2 API - ServiceNow Wiki successfully in Fuji.
I'm also curious if that setStringParameter works as you expect when using the global scope? I have found different functions on the same object based on the scope.
Happy Thursday,
--- Travis
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-13-2015 12:00 AM
Guys, feel ashamed
Missed $ in URL: api/device/{deviceId}/sync' > api/device/${deviceId}/sync'
RESTMessageV2 works fine with the parameters in URLs