Skip to main content

How to Use Postman

You can use Postman to test Server API V3.

Prerequisites:

  • You must have Postman installed. Postman is available at go.postman.co/home.

  • You must have an API Key and an API Secret in order to test Server API in Postman. Go to the User Roles and Permissions help page for more information.

Add API to Postman

To test Server API, import it to Postman.

  • First, you need to obtain the link you will use to import Server API V3. To find this link, go to the Server UI, select the question mark icon in the upper right corner and then select API Documentation. This will take you to the API V3 Swagger page.

  • Note the address of the API documentation you find on the Swagger page.

    Note the address of the API documentation you find on the Swagger page. 
  1. In Postman go to Collections, then select Import.

  2. Select Link and enter the Server API URL you noted in step 2, then select Continue.

  3. Now you can see Alteryx Server API V3 under the Collections tab.

Set Up Authorization

To be able to send your requests, you must set up your authorization in Postman.

  • Go to Collections and select Alteryx Server API V3.

  • In the Auth tab, select OAuth 2.0 as Type.

  • Set up the Current Token as follows:

    AD273A073BE2399E360B94B3F9EB79C6.png
  1. In the Configure New Token section, set up the following:

    1. Optionally, enter a Token Name.

    2. In Grant Type select Client Credentials.

    3. In Access Token URL,enter the endpoint for the authentication server. To find out the endpoint, go to Swagger and search for the Token URL. For more information visit the How to Authenticate section on the API Configuration and Authorization help page.Server API Configuration and Authorization

      Find the Token URL in Swagger.

      Example of the final token configuration:

      How the API authorization looks like in Postman.
    4. In Client ID, enter the API Access Key you find under My Profile in the Server UI.

    5. In Client Secret, enter the API Secret Key you find under My Profile in the Server UI.

    6. In Client Authentication, select Send as Basic Auth header.

  2. Select Get New Access Token.

Set Up Environment

Don't forget to set up the same values in Environment.

  1. Select the eye icon in the upper right corner, then select Add for Environment.

  2. Enter the name of your environment.

  3. Enter the same baseUrl, API Key, and API secret as you did in step 4 of the Set Up Authorization section.

  4. Enter the URL for your environment. You can find it in Alteryx System Settings as the Base Address. See step 4 of the Set Up Authorization section.

  5. Select Save.

Send Requests

You can test Server API in Postman–authorize your requests, send them, or explore different code types of your requests.

Example

Let’s say you would like to retrieve a list of assets a user owns.

  1. First, you need to know the specific user id.

    1. Go to Collections, then select Alteryx Server API V3.

    2. Select users, then select GET Search for User records.

    3. In the params tab, you can use the parameters to search in all user records.

    4. To send the request, select Send, and you will get results based on the parameters you entered.

    5. In the results, copy the id of a user for which you want to retrieve a list of assets.

  2. In another tab open another request. Go to users, then select {id}.

  3. Select GET Retrieve a full list of assets that a user owns. Enter the user id you get from the previous request to get the list of assets for this user.

EF76F0DE8E6C3302DC8217A5E26730F2.png

Note

When you send a request via Postman, don't forget to authorize it. To authorize your request, you have 2 options:

  • In Type, select OAuth2, then select 1 of your available tokens.

  • In Type, select Inherit auth from parent. The authorization you configured for the whole collection will be used.