Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

How to get ApiToken for CreateRestClient

I'm trying to create a client to query Jira using the REST API.

I gather for CreaterestClient, basic authentication will now longer work and I need to use an apiToken.

How do I get this? I can't see anything under my user profile in Jira. Or should I be using OAuth...there is something under the profile to view OAuth tokens

I'm attempting to connect to Jira V8.13.21 (I assume this is Server)

2 answers

I'm in the same bag. The C# API has a CreateOAuthRestClient() method, but the params don't seem to correspond at all to what Jira provides on the oAuth setup page, so it's all quite confusing.

 

Jira provides a client ID and secret key, but the API expects you to pass a consumer key, consumer token (both of which are probably what jira supplies), and also an oAuth access token and oAuth token secret. There's no apparent documentation within jira on where to get those last two items.

0 votes
Craig Nodwell
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jul 26, 2022

Hi @Doug Duthie welcome to the community.  Jira Server uses either Basic authentication or OAuth 2.0.  Follow the steps for OAuth2.0 and you'll be fine.
Here's a page for your reference.

Thanks for your response.

I'm still a little confused about how to move forward. I'm developing a .NET app and trying to use the CreateRestApi method.

I can't see how CreateRestApi can use OAuth2.0 - there are only examples for basic authentication and ApiToken.

I'm assuming Basic Auth won't work - I get 500 returned if I attempt this.

So, can the .NET library work with OAuth2.0 or should I bin that and just go with a more native approach and use the OAuth client example?

Also, on the Jira side, what rights are needed to set up the application link for OAuth (just so I know who to go to in my organisation)?

 

Thanks

Grant Davis
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!
Jul 12, 2023

Hello its July 2023 and am trying to follow the instructions myself and have no idea how to proceed as well, the page link given above does not help!

I would also know how to setup the all the tokens for CreateOAuthRestClient so that it works in c#. My company has an existing app but it seems the tokens have stopped allowing all data to come thru, such as the attached images.

 

Please help so I get make the app work properly again.

Suggest an answer

Log in or Sign up to answer