How to get the BOX service accounts userid/mail to add it as a collaborator to a file?

775 Views Asked by At

I have created the service account and can see the details in admin console, I need to get the service accounts userid without going to admin console. Is there a api call for that?

2

There are 2 best solutions below

0
On

The mailid/userid will be visible to the admin in admin console. The easiest way is to contact the admin to get it.

0
On

Yes, you can use the Get Current User API call: https://developer.box.com/reference/get-users-me/

The response will contain the ID for the current user, which is normally your service account when using JWT Auth: https://developer.box.com/guides/authentication/jwt/with-sdk/

Here is a recent forum post which is similar: https://support.box.com/hc/en-us/community/posts/360049526313-How-to-create-an-email-alias-for-a-JWT-app-