Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

POST request using Alteryx (works with Postman, not with Alteryx) to Vtiger

DanielH
8 - Asteroid

Hello all,

 

I have been trying to make a POST request using Alteryx and connecting it to Vtiger.

 

In order to succesfully connect to Vtiger the following needs to happen:

- Get a challenge token and create an accessKey 

- Using that accessKey to login.

 

I have been able to generate an accesKey using Alteryx (and the GET command for the challenge token). However I am stuck on the POST request. Here is what I am doing in Postman:

 

Postman Header:

2017_11_15_16_07_07_Postman.jpg

 

Postman Body:

 2017_11_15_16_07_48_Postman.jpg

 

In the header the content-type needs to be defined

In the body the operation, username and accessKey needs to be defined.

 

In Postman using the full URL with the body doesn't work:

(e.g. http://yourwebsite.od1.vtiger.com/webservice.php?operation=login&username=username123@yoursite.com&a...)

 

Now here is what I did in Alteryx


URL: Same as you see in the postman request and encoding it.

 

Alteryx Headers:

2017-11-15 16_12_43-mRemoteNG - confCons.xml - DNZ-10-DDC.png

 

Alteryx Body:

2017-11-15 16_13_06-mRemoteNG - confCons.xml - DNZ-10-DDC.png

 

 

Using this I get a blank response on download data. The response is:

 

HTTP/1.1 302 Found
Date: Wed, 15 Nov 2017 14:58:17 GMT
Server: Apache
Location: https://yourwebsite.od1.vtiger.com/webservice.php?
Cache-Control: max-age=2592000
Expires: Fri, 15 Dec 2017 14:58:17 GMT
Content-Length: 235
Content-Type: text/html; charset=iso-8859-1

 

HTTP/1.0 500 Internal Server Error
Date: Wed, 15 Nov 2017 14:58:17 GMT
Server: Apache
Strict-Transport-Security: max-age=15768000
Cache-Control: max-age=2592000
Expires: Fri, 15 Dec 2017 14:58:17 GMT
Content-Length: 0
Connection: close
Content-Type: text/html

 

However. If I use the full URL (http://yourwebsite.od1.vtiger.com/webservice.php?operation=login&username=username123@yoursite.com&accessKey=key12345) Instead of the URL just ending in "webservice.php?" I do get a response with invalid credentials (the same response Postman will give if you try to use the full URL).

 

Can anyone spot an error or help me in the right direction? I have tried several solutions but can't get the POST request to work properly. What I do see in the response above is that the Content-Type is set as text/html while I have specified it as application/x-www-form-urlencoded

 

Solutions I have tried:

- Generating a JSON and adding this as the body

- Manually specifying the body credentials using the "add" function

 

Kind regards,

6 REPLIES 6
jrgo
14 - Magnetar

@DanielH

 

I’m not familiar with connecting to that service specifically, but looking at their documentation, you may be missing a step When constructing your “accessKey” parameter value. After you concatenated your TOKENSTRING and access key, did hash it with MD5? Alteryx does have 2 md5 functions that you can try.

 

BE0014D4-D5C9-4114-BABD-97B8CE7D5688.jpeg

 

If that doesn’t solve it, I’d recommend downloading/installing Fiddler to see what Alteryx is actually sending to the API. 

 

Hope this helps!

 

Jimmy

 

 

DanielH
8 - Asteroid

Hi @jrgo

 

Thanks for your reply. In the first part of the workflow I automated the Token + MD5 function.

 

I have tested both MD5 functions and MD5_ASCII([Challenge Token]+[Access Key]) was the correct one.

 

In order to really know if the accessKey works I have copied it from Alteryx and pasted it in Postman which produces a good response.

 

Either today or tomorrow I will get some help from a developer within our company. Should we get it working i'll post the results here.

DanielH
8 - Asteroid

Solution was found.

 

Turns out I had a http request set but I needed to make it a https request.

 

A small but often overlooked mistake. Thanks for the help!

akshatoz
7 - Meteor

I was getting the same error.  I had imported the table using lower case. I re-imported the table with upper case and it worked.

does anyone know if it is possible to force the content-type to application/json in the download tool, while making a post call?

Plamena10
6 - Meteoroid

Plamena10_0-1600867081530.png

 

Labels