how to provide Bearer token in webhook url

Abhinay Pothuganti
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 19, 2019

Hi

We have exposed a API to process the updates made on issue which needs an Bearer token for authentication.

I would like to call this service using webhooks . Is there any way i can provide the authentication token in the webhook URL ?

i am getting 401 error as i didnt specify the token

3 answers

1 accepted

0 votes
Answer accepted
Daniel Eads
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 4, 2019

Hi Abhinay,

Currently Jira Cloud does not support sending basic auth over webhooks. There's an open feature request here to provide that functionality: JRACLOUD-31953

If your API accepts tokens as part of the URL, you can simply tack that on at the end of the URL you've entered in Jira. As an example, your service might have an endpoint of

https://service.yourdomain.com/services/hooks/incoming

and if it supports accepting tokens via query string, you might be able to just append them on the URL:

https://service.yourdomain.com/services/hooks/incoming?token=599lm8lXxJkR82152KMzrkq8 

This depends highly on what the service at the other end is. If it's something your company has developed internally, talk to the developer responsible for it and see if they have built it in a way that will accept the token in the URL vs only accepting over a basic auth header.

Cheers,
Daniel

Abhinay Pothuganti
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 5, 2019

Hi Daniel ,

Thanks for a quick response. Below is our full requirement.

we need to trigger an API when ever any updates(comments ,status changes etc) occur on a jira issue.

The API can only support oauth(using Bearer Token ). We thought of achieving this using webhooks , but we are stuck with passing the authentication headers. If you are saying that we cant pass headers on webhooks, then is there any way we can trigger the API , for any updates on JIRA issue ?

 

From postman we just pass below header for the API

Authorization : Bearer XXXXXXXXXXXXXXXXXXXXXX

 

Thanks

Abhi

Daniel Eads
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 5, 2019

Hey Abhi,

I've gone around a bit on the Jira Cloud webhooks and confirmed there's not currently a way for a Jira Cloud webhook to send something directly to your API in the way you've described. It comes back to that JRACLOUD-31953 issue that's currently open.

However, I think there's a possibility for you to use Zapier if you don't mind some glue between Jira and your API.

image.png

Using the Zapier apps for Jira Cloud and Webhooks, you can have Zapier retrieve the issue updated event from Jira and pass it on to your API. The "Webhooks by Zapier" app includes the options you need for headers under its Custom Request event type. It's an extra layer in the process, but should get you the results you're after.

image.png

Hope that helps!
Daniel

2 votes
Darryl Lee
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 29, 2020

Sorry to revive this old thread, but Automation for Jira (now included with Cloud) *does* support Headers, and indeed you can include Basic Authentication in there, as demonstrated here:

https://community.atlassian.com/t5/Jira-articles/Automate-online-site-backups-for-Jira-and-Confluence-without/ba-p/1271317

0 votes
Darryl Lee October 29, 2020

Whoops, wrong account.

Suggest an answer

Log in or Sign up to answer