Skip to Content
0
Jan 09, 2023 at 03:25 PM

Special Character '&' handling in OData SF API call

273 Views

Hello All,

I am getting 400 Bad request error while calling SF OData API to fetch Position Data from SuccessFactors system. Upon analyzing, I found it is because we have '&' in the code. The query is as follows:

----------------------------------------------------------

$select=code,externalName_defaultValue,effectiveStartDate,effectiveEndDate,effectiveStatus,cust_Direct_Indirect,cust_region,company,division,businessUnit,cust_BusinessUnit,costCenter,department,parentPosition/code,jobTitle,cust_LocalJobTitle,costCenterNav/description,costCenterNav/description_defaultValue,description,standardHours,lastModifiedDateTime&$expand=parentPosition,costCenterNav&$filter=code eq 'OKR_F_F&A_IC'&fromDate=1900-01-01&toDate=9999-12-31

----------------------------------------------------------

I have tried suggestions given in this link (replacing & with %26) but it did not work. Also tried using the code in the query as 'OKR_F_F&A_IC', still not working.

Has anyone come across such issue? Any suggestions will be highly appreciated. Thanks in advance!

Regards,

Faisal