Path parameters in Rest API

Hi,
How can i create a REST API resource that accepts a path parameter? The URL parameter appends the value as a query parameter to the api.
I am looking to do something like this:
http://demoapi.com/users/{id}
Is there a way to set the id ?
Thanks!

Hello!
You’re on the right path! The JS curly braces work in the path field as well so you can write http://demoapi.com/users/{{id}} to generate a url with the id in the path. Attached is a screenshot with an example referencing a component value.
Hope this helps! Let me know if you have any more questions.

  • Jane

Janes answer mentions a screenshot. I can’t see it.

@jane

But how if I need two variables?
Like https://host/users/{{userId}}/books/{{bookId}}

I am not able to see the image, is there any sample available for this

Any String value in a {{ }} tag should work there, so I think Jane’s example probably looked something like this:

Restcountries.eu API reference: