Skip to main content
Question

Getting an external file's information via the API

  • May 22, 2025
  • 5 replies
  • 19 views

Forum|alt.badge.img

I'm trying to get information on an external file which is collaborated with a user and I get a 404 not found.

 

I can get the information on any other file that user has access to, and I know the file exists as I can see it in the browser. What am I missing?

 

The call I'm using is:

curl "https://api.box.com/2.0/files/" -H "Authorization: Bearer " -H "As-User: "

5 replies

Forum|alt.badge.img

 what kind of authentication are you using with our API? This might restrict what files the app has access to.


Forum|alt.badge.img

What do you mean by which authentication?

 

I have an application, which is authorized for a box enterprise and I'm getting an admin token via the .NET SDK.

I've also tried getting a user token, but the results were the same.


Forum|alt.badge.img

Excellent. Are you authenticating using an OAuth 2 flow, or using a server side JWT?


Forum|alt.badge.img

 I'm using JWT. Specifically I create a BoxJWTAuth instance and call AdminClient() on it.


Forum|alt.badge.img

 ok, so by default a JWT app authenticates as a Service Account, not as a specific user. To authenticate as a user, either get a user access token, or use the As-User header.

 

When you authenticate as an actual managed Box user with access to the external file. the API call should work. By default, the Service Account would not have access to the file.