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
Hemalatha RajendranHemalatha Rajendran 

How do I know whether it is sandbox or production ?

HI All,
I am using the streaming API via the node module nforce , however I would like to understand how can I know with the instance url and the access token whether it belongs to sandbox or production ?

Regards,
Hema
Best Answer chosen by Hemalatha Rajendran
Dev_AryaDev_Arya
Hi Hema,

The instance URL gives a pretty good idea about what kind a environment it is. To begin with:
  • CS instance is always a sanbox.
  • other possible instances AP, NA, EU are alloted geographically. 
    • AP - Asia pacific
    • NA - North America
    • EU - European (EMEA)
Alloting the instances geographically helps for faster access to the resources.

Alternatively, you can check it with the following API call
SELECT Id, InstanceName, IsSandbox, Name, OrganizationType FROM Organization
Results like this:
Org info

Hope this helps.

Cheers,
Dev

All Answers

Suraj TripathiSuraj Tripathi
Hi Rajendran,

1. Look at your URL, if you log in at test.salesforce.com it's sandbox - and will bring you to csX.salesforce.com (x replaced with a number).  While your production will log in at login.salesforce.com and bring you to naX.salesforce.com.  

2. Sandbox is not a stand-alone product, you need to have a Production SFDC org in order to get a Sandbox. 

3. When you are logged into an SB it is usually indicated by a black oval with the name of your SB org in bold white letters at the top of every page.

Hope it Helps you. Mark this answer Solved if it resolves your query.

Regards ,
Suraj
Hemalatha RajendranHemalatha Rajendran
Hi Suraj,

Thanks for your quick response. I am using an nforce module to perform the subscription to the push topic. So, all I would have handy is the instance URL  and oauth related information and not the UI. 
So would it be possible to determine just from the instance URL that it would be sandbox or production ?? Is it true that the sandbox instances (irrespective of the region) would always begin with cs 
Is there any API call that I could make to find out with the information I have (instance URL and oauth) to get to know whether it is a production or sandbox environment ?

Regards,
Hema
Dev_AryaDev_Arya
Hi Hema,

The instance URL gives a pretty good idea about what kind a environment it is. To begin with:
  • CS instance is always a sanbox.
  • other possible instances AP, NA, EU are alloted geographically. 
    • AP - Asia pacific
    • NA - North America
    • EU - European (EMEA)
Alloting the instances geographically helps for faster access to the resources.

Alternatively, you can check it with the following API call
SELECT Id, InstanceName, IsSandbox, Name, OrganizationType FROM Organization
Results like this:
Org info

Hope this helps.

Cheers,
Dev
This was selected as the best answer
Dev_AryaDev_Arya
Hi Hema,

If you got your answer, could you please mark  the question as solved.

Thanks and cheers, Dev