Expose Rest API:
When I am sending multiple values in a json format as request in the post man i am getting below error
{
"Errors": ["Failed to parse JSON request content."],
"StatusCode": 400
}
Can anyone help me? If possible please share any example oml
Thanks in advance!
HI Narendran,
Please find the attached updated OML that accept list of employee as a input.
Thank You Vinod it's Working
Hi Narendran,
Could you please share OML or API URL and JSON?
Thanks
Vinod
Hi Vinod,
I have attached the OML and sample json request,please let me know what i am doing wrong
[
"Name": "Ram",
"Email": "ram@abc.com",
"MobileNumber": "9067432189",
"Location": "India"
},
"Name": "james",
"Email": "james@abc.com",
"MobileNumber": "8765342189",
]
Your API parameter "EmployeeAPI" is a "EmployeeAPI" type and you are passing list in JSON.
You need to pass below JSON in request body-
I want to pass list in json the ultimate goal is to send multiple request
So basically your api don't support array of employee, it support only single record at a time.
Regards
yes i need multiple record to be send out
So in this case, your API must accept array of employee records in request instead of single employee record. For this you need to make the changes in the API.
Or you can call the API in a loop, but it will not be much efficient and not a good idea from performance point of view.
Right now, API end point is createEmployee, so seems its prepared to accept only single employee record.
Hi Vikas,
If possible can you send me a sample oml file which accept mutiple array of employee
You must make changes in API to accept the list of employee. This is the only way to send list/multiple values in the API.