Skip to main content

Is there a way i can derive enterprise id from access token?

  • Jul 14, 2023 5:51 PM UTC
  • 1 reply
  • 267 views
  • Translate All

I wanted to derive enterprise id from access token. For example, in salesforce we can derive orgid from access token.

1 reply

pchristensen Box
  • Senior Staff Platform Solutions Engineer
  • Jul 17, 2023 8:55 AM UTC

Hi
There is nothing directly in the access token that will let you derive the enterprise ID. I think your best bet is to use the users/me endpoint

https://api.box.com/2.0/users/me?fields=enterprise should return something like

{
    "type": "user",
    "id": "13110169300",
    "enterprise": {
        "type": "enterprise",
        "id": "57767591",
        "name": "Peter's Demo Account"
    }
}
Translate