Start Free Trial

Alteryx Designer Desktop Discussions

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

Download tool API Authorization

DeanS
5 - Atom

HI all,

 

I am trying to connect to atlassian API via Alteryx and utilize DCM credentials/Data sources. I have collected API username and password and placed them in the DCM and set up that connection. Within the download tool -> Headers -> Authorization field I can't seem to give the right value. Things that I have tried that return either a 401 or 403 bad request / access denied error:

Authorization | "Basic " + {base64:{dcm:userName}:{dcm:password}}

Authorization | Basic {base64:{dcm:userName}:{dcm:password}}
Authorization | Basic {Base64:{dcm:userName}:{dcm:password}}

Authentication| Basic {base64:{dcm:userName}:{dcm:password}}

Authorization |  {base64:{dcm:userName}:{dcm:password}}

The 1 thing that I have done that did work is base64 encoding the value prior to putting in DCM and having the value be (this also proves I have the required permissions):
Authorization |  {dcm:userName}
This is less secure though because then the password can be seen by anyone as it is part of the userName field.

Anyone know of any solutions?

 

4 REPLIES 4
Scott_Snowman
10 - Fireball

@DeanS not sure if you've gotten any other success here, but I was searching for a solution to this and haven't found one yet. What we've done is encoded the UN/PW combination, then put the string "Basic [encoded UN:PW]" in the password section of the credentials. For the username, we use a dummy value (ours are literally "dummy").

 

Then in the Download tool, we set the Authorization header value to {dcm:password} and this successfully authenticates.

Warcry
9 - Comet

Just use the API token and your email to authenticate. Now if you don't have one, just base64 the complete string Basic email:password and copy it and paste wherever you need it. Use the Alteryx base64 tool to encode it. 

 

When I work with the jira API, I prefer to use the python tool. Its more efficient and you can work with the jql's easier than passing them through the URL. 

 

=================================

 

import requests
from requests.auth import HTTPBasicAuth
import json
 
# JIRA credentials
username = 'your-email@example.com'
api_token = 'your-api-token'
 
# JQL query
jql_query = 'project = "PROJECT" AND status = "Done"'
 
# REST API URL for search
api_url = f'{jira_url}/rest/api/2/search'
 
# Parameters
params = {
    'jql': jql_query,
    'maxResults': 10  # Adjust this as needed
}
 
# Make a GET request to the JIRA API
response = requests.get(api_url, params=params, auth=HTTPBasicAuth(username, api_token))
 
# Check if the request was successful
if response.status_code == 200:
    # Print the search results
    search_results = response.json()
    print(json.dumps(search_results, indent=2))
else:
    print(f"Failed to retrieve issues: {response.status_code} {response.text}")

 

Warcry
9 - Comet

If this solves your problem in any way, please give the thumbs up. 

Matt_D
10 - Fireball

Hi @DeanS 

 

Not sure if this helps but using the download tool, my authorization is built as below:

 

[Username] + ":" + [API Token]

Base64 Encoder

'Basic ' + [Base64_encoded]

 

Screenshot 2025-03-03 080636.png

 

Screenshot 2025-03-03 075429.png

 

https://developer.atlassian.com/cloud/jira/platform/basic-auth-for-rest-apis/

 

Labels
Top Solution Authors