You need to sign in to do that
Don't have an account?

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"}
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"}