on 01-21-2021 03:40 AM - edited on 04-18-2023 10:46 AM by TylerNg
Use Postman to interact with the Gallery API. Postman is a useful tool for making and troubleshooting API requests. The following article walks you through how to set up and use Postman to access the various Gallery API endpoints.
Note: This article only applies to the Server Legacy OAuth 1.0 API, which is available up until Server 2021.4. To use Postman with the newer Server OAuth 2.0 API, see this Help page .
Attached is a Postman Collection, which is a group of API calls for all the Gallery endpoints. You will also install a Postman Environment. An environment is a set of key-value pairs. The key represents the name of the variable.
While working with APIs, you often need different setups for your local machine, the development server, or the production API. Postman let you customize requests using variables so you can easily switch between different setups without changing your requests.
1. Download the Postman_GalleryAPI.zip file or Postman_GalleryAPI_202X_X.zip attached and unzip.
2. Open Postman.
3. Go to File > Import and import both the Alteryx Gallery API.postman_collection.json and Alteryx Gallery API.postman_environment.json files (if you've previously imported this Environment file, you don't need to import again - you only need a new version if additional parameters are added).
In the Postman sidebar you should now see the following collection:
The Environment is now available in the top right:
You will need to update the Environment values with your credentials/values.
1. Click the cog icon next to the Environment drop-down in the top right:
2. Click on the name of the environment:
3. Edit the Current Values column with the information from your Gallery
Variable | This information can be found here |
URL | Base URL |
TargetURL | (Optional) - Base URL of the Gallery you are migrating workflows too (only for Migration endpoints) |
User API Key | From Settings > Keys > Admin API > Key in Alteryx Gallery |
User API Secret | From Settings > Keys > Admin API > Secret in Alteryx Gallery |
Subscription API Key | From Settings > Keys > Private Studio API > Key in Alteryx Gallery |
Subscription API Secret | From Settings > Keys > Private Studio API > Secret in Alteryx Gallery |
appId |
(Optional) - The ID of the app to execute. This is the string of characters starting with 5xx at the end of the URL for your app/workflow on the Gallery
|
jobId | (Optional) - This is retrieved using this endpoint from the Subscription API:
|
OutputId |
(Optional) - This is retrieved using this endpoint from the Subscription API:
|
Moving forward, all these variables can be used when building any part of your Postman query. Variables show in orange:{{User API Key}}
You should now be all set up to call any of the endpoints available in the Collection. To make a call:
1. In the sidebar, drop down into the Alteryx Gallery API collection and double-click one of the Requests. It will open in a new tab.
2. Confirm that the Authorization sub-tab is set up correctly. Please see the "Edit the Authentication mechanism" section below for more details.
3. Click the Send button to make your request. The response can be viewed at the bottom of the request tab:
By default, the Collection is already set up to authorize appropriately. However, if you make changes please reference this section. If you are creating a new request against the Gallery, in the Authorization tab on a Request you will need to set the Type to "OAuth 1.0" and then enter the appropriate Key and Secret for either the Admin or Subscription endpoints. See below for how to use the variables to do this, including a screenshot of the appropriate configuration.
Alternatively, you can set the Authorization at the Folder level, and set the individual requests to the type 'Inherit auth from parent'. This is how the default setup is configured:
{ "data": null, "exceptionName": "UnauthorizedException", "innerExceptionMessage": "", "message": "The provided signature(oauth_signature) is invalid." }
{ "data": null, "exceptionName": "BadRequestException", "innerExceptionMessage": "", "message": "Must specify subscription key (oauth_consumer_key parameter)." }