-
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
Building Stronger Client Relationships: Salesforce CRM in Insurance Brokerage
In the dynamic landscape of insurance brokerage, building client relationships is needed. Brokers face the challenges of managing a substantial amount of client information and…
Salesforce Product : Commerce Cloud
Salesforce Product : Commerce Cloud Commerce Cloud is one of the product among other products of Salesforce also plays a key role for making Salesforce…
Features of Salesforce Commerce Cloud: Enhancing the Shopping Experience
Commerce Cloud is a key part of the Salesforce Customer Success Platform and offers ecommerce solutions for B2C (business-to-consumer) and B2B (business-to-business) customers. That means…
Popular Salesforce Videos
How To Use Trailhead To Become A Salesforce Developer
Trailhead is the fun way to learn Salesforce. In this session we'll show you how to leverage Trailhead to quickly and easily learn Salesforce and…
Salesforce Apex Rest API Integration | Salesforce Integration
As you know Salesforce is an online cloud solution, we might be required to integrate Salesforce with some other third party tool. We have released…
How to Get Your Data In and Get Insights Out | Salesforce Essentials
Organize all your data with Salesforce Essentials. With a quick and easy import, you’ll be able to manage your business and watch it grow. Essentials…