-
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
How to call Apex Method from Flow and Vice – Versa? | Salesforce Apex
Spring '23 features that align with your core admin responsibilities. Release Highlights for Admins Salesforce Admins drive innovation with four core responsibilities: User Management, Data…
Automation studio in Marketing cloud
Automation Studio - Automation Studio makes Marketing Cloud email sends, queries, imports, and more happen automatically. Automation Studio is a Salesforce Marketing Cloud application used…
What Slack and Salesforce Sales Cloud Could Do for Your Business
Today’s customers no longer prefer emails and phone calls. Customers anticipate continuous vendor assistance and participation. This means that reps must spend more time building…
Popular Salesforce Videos
Salesforce Account-Based Marketing Demo
Salesforce Account-Based Marketing is a partnership aligning Marketing, Sales, and Service around a single view of your top accounts. A partnership which reesults in long…
Get a Salesforce Developer Job in 5 Steps | For Freshers | For Admins | For Non-SFDC People
In this video, We will be talking about some tips to get your first job as a Salesforce Developer. If you are a recent graduate,…
Build customer user interfaces with the UI API in Salesforce
Table of Contents : 05:26 - Lightning Platform and the advent of UI API 09:24 - Benefits of the UI API 11:22 - Demo 22:55 -…