Monday 22 February 2016

UNSUPPORTED_CLIENT Callout Error in Salesforce

Error:

[{"message":"HTTPS Required","errorCode":"UNSUPPORTED_CLIENT"}]

Solution:

Unsupported_Client error occurs when making callout from salesforce using http web server instead of https. There are two possible solutions to fix this issue,

Option 1:

You can change the security setting in your Salesforce account to allow API communication over HTTP as follows:
1. Log into Salesforce.com.
2. Click Setup, click Security Controls, and then click Session Settings.
3. Uncheck the option labeled Require secure connections (HTTPS).



Note: To change to HTTP, you need to contact salesforce.com

Option 2:


  1. HttpRequest req = new HttpRequest();
  2. req.setHeader('Authorization''Bearer ' + UserInfo.getSessionID());
  3. req.setHeader('Content-Type''application/json');
  4. req.setEndpoint('https://na15.salesforce.com/services/data/v36.0/tooling/sobjects/');
  5. req.setMethod('GET');

End point address should be https.

No comments:

Post a Comment

Activities: Assign Tasks to a Queue Salesforce Lightning

Salesforce announced to assign Tasks to a Queue beginning from Spring'20 release. How does it work? In Setup, enter Queues in th...