Welcome to the new Box Support website. Check out all the details here on what’s changed.

How to manually connect to user endpoint in .NET?

Answered
New post

Comments

3 comments

  • jcleblanc

    Hi ,

     

    That error will generally mean that your access token that you are sending to Box is invalid. This might mean that you're not sending along the proper credentials, the scopes / settings in your app do not allow you to access the endpoints you are trying to access (e.g. users), or that the token has expired.

     

    Here's some info that should help guide you:

    1. This guide shows you how to go through the auth process with Box manually. This section of the guide will show you how to make a manual request to one of the endpoints, which you can mirror for the user request if you'd prefer not to use the .Net SDK.
    2. If you need guidance on setting up your app, this guide will help.
    3. If you need guidance on which scopes are needed, this section will help.

    Thanks,

    Jon

    0
    Comment actions Permalink
  • Worker8381

    The code I have written works for the provided example in the docs (the folders endpoint - https://api.box.com/2.0/folders/0 ), but for some reason when accessing "https://api.box.com/2.0/users" I get forbidden response, even though I know the access token is valid.

     

    Am I missing something? Is the endpoint correctly written? Thanks.

    0
    Comment actions Permalink
  • mwiller

     This may be because the GET https://api.box.com/2.0/users endpoint is only accessible by enterprise administrator accounts; that endpoint lists all the users in a given enterprise.  A better choice of endpoint for just checking if a token is valid would be GET https://api.box.com/2.0/users/me, which returns the user for whom the request is authenticated.

    0
    Comment actions Permalink

Please sign in to leave a comment.