Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Connecting to UPS API

Lukas_rse
5 - Atom

Hi Alteryx Community,

 

this is my first post here in this community and I am hoping that somebody might be able to help. 
If the answer to my question has already been posted, please excuse me for that. I did quite some research about how to connect to APIs but I am still struggling to find a solution. So here I am.

 

My goal is to connect to the Quantum View API from UPS. As a first step, I've read the documentation, which I have also attached to this post. However, for me it was not very helpful as I do not have much coding experience and my hope was that it is easier to connect to the API with Alteryx. I do have an API key, a username and a password.

 

Here's the URL I want to connect to:
https://onlinetools.ups.com/rest/QVEvents 

 

Now, my question is how do I configure my download tool and my workflow to create a proper request based on the request example below?

Lukas_rse_0-1614672433168.png

 

I have a fair idea how the workflow should look like (please see workflow attached). Using a text input tool to enter the URL, then the download tool, the JSON parse etc. but as I said I do not know how to use the request structure above in Alteryx. 

 

I appreciate any kind of help or comment.

 

Thanks and looking forward to hear back from you.

 

Lukas

 

 

 

2 REPLIES 2
BenMoss
ACE Emeritus
ACE Emeritus

Hi!

 

Obviously an issue here is it's quite difficult to test as I don't have an account, but the way I would interpret this documentation is that you will have to make a POST request where the 'body' is formatted as in the QuantumViewRequest JSON example.

 

This body seems to include the credentials and therefor I would interpret this as meaning they aren't required as headers (as in the workflow you shared).

 

To do this we can simply add a formula tool before the download to create our body field (you will need to replace the placeholders in their yourself for the license/id/password, and it also looks like the values 'your customer context' and 'subscription name' might be placeholders too, but they mean nothing to me!).

 

BenMoss_0-1614684510563.png

 

You can then take this body and add it to your request on the PAYLOAD tab whilst also changing the action to POST.

 

This may get it working, at the very least it will get you closer to where you need to be!

 

BenMoss_1-1614684623886.png

 

Ben

 

 

Lukas_rse
5 - Atom

Hi BenMoss,

 

thanks for your answer. You definitely brought me a step closer! 

The request seems to be valid (200), but I am still getting an error because I did not change the "placeholders" marked in yellow yet. 
I guess I need to fill them out as well in order to get a response. However, I do not know where to get the information about this. Do you or anyone else here in the community knows how to retreive the information about "Customer Context", "QVEvents" or "Subscription Name"? And do I need a "TransactionReference as well or can I leave it as it is?

Lukas_rse_1-1614772926005.png

 

Lukas_rse_0-1614772886117.png

 

Thanks a lot and have a good day!

Lukas

Labels