Using REST API in C#

I’ve been trying to use the REST API with a C# application but haven’t had much success with getting past authentication. I’ve tried a couple different OAuth and OpenID libraries, but Atlassian doesn’t seem to follow normal patterns as the APIs can’t handle the exchange with the server. I’ve tried using Fiddler to capture the authentication/authorization flow but it’s hard to parse. For example, where does clientId come from? The only place I found this coming from was a bit of javascript when you hit the initial login.

The above plus seeing others using the API here makes me think I’m coming at this fundamentally incorrectly. What am I doing incorrectly?

Welcome to the Developer Community, @michael-h!

Depending on what app you want to build, you can use different authentication methods. A good starting point is this security overview documentation. Each authentication method links to their respective documentation showing code snippets on how to implement them. There’s no C# specific examples but the concepts and flow should help point you in the right approach.

Hope this helps.

Thank you for this. It appears what I was doing was heading down the OAuth 2 path when Basic would suffice. I’m trying to make a bot that curates documentation as it flows through a release process. I think this didn’t show up as the resources I’ve been looking for have been limited to .NET and there aren’t any .NET libraries or examples.

To confirm, all I need to do is create a bot user and use the Basic authorization steps to use the REST API, correct?

Yes, @michael-h, Basic auth works with REST APIs. I’d like to highlight that instead of username:password pair for authentication, it should be email:APIToken. To create API tokens, kindly check this documentation.