OSC Calling Rest by Groovy - Error 400 Bad Request
Hi Guys,
I am trying to create a new resourcu user in OSC using REST POST Call.
While testing the script i am getting "JBO-57001: Invocation of service URL used in connection failed with status code 400 Bad Request.
My Groovy Script is:
def con = adf.webServices.criaUsuario // criaUsuario is name of the rest ws registered
def resourceRequest = [
LegalEntity: "TEST SA",
BusinessUnit: "TEST BU",
FirstName: "Jhon",
LastName: "Test",
Title: "MR.",
ResourceEmail: "jhon.test@teste123.com",
PersonType: "EMP",
Username: "jhon.test",
IndividualRoleCode: "SALES_MANAGER"
]
def httpHeaders=['Content-Type':'application/vnd.oracle.adf.resourceitem+json']
con.requestHTTPHeaders=httpHeaders
def user = con.Post(resourceRequest)
P.S: The same request described in code above works perfectly on POSTMAN