-
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
Top Features of Salesforce Lightning That Will Make Your Business Growth Lightening Fast
Are you looking for a Lightning consultant? This post is for you. Change is evident, and there's no other CRM company than Salesforce that excellently…
A 'Deep Clean' for Your Salesforce Org: Data and Metadata
As your business grows, so will your Org. And while a highly customized Salesforce Org reflects a booming business, there’s a critical difference between necessary…
SEO for Salesforce Experience Cloud Websites: Best Practices
Salesforce Experience Cloud provides a powerful platform for building engaging online spaces for various business purposes. However, it's crucial to ensure that your community is…
Popular Salesforce Videos
Pardot Segmentation Lists | Pardot Tutorial | Salesforce Lightning Tutorial
Pardot Segmentation Lists. This video will cover the following points - 1. Types of Segmentation Lists (0:16) Take a look at the different types of…
Opportunity Manager for Salesforce
Opportunity Manager for Salesforce - The first opportunity manager app that has taken the initiative of converting information and data in the form of user-friendly…
Why flow with Salesforce Flow?
Earlier when you required a custom feature in your Salesforce installation to support your business process, the only available options were to create a brand…