Calling REST API With DynamicQueryParams Is Throwing 400 Bad Request

(Doc ID 2310459.1)

Last updated on SEPTEMBER 24, 2017

Applies to:

Oracle Fusion Sales Cloud Service - Version 11.12.1.0.0 and later
Information in this document applies to any platform.

Symptoms

On : 11.12.1.0.0 version, CX Integration

Calling REST API with dynamicQueryParams Is Throwing 400 Bad Request


Trying to execute this code
/********************/
def conn =adf.webServices.Contact_Query;
def emailCollection = Email;
def mail
try
{
def httpHeaders=['Content-Type':'application/vnd.oracle.adf.resourceitem+json']
httpHeaders = httpHeaders + ['Accept-Language':'es-ES'];
conn.requestHTTPHeaders=httpHeaders;

if(emailCollection.hasNext())
{
def emailRec = emailCollection.next();
mail = emailRec.EmailAddress;
}
println("PreferredContactMail: "+PreferredContactEmail);
println("E-Mail: "+mail);
def queryParams = ['finder':'PrimaryKey;emails.address="ABC@yahoo.com"']
conn.dynamicQueryParams = queryParams

  
def contacts = conn.GET();

if (contacts==null)
{
throw new oracle.jbo.ValidationException("No contacts found")
return false;
}
else
{
def output = contacts.items?.first().lookupName;
println("PartyId of the New contact is: " + output )

return true;
}

}catch(Exception e){
throw new oracle.jbo.ValidationException("Error:"+e)
}
/*****************/


ERROR
-----------------------
Error:oracle.binding.expr.ServiceInvocationException: JBO-29000: Unexpected exception caught: oracle.adf.model.connection.rest.exception.RestConnectionException, msg=JBO-57001: Invocation of service URL used in connection failed with status code 400 Bad Request.




STEPS
-----------------------
The issue can be reproduced at will with the following steps:
1. Login to Sales Cloud
2. Navigate to Contacts tile
3. Click Create Contact
4. Fill in the details -> Save and Close
5. Getting an error

BUSINESS IMPACT
-----------------------
The issue has the following business impact:
Due to this issue, users cannot Save Contacts

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms