This question already has an answer here:
Assume a client app that allows OAUTH login (client flow), such that upon login I can access REST, Tooling, Metadata APIs (etc.) I can get simple org info (id, urls) via an identity call, and I can get the org name by querying the
Organization sObject. There are some Tooling API objects (
SandboxProcess) related to sandbox creation, but the exist only in the prod org. How can I get the sandbox name, assuming I'm logged in and can call any API?
I've seen a number of questions about getting the Sandbox name via Apex (and none with simple answers), but I'm wondering if any of the APIs provide better options. I do not want to rely on hacks such as parsing user names.
Note: As noted above, I am not constrained by running in Apex. I am looking for an API based solution. This is not a duplicate of any of the several 'how do I get sandbox name in Apex' questions on the site.