Avaya Support Forums

Avaya Support Forums (http://support.avaya.com/forums/index.php)
-   Avaya Breeze™ Collaboratory (http://support.avaya.com/forums/forumdisplay.php?f=77)
-   -   Use variable for Rest Uri in Rest Service snap-in (http://support.avaya.com/forums/showthread.php?t=11936)

ander548 09-13-2016 06:13 AM

Use variable for Rest Uri in Rest Service snap-in
If I use a variable {test} in the Rest Uri of the Rest Service snap-in (http://test.com/api?id={test}) then that seems to work as long as it LOOKS like a real Uri, but if I use a variable in a way that makes the Rest Uri appear like it's not a valid Uri ({test}), then I get an error "Rest Service: The RestUri is invalid". I would like to have the full Uri set as a property so is this possible?

aanurag 09-14-2016 07:40 AM

ED has this validation check

if (
url not starts with "http://") {
e.add("REST Service: The RestUri is invalid.");

can you work with url like


otherwise ED would have to remove the validation in code

bjliu 09-14-2016 08:13 AM

Anurag is correct about the URL validation.

Practically, the variables are supposed to be either the path variables or the parameters. They are supposed to have different values in real time for each execution.

The Web Service server address (FQDN or IP) and resource URI are supposed to be fixed for each Rest Service task as other properties of the Rest Service task , e.g. Authentication, username, password, return data schema, etc., are fixed and valid for one server and resource URI.

Even though you may use http://{test} in request URI, the Rest Task itself would not work if other properties would not work for all possible URIs.

Please refer to the Help on the Rest URI of the Call Rest Service task:
<LI class=li> Rest URI (mandatory) – The URI of the web service that is being invoked.
The path variable or the request parameter is in the curly brackets {}. Its name should contain only alphanumeric characters. For example,
  • http://host:port/your-rest-resources/{pathVar1}/{pathVar2}/...
  • http://host:port/your-rest-resources?param1={requestParam1}&param2={requestPa ram2}
  • http://host:port/your-rest-resources/ (There is no variable/parameter in the URL. There could be some in the payload.)

For a REST resource URI, for example, http://www.thomas-bayer.com/sqlrest/...est/CUSTOMER/2 or http://www.thomas-bayer.com/sqlrest/CUSTOMER/3, replace the exact customer number 1, 2, or 3 with a run-time parameter. Then, fill in the Rest URI value with http://www.thomas-bayer.com/sqlrest/CUSTOMER/{pathVar1}.

All times are GMT -7. The time now is 05:56 PM.