Inspire EMEA 2022 On-Demand is live! Watch now, and be sure to save the date for Inspire 2023 in Las Vegas next May.

Dev Space

Customize and extend the power of Alteryx with SDKs, APIs, custom tools, and more.

Python library for Alteryx Gallery API

nick_simmons
5 - Atom

Our team has just published an accessible and easy to use Python library to connect to the Alteryx Gallery API.

 

Check it out at: 

 

https://github.com/Theamazingdp/AlteryxGalleryAPI

 

 

 

Authored by David Pryor and Co-Authored by Nick Simmons and Ritu Gowlikar

15 REPLIES 15
jeffv
8 - Asteroid

Hi,

 

Yes using https://<servername>/gallery/api-docs/ works fine however changing line 31 to https and running it still comes up with the error.  I have reached out to server folks and submitted a support case.

 

Using the api-doc calls seems to work.  I can submit and see status when completed.  However, using the python approach doesn't seem to work. Hmm  not sure what I may be doing wrong.

 

Thanks,

Jeff

joshualherr
Alteryx Alumni (Retired)

We ran into a similar issue with our environments. Our dev environment does not have SSL enabled and I was able to use the Python library to make API calls to our dev environment. But when I repointed to our prod environment which does have SSL enabled, the calls were constantly failing. It took a lot of investigation to finally track down the issue. Apparently, when SSL is not enabled, the endpoint you want to target is '.../gallery/api/v1'. When SSL is enabled, you want to target the endpoint '.../api/v1' (with no /gallery/). Hope this helps!

SeanAdams
17 - Castor
17 - Castor

The Gallery API would really benefit from an end-user accessible wrapper to drop into Alteryx

Thanks for sharing this @nick_simmons 

NeilR
Alteryx Community Team
Alteryx Community Team

A lot of great Python code in the libraries mentioned in this thread, but, unless I missed it, none that explicitly supported the /admin/v1/{appId}/package/ endpoint (which is what I needed and thought I'd share below). JP used the requests_oauthlib package which really makes the code concise.

 

from requests_oauthlib import OAuth1
import requests

base_url = 'https://[your_gallery_url]:[your_port]/api/admin/v1/'
client_key = 'abc'
client_secret = 'xyz'

appId = '5d92671b826fd30b8453779e'
appName = 'Advanced Join'

url = base_url + appId +'/package/'
queryoauth = OAuth1(client_key, client_secret, signature_type='query')
request = requests.get(url, auth=queryoauth)
with open(appName + '.yxzp', 'wb') as f:
    f.write(request.content)

 

saraA
5 - Atom

How can I install PyRyx ? 

ChristopherT
Alteryx
Alteryx

Hey Nick,

 

With OAuth1 being deprecated with 22.1 was wondering if you were planning to update any of these to accommodate the change for the new versions of Alteryx. Appreciate the information. Thank you!