How to pass the first webservice response results value to second webservice request URL? | XM Community
Skip to main content

Hi Experts,
I am new to qualtrics and exploring the API and webservice action and currently facing an issue. The scenario here is I have created 2 web service tasks under actions, the first webservice is an API call to "Get the distributionID of the survey", the response returns the distributionId. I am using this distributionId value in second webservice to retrieve generated links. First webservice works fine, but the issue is for the second webservice distributionId value is not being sent as expected.
In first webservice, have added the response result.id which is the distributionId value under piped Text
WS_PipedText.JPG
In second webservice, have referred to the result.id response in API url
WS_2.jpgBut second webservice fails, with the following
Task Output{
"name": "ACTIONS.ERROR_CODES.INTERNAL_ERROR",
"message": "we need a path",
"needRetry": true
}

I am not clear what path is it referring here. Am I missing anything?
Any guidance and pointers will be really helpful on how to pass the first webservice response results value to second webservice request URL? Also how can we pass the first webservice selected response results fields as input parameters to second webservice request? Is this possible to achieve from Actions tab?
Thanks!

I don't think you can pipe results from one task to another task.
You can create your own web service that does both API calls and uses the results from the first API call to construct the url for the second API call. Your action task would run the web service you create.


Thanks TomG . So ideally I need to create my own REST webservice call. Any directions or best practices that you would like to suggest on how can I start with creation of own webservice call.
Also why is it that we can't achieve the pipe results from one task to another. The below link step 18 mentions "add JSON paths for referencing the results of your web service in piped text, to be used with other tasks in your action" . I can access these piped text label defined in my first webservice task in my second webservice task but not sure value is being passed as I get the "message": "we need a path", for my second webservice as failure reason. So I am little unclear of what exactly is done by this piped Text section?
Web Service TaskWS_PipedDoc.JPG


Maybe I'm miss reading the comments but you can do a OAuth2 authentication, need 2 Webservices in the work flow 1st gets the token, 2nd authenticates it using piped text from the previous task

Screen Shot 2022-01-11 at 11.25.57 AM.pngScreen Shot 2022-01-11 at 11.26.26 AM.png


@Adam How did you get this menu ? Do I need to type anything to get this menu of tasks and piped text IDs ?


WS_2.jpg

@Neha Tank In the old UI {a} did looks like a clickable button. Don’t know why they change it


Leave a Reply