Account Id generation

Jump to solution
ManojBhosale
Community Member

Hi Team,

Username: manoj_bhosale1@persistent.com

we are getting account_id as 102396 by heating this endpoint "https://canvas.instructure.com/api/v1/courses"

we are trying the same id to access the "Users" object but getting below error.

{
    "status""unauthorized",
    "errors": [
        {
            "message""user not authorized to perform that action"
        }
    ]
}
 
Could you please suggest me how we can generate account_id? 
 
Labels (1)
0 Likes
1 Solution

Hi @ManojBhosale,

You can use the accounts endpoint to list accounts you have access to.  Alternatively, as shown in the example of the users call, you may be able to use the "self" identifier for the accound_id.  You can also just look at the URL of your admin pages in the UI and see the ID listed there.

One thing to confirm though is whether you're actually an admin or not, as it's not quite clear in your post.  Many API calls will only work for users who are Canvas admins.

-Chris

View solution in original post