-
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
Role of a Salesforce Administrator: A Comprehensive Guide
In the realm of Salesforce, where businesses strive to optimize customer relationships and streamline operations, the role of a Salesforce Administrator emerges as a linchpin.…
Customize and Filter Related Lists in the Salesforce Lightning App Builder
Potentially one of the most significant UI changes coming to Salesforce in the latest Summer ‘22 release is the change to how we work with…
Things to Consider Before Changing Field Data Type in Salesforce
So, you want to change your field’s data type? Hold thy horses, know that there are some restrictions and considerations which should be taken care…
Popular Salesforce Videos
Wildcards in SOSL | Clauses in SOSL | Learn Salesforce Development
In this video, Shrey covered Wildcards in SOSL in Salesforce. And also you will learn: What are the different Wildcards in SOSL? What are Clauses…
Salesforce To Salesforce Integration Using REST API
Salesforce to Salesforce integration using REST API. In this video, you will learn how two Salesforce Orgs can be integrated using REST API. This tutorial…
How To Drive More Sales With Marketing Automation in 2023 | Marketing Cloud | Webinar
Are you curious about how to drive more sales for your business? Every business wants to create a market space for its business or product.…