Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Audit User Activity via API

Jonathan Buys November 19, 2019

I'd like to generate reports that combine user activity from BitBucket, AWS, and a few other services. How can I get a users weekly activity through the BitBucket API? 

I've read through the documentation on the v2 REST APIs, but even this simple example is returning a 401 error: 

$ curl --user buserbb:2934dfad https://api.bitbucket.org/2.0/user/repositories

I'm using an "app password" in my request. Our account is using SSO integrated with Microsoft O365, could that be causing the issue? 

1 answer

1 accepted

0 votes
Answer accepted
Daniil Penkin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 19, 2019

Hello @Jonathan Buys,

Thanks for reaching out.

Unfortunately, there's no user activity audit feature in Bitbucket.

As for the endpoint you mentioned, our docs seem wrong. There's no such endpoint. If you are getting 401 back, the username and password provided are invalid. If you pass the right credentials, you'll get 404 back.

I guess the endpoint that was meant to be in that doc is this one:

https://api.bitbucket.org/2.0/user/permissions/repositories

Or maybe this one (the description is a bit ambiguous):

https://api.bitbucket.org/2.0/repositories/<user>

I'll get that doc issue fixed.

I'm using an "app password" in my request. Our account is using SSO integrated with Microsoft O365, could that be causing the issue?

You're doing it right. When integrated with SSO, you can't use your regular credentials, app password or OAuth consumer are the ways to go. But if you're still getting 401 back, you seem have misspelled your username and/or password.

Hope this helps.

Cheers,
Daniil

Jonathan Buys November 25, 2019

Ok, thanks.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events