« Back to full topics list

I need to replicate functionality from an existing api that has a dynamic url. It grabs a device id. How can I do this with scriptr? Can I convert part of a url to params somehow?

Marked as spam
Posted by - Asked on July 13, 2017 1:19 pm - 20 views

1 Replies

Private reply

Hi Stefan,

I believe you are describing a URL of the form http://api.scriptrapps.io/myScript/deviceId. If this is the case, you can definitely do that from myScript where you can grab the deviceId using request.pathInfo.

Check out the Creating RESTful APIs with Scriptr.io section of the documentation for more on this (https://www.scriptr.io/documentation#documentation-restfulapisCreatingRESTfulAPIswithScriptr.io).

Hope this helps,

Julien Mrad
Scriptr.io Support

Marked as spam
Posted by - Replied on July 13, 2017 2:59 pm

This is exactly what I’m looking for Julien. Thank you.

( at July 13, 2017 2:00 pm)