09-27-2017 05:23 AM
Hi,
I would like to know how to correctly pass data via Semantic URL (as a Triggered Task via URL)?
Here is what I did:
Edit Pipeline Properties:
I created an exampleId variable, if I wanted to pass a value of 1 to the exampleId variable:
https://elastic.snaplogic.com:443/api/1/rest/path/to/my/project/pipelineName/exampleId/1
What I have working is:
https://elastic.snaplogic.com:443/api/1/rest/path/to/my/project/pipelineName/?exampleId=1
09-29-2017 06:47 AM
exampleId should have been visible in the PATH_INFO parameter.
Anything that you add after the task url before ? is considered as Path_info.
Please test and reconfirm.
normal task url
https://elastic.snaplogic.com:443/api/1/rest/slsched/feed/<org>/Training/NaveenG/exercise1_trg_task
path info in the task url
https://elastic.snaplogic.com:443/api/1/rest/slsched/feed/<org>/Training/NaveenG/exercise1_trg_task/somepath
In the above, somepath should appear in the PATH_INFO if captured!!
09-29-2017 10:29 AM
To further clarify (from my testing), PATH_INFO is not required in the Parameters option of the Pipeline but still must be accessed via snaps using the “_” prefix. (i.e. “_PATH_INFO”)
09-29-2017 10:40 AM
can you post the screenshot what you are observing?
_PATH_INFO should be available throughout the pipeline.
10-01-2017 07:24 PM
What I did was POST to my Triggered Task URL
https://elastic.snaplogic.com:443/api/1/rest/slsched/feed/org/myproject/path/exampleData/3
I wanted to catch the key value pair of exampleData: 3 so I placed it on the pipeline parameter as exampleData
and then I used the mapper to catch and map it to my exampleData field (for my json).
the output of the PATH_INFO is correct which is “exampleData/3”.
or “examplePath”: “exampleData/3”
but if what I wanted to get was the “exampleData”: “3”. is this possible with semantic URL?
Thank you for responding.