I have a requirement to pass parameters which acts as filters in the rest API callout from salesforce. The url is

https://pmobilet.electra.co.il/odata/Priority/tabula.ini/elecisr/ELC_SMAXPART?$filter= ELC_ELCID eq 'elecisr_69883'.

I added https://pmobilet.electra.co.il to the remote sites. This is working in postman but not in the org.

Below is my code.

HTTPRequest req = new HTTPRequest();
    req.setEndpoint('https://pmobilet.electra.co.il/odata/Priority/tabula.ini/' + ODATA_Value + '/ELC_SMAXPART?$filter= ELC_ELCID eq%20%27'  + Product_Electra_ID +'%27');

String authorizationHeader = 'BASIC ' + EncodingUtil.base64Encode(headerValue);

req.setHeader('Authorization', authorizationHeader);


I am getting a

bad request 400 error.

Anything I am missing? TIA

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.