Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Connect Knowledge Base

Definitive answers from Connect experts.

How To: Connect to the Connect REST API with Alteryx Designer

DaveF
Alteryx Alumni (Retired)
Created

How To: Use the Connect REST APIwith Designer

This guide will walk you through how to login to the Connect API and download Connect entries in JSON format. Attached to this guide is a macro you can use to download all entries listed in an input file.

Prerequisites

  • Product - Alteryx Connect 2018.2+
  • Product - Alteryx Designer

Procedure (Alteryx Designer)

  1. Log in to the REST API with your credentials. The API login endpoint is http://HOSTNAME:PORT/rest/1/login
    • In Designer, configure the URL of the Download tool to the API login endpoint.Set the HTTP Action to POST and pass your username and password in the payload data.
      DaveF_2-1573854835859.pngDaveF_3-1573854868409.png
  2. In the DownloadHeaders field of the Download tool output, make note of the JSESSIONID.
    • IMPORTANT: The DownloadData field also contains the JSESSIONID returned in the session_cookie field of the API response, but generally '=' is encoded to '\u003d'. The only value you need for the next step is JSESSIONID=xxxxxxxxxxxxxx
    • NOTE: The JSESSIONID is valid for 30 minutes
    • DaveF_5-1573855341617.png
  3. Make note of an xid from Connect. If you don't already have one, you can grab one from the URL of a Connect entry in Connect.
    • DaveF_0-1573856173436.png
  4. Make a GET request on the Get Entry API endpoint. The Get Entry API endpoint ishttp://HOSTNAME:PORT/rest/1/entry/{xid}
  5. Explore the Connect REST API documentation to learn more. Have fun!

Common Issues

Spoiler (Highlight to read)
I logged in successfully, but I get a 401 response when trying to get an xid.
Typically this occurs when you are not passing a cookie containing an active JSESSIONID in the header of the request. Refer to Step 4 above.

I logged in successfully, but I get a 400 response when trying to get an xid.
Check your values in the Download Tool Headers and ensure that the name of the variable is cookieand the value is JSESSIONID={id}
I logged in successfully, but I get a 401 response when trying to get an xid.Typically this occurs when you are not passing a cookie containing an active JSESSIONID in the header of the request. Refer to Step 4 above.I logged in successfully, but I get a 400 response when trying to get an xid.Check your values in the Download Tool Headers and ensure that the name of the variable is cookieand the value is JSESSIONID={id}

Additional Resources

Attachments
Comments
marlline141
7 - Meteor

How to get Product - Alteryx Connect 2018.2+? Dlo I need to pay extra? We currently have Alteryx Designer. Thank you!

VojtechT
Alteryx
Alteryx

Yes, Alteryx Connect is a separate product. Please reach out to your Alteryx contact for more details. 

marlline141
7 - Meteor

@VojtechT 

 

Got it. Thank you!

tangxiaofei
6 - Meteoroid

i have wanna to first get one token

 

curl --location --request POST 'https://sso.tesla.com/adfs/oauth2/token' \
--header 'User-Agent: TMS2API' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Cookie: bm_sz=4A111952D7C32157F2F6CBCBC01B264C~YAAQlFcyuBOis2SCAQAA8eCHlhBO/WARbG19r39plEiq5IR32SSouZY0s16q8lNi65H5sYa4STWRYKnafnjqbuaiCZfb102jNo5h5cZu7Fj6rWmlsVhKaQ9GYHNPUqII39dSQKqXwmYVvWEO3j70Jjjw+sezgkNXi7+l0+WmJYq5kDeUVesUhIO2exKw749Am90KG4fQGd4LE8Zio/EQOdUuHUUYydSWzqgk3sK1R34dwZ72K9tAW7Qpj1IvsLeFaF93tcQ6uoiv2vgiotYKuWcnQh3KHVULKJKcvVs94bvgwA==~3617590~3553080; _abck=A6DE974576EF4FA3492A14A354C69EE4~-1~YAAQlFcyuHuzs2SCAQAAZJaklgi865qmApzmCvJzC64Fk5ku/eO5YiwDG/9gz+TrSukFSup7FDlxhTDucvybzDtZhMAbFt2lW+l2UIKWtgAYP8qvwpJktAltXl4vhSbB5texIkGvQArUy3ewVJGxIU2BVYLjsrM1RKjM+5afJ7X0W5TAerhD9ZF4jEs2wXt9Zp6xK9KZYWndpvWkCFT467hh9heBogK5hf+a1w2aOwuypV4h1FQS0j7SG78IGKTmokn/kDRwwZGQWPUSskO7pApP39qMP9nJ5WbKqYnx1rk8CSYVaMv8AbZYvq6yN2ksHleqX8HkBR+egifVPXXGPHNgZr/KIN7kRJyoAw==~-1~-1~-1; _abck=A6DE974576EF4FA3492A14A354C69EE4~-1~YAAQxjMsF+ycB1CKAQAAFXmiUAocNFxeIhSepbsJZcLeCY0bPjOKB5mexfek6uuGl5OVY+2FLC/Q679nbjagvx0L3YTVTKHkgreI4PXPNjLveCLvRFBcrSBVR8BwkbQW+jA9WUL9tvl38wXHtFtl2KOt67XwUNrlhcyGhY1bF5c7kvr28/i1I2AKHdW2jLuaMbIJWp2uNWCm4t8JR7K4t17thTrgvUUH4Lha2cuS7ZldJDpkHyLLFztH3A0T7YyU91Zv4u2pncGeSeYZvN7JOuwMMIpzoDN4Hkj5SwIcAxlywCGGqWRoYT4pZOnds0gQfXz+EL/OWugDG+0E40+/atbxHutzQgavm9rI9Q==~-1~-1~-1' \
--data-urlencode 'client_id=55339c45-2523-4dba-8dde-2c7e61ded6df' \
--data-urlencode 'client_secret=zZ4ue8COzmD8-zb3kkiN2uCKRyCGqhfNMJDV3GB6' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'resource=Logistics_TMS'

 




then use the token to call the api 


 

 

curl --location -g --request POST 'https://logistics.tesla.com/TMS2API/shipment/rundocumenttypelogic?shipmentId={{shipmentId}}' \
--header 'accept: */*' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6ImVRRW9CeGttN2ZpcUNhaWRJaDJ4WE5ZVmVuOCJ9.eyJhdWQiOiJtaWNyb3NvZnQ6aWRlbnRpdHlzZXJ2ZXI6TG9naXN0aWNzX1RNUyIsImlzcyI6Imh0dHA6Ly9zc28udGVzbGEuY29tL2FkZnMvc2VydmljZXMvdHJ1c3QiLCJpYXQiOjE2OTMyNzU5MjgsImV4cCI6MTY5MzI3OTUyOCwiYXBwdHlwZSI6IkNvbmZpZGVudGlhbCIsImFwcGlkIjoiNTUzMzljNDUtMjUyMy00ZGJhLThkZGUtMmM3ZTYxZGVkNmRmIiwiYXV0aG1ldGhvZCI6Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vd3MvMjAwOC8wNi9pZGVudGl0eS9hdXRoZW50aWNhdG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