public with sharing class ApiCallOutUtility{
//static String endpoint = 'https://accounts.zoho.com/apiauthtoken/nb/create?SCOPE=ZohoCreator/creatorapi&EMAIL_ID=gulshangupta90@gmail.com&PASSWORD=gulshangupta90';
static String endpoint = 'https://accounts.zoho.com/apiauthtoken/create?SCOPE=ZohoCreator/creatorapi';
static String username = 'gulshangupta90@gmail.com';
static String password = 'gulshangupta1990';
public static HttpResponse getCallout(){
HttpRequest req = new HttpRequest();
req.setEndpoint(endpoint);//'https://gwt56.zendesk.com/api/v2/users/me.json');
req.setMethod('GET');
//Blob headerValue = Blob.valueOusername+ ':' +password);//'mo.usman786@gmail.com'+ ':' + 'G00gle@123');
//Blob headerValue = Blob.valueOusername+ ':' +password);//'mo.usman786@gmail.com'+ ':' + 'G00gle@123');
//system.debug('headerValue ::::::::' +headerValue);
String authorizationHeader = 'BASIC ' + username+ ':' +password;//EncodingUtil.base64Encode(headerValue);
system.debug('authorizationHeader ::::::::' +authorizationHeader);
req.setHeader('Authorization', username+ ':' +password);//'226683dbdd982b812d78d5ac5dd9edda');
req.setTimeout(60000);
Http objhttp = new Http();
if(!Test.isRunningTest()){
HttpResponse res = objhttp.send(req);
system.debug('res ::::::::' +res);
system.debug('res.getbody ::::::::' +res.getbody());
return res;
}
return null;
}
}
Debug if giving the StatusCode = 303 . please suggest is this from zoho side.