function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
webdevwebdev 

How to find OrgID using API call?

Will describeMetadataResult method help?

Thanks!
Tran ManTran Man
You can find it on userInfo after you make the call to login.

sfdcfoxsfdcfox
If you are exempt from the sharing model (you have View All Data), you can also call the following:
 
Code:
Select Id From Organization

Of course, getUserInfo works just fine, especially if you're not outside the (sharing) box.