You need to sign in to do that
Don't have an account?
PIYUSH KUMAR
can I find subdomain through CallOut on the basic of Api key:-.
Basically I want to fetch out the subdomain of my end point 'https://app.chargify.com' using Api key. I am able to fetch out subdomins on the basic of user name and password but now want to fetch out on the basic of api key...
public class productFechOut { public static void basicAuthCallout(){ HttpRequest req = new HttpRequest(); String username = 'hPzrfBXboQVmTZ0v63Z'; String password = '3Z'; Blob headerValue = Blob.valueOf(username + ':' + password); String authorizationHeader = 'BASIC ' + EncodingUtil.base64Encode(headerValue); req.setHeader('Authorization', authorizationHeader); req.setHeader('Content-Type', 'application/json'); req.setEndpoint('https://app.chargify.com'); req.setMethod('GET'); Http http = new Http(); HTTPResponse res = http.send(req); System.debug('res123'+res.getBody()); } }