+ Start a Discussion
Ram ChaturvediRam Chaturvedi 

I am getting a error when requesting for refresh token. {"error_description":"expired access/refresh token","error":"invalid_grant"}

HttpRequest request =new HttpRequest(); 
             request.setEndpoint('https://login.salesforce.com/services/oauth2/token');
             request.setMethod('POST');            
             request.setBody('grant_type=refresh_token&client_id='+Cid+'&client_secret='+ScrId+'&refresh_token='+OldAccessToken+'');

             Http htp = new Http();
             HTTPResponse res = htp.send(request);
      NewAccessToken =  res.getBody();  

responce:        {"error_description":"expired access/refresh token","error":"invalid_grant"}