-
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
Working with Files in Salesforce
Most data in Salesforce is stored as records in the Salesforce database for your organization (technically, Salesforce uses a multi-tenant architecture that uses a combined…
5 Features in Salesforce's Winter '24 Release for the Experience Cloud
Hey there! Exciting news ahead! The Salesforce Winter 2024 Release is bringing a bunch of cool stuff to the Salesforce Experience Cloud. All these new…
Salesforce Commerce Cloud Explained: Pricing, Hosting, Performance, Scalability
Nasdaq forecasts that 95% of purchases will be made online by 2040. Statistics also say that the global e-commerce market is expected to reach $18.89 trillion by 2027, compared to $5…
Popular Salesforce Videos
How to Choose Salesforce Career Path | How To Start a Salesforce Career
With most of the businesses using Salesforce finding access to talent to be a ‘critical challenge’, it’s no wonder so many people are choosing a…
The Decorator Pattern in Salesforce | Design Patterns | Salesforce
It attempts to solve the issue where you need temporary fields for processing (typically in Visualforce/LWC/Aura) but does not need to add these fields to…
The Significance Of Salesforce Commerce Cloud and Its Features
Commerce Cloud - an all-in-one unified e-commerce platform pronounced to be amongst the leading commerce solutions of today's time. We are a Salesforce commerce cloud…