How to upload file by specify user

Highlighted
New Contributor

How to upload file by specify user

Hello 

 

I am use JWT app, and there are some Enterprise Users. I want to upload some file by the API, and want to specify the user (Our app lined hte user to Box user). But seems I can only use the API user to upload the file. I tried to user asUser, but it return error code 403. The Enterprise user don't have permissions to access API. 

Are there any wasy to setup the Enterprise  user permission? Or specify the user when upload file(or upload new version)

 

Thanks,

Mike

3 REPLIES 3
Highlighted
Box Employee

Re: How to upload file by specify user

Hi @MikeYang  you can use As-User or a User Access Token. See:

 

https://developer.box.com/guides/authentication/jwt/as-user/

https://developer.box.com/guides/authentication/jwt/user-access-tokens/

 

In both cases you need to set the app to have the right permissions, and then get your admin to re-authorize.


---
Developer Advocate @ Box
New Contributor

Re: How to upload file by specify user

Hi @cbetta


Thanks for the guides, it is working fine for ht Admin user. But we cannot setup all users as admin. So are there any way to manage the general user?


The situation for us are:

Our Application intergarte with Box, user can access Box files on our app, and user also login to Box and access the file. So if user update the file on our app, the file history always show the API user (serivce account) updated the file. We want it show the real user show updated it(our app user alwasy linked with box user, the user update file in our app also can login to Box).


Thanks,

Mike

Highlighted
Box Employee

Re: How to upload file by specify user

@MikeYang I am not sure I follow. You don't need to setup every user as an admin. 

 

Can you clarify for me why you can't use JWT and a user access token?


---
Developer Advocate @ Box