Alteryx Server

Find answers, ask questions, and share expertise about Alteryx Server.
Andy Uttley, Alteryx ACE, makes music with Alteryx | Math + Music
SOLVED

API POST request to queue a job not working?

Highlighted
11 - Bolide

Using the Interactive Documentation page for the Server API on our in-house Alteryx Server (i.e. not on the public gallery), I can execute the POST request but the workflow in my private studio is not queued (i.e. it doesn't run). The same occurs when using our custom API client, but only for POST. GET requests work as expected.

 

Is there something we're missing with trying to submit a POST request? I can understand if our custom API client was the issue, but not being able to submit it from the Interactive Documentation page has me concerned. Is there something in the Server config that I could point my server admins to look at?

 

Thank you!

Highlighted
11 - Bolide

Ok, not quite a "user Id-10t" error, but close! :)

 

I guess I didn't understand that the API submission would not also show up in the log of run workflows/apps that is presented to users in the web GUI.

 

Turns out my issue was that the workflow submitted via the API request did have have access to the workflow credentials saved with the workflow from Designer, nor did it have access to the workflow credentials given to the private studio. Hmm.... okay, I'll let that go for now and see if my server team can figure that out. Right now I need to focus on getting the API client working.

Highlighted
11 - Bolide

Edit - ... did NOT have access ...

Highlighted
Alteryx Partner

Hi @c2willis 

 

I am working on a solution to trigger an app execution on our server via python using the library https://github.com/Theamazingdp/AlteryxGalleryAPI from @nick_simmons.

Like you described I can successfully post a job execution with a positive response code 200 but don't see any job kicking off in the gallery.

 

The response also shows a blank appID:

'id' = {str} '5e579538edcd313b5400487d'
'appId' = {NoneType} None
'createDate' = {str} '2020-02-27T10:08:56.5440972Z'
'status' = {str} 'Queued'
'disposition' = {str} 'None'

 

Could you explain a bit more in detail if/how you got that working in your system?

 

Highlighted
11 - Bolide

Hi @Sascha 

 

Not seeing the job results in Gallery was one of the reasons why we decided to abandon using this API. However, the main reason was this issue:

 

   https://community.alteryx.com/t5/Alteryx-Server-Ideas/Alteryx-Gallery-API-running-as-an-account/idc-...

 

Given that we had security concerns with giving one account access to every data source, we really couldn't continue.

 

However, some use cases will still be fine with this situation, so here's how I handled getting the status of a running/completed job:

 

   https://github.com/daqieq/AlteryxGalleryAPI/blob/master/ayx-cli.py

 

Basically, we needed to run this python script from the command line using a Control-M agent on a Windows server. Using argparse, it was easy to set up the command line parms to pass in the information needed by the script, include flags to switch to check Job Id (this is the 'id' in your response) status instead of submitting an App Id to run. You can use the https://<your.server.address>/gallery/api-docs/ to run the API to test this out.

 

If you do not need to run from the command line, you could make your python solution more elegant.

Highlighted
Alteryx Partner

Not seeing the job results in Gallery


Oh, I didn't realized that. Maybe because my test app was going to write to the filesystem that might have been blocked due to the link you sent (which was very helpful).

When changing the app to write a database both solutions (the one I tried as well as the ayx-cli solution) work fine.

Thank you very much for you help!