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.
SOLVED

API Basic Authorization

mphillips27
7 - Meteor

Hello,

 

I am using the download tool to use a POST API but am stuck on the authorization part. I've received two errors from the application (BuildingOS)

 

DownloadData
{"errors":[{"message":"Invalid username/password."}]}

 

DownloadData
{"errors":[{"message":"username/password not properly base64 encoded."}]}

 

I've tried using an article here that gave the following directions but I don't find the part on base64 encoding very descriptive. Could someone help clarify how to use the base 64encoded tool with the download tool for basic authorization? Thanks

 

  1. Basic Authentication
    1. The implementation of this usually looks like [clientid:clientsecret] or [username : password] base 64 encoded and then prepended with "Basic" as the value for the header "Authorization".
    2. In your workflow, you can take in the client id and secret or username and password, and use the Formula tool to prepare the string for encoding. You can then use the base 64 encoder to encode the string, add “Basic” to the encoded string, and then use that as the value for an “Authorization” header in your Download tool
8 REPLIES 8
mphillips27
7 - Meteor

mphillips27_0-1618952650633.png

Thats how I've set it up

BrandonB
Alteryx
Alteryx

I have attached a workflow that takes a username and password and creates a base64 encoded authorization string. You then connect a download tool afterwards and in the "Headers" tab you check the box down at the bottom for the Authorization column. 

mphillips27
7 - Meteor

Thank you! I just changed "bearer " to "basic " and that worked.

BrandonB
Alteryx
Alteryx

Ah good catch 🙂 Bearer is for a different Oauth flow while basic is for base64 encoded basic authentication. Glad it helped!

ayush_mishra
8 - Asteroid

being new to Rest API and after watching multiple videos and reading multiple documents for last 3 days, I ended up here. No one mentioned Base64 encoding which is relevant for basic authentication. Thanks a ton!

 

do we have training videos on Rest APIs? Appreciate if you can provide some content

BrandonB
Alteryx
Alteryx

@ayush_mishra I might have what you are looking for :) 

 

A lot of people ask about how APIs work in Alteryx so I created this write up which covers all of the authentication mechanisms and is a good starting point for people to learn: https://community.alteryx.com/t5/Engine-Works/APIs-for-Beginners-Integrate-All-the-Systems/ba-p/8074... 

ayush_mishra
8 - Asteroid

thanks!

VaniS
5 - Atom

Hi,

 

I am using Alteryx to download data from an API. It is a post request. I could do the same in Postman. However, in Alteryx, I am using a text input as well as Blob for the same. However, I am getting an error

 

 HTTP/1.1 405 Method Not Allowed
allow: GET

 

Postman was successful with the same data as binary file attachment with POST.

 

The same workflow worked earlier on Alteryx too. I am wondering what changed. 

Labels