Add Path Variables via Sandbox

I would like to know if there is a way to update the value of a path variable via API Sandbox like pm.request.url.addQueryParams().

I thought there was pm.request.url.addPathParams() but it seems I am wrong.

The URL is:

{{base_url}}/classes/:id

So I need to update the value of the :id path variable.Preformatted text

Could anyone help me with this? Thank you in advance.

I already solved, thank you.

The solution is:

var_id = pm.request.url.variables.indexOf(‘id’);
pm.request.url.variables.idx(var_id).value = 3;

1 Like