Free Trial

Alteryx Server Discussions

Find answers, ask questions, and share expertise about Alteryx Server.
SOLVED

How to Pass Answers to an Alteryx Application Through the API

JagdeeshN
12 - Quasar
12 - Quasar

Hi,

 

I have an alteryx analytical application on the gallery that expects two arguments through a text box interface tool.

 

As a first step I tried to accomplish this using the interactive API browser interface. But i get the below error:-

 

jagdeeshn_0-1591629230392.png

 

The error says it is an Unknown exception without much explanation.

 

Can you please help me with understanding why this error might be happening.

 

Best,

Jagdeesh Narayanan

7 REPLIES 7
Thableaus
17 - Castor
17 - Castor

Hi @JagdeeshN 

 

Did you send the data in a JSON format?

 

This should be the format you need to send

 

{
"questions": [
{
"name": "",
"value": ""
}
],
"priority": ""
}

 

 

Cheers,

JagdeeshN
12 - Quasar
12 - Quasar

Hi @Thableaus,

 

Thanks a lot for your response.

 

I did use the same format as part of my API call payload. But it was still throwing the same error.

 

But we were able to resolve this error.  The Swagger API documentation was wrongly documented. In the sample payload with the documentation  the priority field is defined as a String with probable values ('Low', 'Medium' and 'High').

 

When we change to a numeric value(1,2,3,4,5_ it works fine.

 

Best,

Jagdeesh Narayanan

Thableaus
17 - Castor
17 - Castor

Great @JagdeeshN, I'm glad to hear.

 

Good thing we have this in the community now so people can find the answers if they have the same questions.

 

Cheers,

aduarte
5 - Atom

I have just gone through this situation, the documentation is guiding to fullfill the priority field as string. It was failing but after adding a number worked fine:

 

aduarte_0-1632254824478.png

aduarte
5 - Atom

@JagdeeshN I need to provide 3 answers while calling an API workflow, but right now I could be able to provide only one using the notation below: 

 

aduarte_0-1632257422309.png

 

Adding other answers like the example below is not working:

 

aduarte_0-1632312662337.png

 

 

Have you gone through something similar?

 

 

mihirkananiEY
5 - Atom

Did anyone eventually find an answer to it? My workflow runs but without taking into account my input from the API.

Jon-Knepper
8 - Asteroid

Hey all!

 

I was just starting to figure out how to use the API to pass multiple questions through and thought I might add to this in case anyone comes across it.  To add multiple questions your JSON format would need to look something like this 

 

{
"questions": [
{
"name": "data1",
"value": "juykykyu"
},
{
"name": "data2",
"value": "llsdfsdfsdf"
}
],
"priority": "1"
}