This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | public class MetadataUtil { | |
| private static final Integer METADATA_API_VERSION = | |
| Integer.valueOf(new MetadataService.MetadataPort().endpoint_x.substringAfterLast('/')); | |
| public static String fetchUserSessionId(){ | |
| String sessionId = ''; | |
| PageReference reportPage = Page.SessionId; | |
| String vfContent = reportPage.getContent().toString(); | |
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | if(pm.response.code === 200 || pm.response.code === 201){ | |
| var responseBody = pm.response.json(); | |
| pm.environment.set('access_token', responseBody.access_token); | |
| pm.environment.set('refresh_token', responseBody.refresh_token); | |
| pm.environment.set('scope', responseBody.scope); | |
| pm.environment.set('id_token', responseBody.id_token); | |
| pm.environment.set('instance_url', responseBody.instance_url); | |
| pm.environment.set('token_type', responseBody.token_type); |