How to find whether Salesforce instance is Up and Active?

How to find whether Salesforce instance is Up and Active?

To find whether Salesforce instance is Up and Active using API, then use https://api.status.salesforce.com endpoint.

Remote Site Settings:

Sample Apex Code:

String endpoint = 'https://api.status.salesforce.com/v1/instances/NA100/status';
HTTP h = new HTTP();
HTTPRequest req = new HTTPRequest();
req.setEndPoint( endpoint );
req.setMethod( 'GET');
HTTPResponse res = h.send( req );
Map < String, Object > fullMap = ( Map < String, Object > )JSON.deserializeUntyped( res.getBody() );
System.debug( 'Key is ' + fullMap.get( 'key' ) );
System.debug( 'Environment is ' + fullMap.get( 'environment' ) );
System.debug( 'Status is ' + fullMap.get( 'status' ) );
System.debug( 'Is Status Active? ' + fullMap.get( 'isActive' ) );
System.debug( 'Release Number  is ' + fullMap.get( 'releaseNumber' ) );

Leave a Reply