Question regarding “api/ce/activity” Web-API Call

Hello Community,

  • I am trying to use api/ce/activity endpoint and it is throwing error with “Insufficient privileges” as following.
{
    "errors": [
        {
            "msg": "Insufficient privileges"
        }
    ]
}
  • I have given all the privileges to the user, and user is admin itself.
  • Can anyone help me resolve this error?

Hi,

Welcome to the community!

First, I’ll ask the dumb question: you authenticating the user to the Web API, right?

Also, you say you’ve given the user “all permissions”. Is that at the global level or directly on the project(s) in question?

 
Ann

1 Like

Hello thanks for your response,
For your first question, Authentication isn’t the issue, in fact i’m able to hit other end points like “api/permissions/search_templates”, but this one gives the above said privileges error.

for your second question. I’m not sure about the global level permissions. Can you guide me how can I Set the global level permission from UI. I’ve refered the docs but not able to find the answer for this.

Hi,

This endpoint

Requires the system administration permission, or project administration permission if component is set.

So, are you calling it for a single, specific project? Then the user will need Admin on that project. You can set it from either the global level or the project level.

 
Ann

1 Like

It’s already given for project level. and I’m not sure how to set it from global level. can you tell me how to do it or provide a link to specific part of the docs which says how to do for reference?

also does it have anything to do with paid plan or free plan? let me know if it is so that we can make decision based on that.

Hi,

The API performance doesn’t have anything to do with the edition you’re on.

Again, how are you calling this? What arguments are you passing? Is this a project-specific call, or a general one?

 
Ann

1 Like

Currently for POC I’m calling this from postman with bearer token generated. no other argument is being passed. and we want a general call not project specific.

Also can you let me know how to change global permission? I’ve gone through entire setup but only been able to find project level permission

Hi,

To grant global permissions it’s Administration → Security → Global Permissions.

 
HTH,
Ann

1 Like

Just to make sure we’re on same page. is this the path we’re talking about since I don’t see any security option here. and also in this same path all the permissions are already given as you can see in screen shot

Hi,

It appears that we weren’t on the same page. You filed this in the SonarQube category, so I gave you a path based on that. I’m going to move the thread.

Meanwhile, it appears you’ve found the right part of the UI anyway.

 
Ann

1 Like

even after giving all the permissions, I’m facing the same issue of “privilage insufficient”.

Hi,

I’ve been responding to this thread in a SonarQube context. Even after correcting the category yesterday, the implications of the change didn’t fully hit me until just now.

You’ve said you’re not providing any arguments to the call. Which means your call attempts to query SonarCloud at large - every project and organization. No, you don’t have permissions for that.

Looking at the API docs on SonarCloud, I don’t see an organization parameter, which means you’re going to need to narrow your call by specifying the project you’d like the data on.

 
HTH,
Ann

1 Like

Hello Ann,

We were able to resolve the issue and move ahead in our task. You were a huge help. Thank you so much for your time.

TYSM,
Jinish and Team

1 Like