-
What to do in case I am getting Rest API error?
HI,
I updated my http request code but now I am getting an error "You are running an old version of the app. Please upgrade to the latest version".
here is my code of calling access token:-public string getAccessTokenNew(){
String strEndpointUrl='';
HttpRequest tokenRequest = new HttpRequest();
if(objZoomtechConfig !=null){
strEndpointUrl = objZoomtechConfig.RV_Login_URL__c;
tokenRequest.setBody('grant_type=password&client_id=zoom-dev1-client&session_reset=no&username='+objZoomtechConfig.RV_Username__c + '&password='+ objZoomtechConfig.RV_Password__c);
}
//Creating Http request objecttokenRequest.setendpoint(strEndpointUrl);
tokenRequest.setHeader('Content-Type', 'application/x-www-form-urlencoded');
tokenRequest.setmethod('POST');
Http objHttp = new Http();
HttpResponse res = objHttp.send(tokenRequest); // here response is [Status=OK, StatusCode=200]
system.debug('@@'+res.getBody()); // but here i am getting this DEBUG |@@ {"response":null,"status":"FAILURE","errorMessage":"You are running an old version of the app. Please upgrade to the latest version."}
objResponse = (responseClass)JSON.deserialize( res.getBody(),responseClass.Class);if(objResponse.response != NULL){
strAccessToken = objResponse.response.access_token;
system.debug('@@@'+strAccessToken);
objZoomtechConfig.Access_Token__c = objResponse.response.access_token;
objZoomtechConfig.Expires_In__c= Decimal.valueOf(objResponse.response.expires_in);
objZoomtechConfig.Token_Generation_Time__c = System.now();
update objZoomtechConfig;
}Please guide me, why i am getting this issue?
thanks,
Rahul Kumar
Log In to reply.
Popular Salesforce Blogs

Salesforce Dynamic Forms: Overview, Benefits, Business Cases
On a user page layout in Salesforce might be placed a monolit block of fields which makes customization impossible. The task of Dynamic Forms is…

Top 7 Salesforce Trends For 2022
Every technology we know is updating itself rapidly. If you do not keep an eye on the new additions, you might miss some amazing benefits…

User Agent Flow in Salesforce | The Developer Guide
User Agent Flow (Mobile App Integration) A simple flow for clients that don't need to include global secrets (such as distributed apps) but can be…
Popular Salesforce Videos
Automate Your App With and Without Code | Salesforce Developer Tutorial
In this video, you will learn how you can automate your business process with and without code. This video teaches you how to use a…
Salesforce Service Cloud Einstein Bots
Learn how to set up and use Einstein Bots to increase case deflection and reduce service costs through self-service. This webinar gives you a guided…
Data Archiving in Salesforce | Backup and Restore
Learn the techniques, patterns and strategies when it comes to handling data archiving, backup and restores. Watch this video and learn all about it, do…