c.elkharoussi | 2023-11-23 22:31:37 UTC | #1
Hello everyone,
I m trying to develop a custom client application integration , and i need to PUT and Create a row in dataTable.
When i try to put, i have an error :
{ "message": "the event input has no valid 'item' element.", "code": "flows.datatables.syntax.error", "status": 400, "messageParams": {}, "contextId": "81a78a0a-d4f3-4e8d-aeef-5311fccb1622", "details": [], "errors": [] }
this is my syntaxe of the function that i use :
function updateRowCalendarExcept(XXX, XXX, XXX, XXX, XXX, XXX){
let datatableId = "XXX"; // String | id of datatable FERMETURE_EXCEPTIONNELLE |
let rowId = "XXX"; // String | the key for the row |
let opts = { "Calendrier Fermeture Exceptionnel": "XXX", "Active Message Exceptionnel Prompt": "XXX", "Message Fermeture Exceptionnel": "XXX", "Date Début": "XXX", "Date Fin": "XXX", "Active Message Exceptionnel TTS": "XXX", "Message Fermeture Exceptionnel TTS": "XXX", "key": "XXX" };
// Update a row entry apiInstance.putFlowsDatatableRow(datatableId, rowId, opts) .then((data) => { console.log(putFlowsDatatableRow success! data: ${JSON.stringify(data, null, 2)}); }) .catch((err) => { // if not key not existing, Create New Row In Datatable createNewRowCalendarExcept(nameService, activePrompt, activeTTS, startDate, endDate, message); console.log("There was a failure calling putFlowsDatatableRow"); console.error(err); }); }
For information : when i try to use the PostAPI, it works without a problem.
Hope you can get me some help :)
Thanks in advance for any help provided and have a great day everyone!!
Jerome.Saint-Marc | 2023-11-24 09:20:01 UTC | #2
Hello,
The problem comes from your opts parameter. The putFlowsDatatableRow needs an object with top level attribute = "body". It shows up in the Javascript SDK Invocations section of this endpoint.
let opts = {
"body": {
"Calendrier Fermeture Exceptionnel": "XXX",
"Active Message Exceptionnel Prompt": "XXX",
"Message Fermeture Exceptionnel": "XXX",
"Date Début": "XXX",
"Date Fin": "XXX",
"Active Message Exceptionnel TTS": "XXX",
"Message Fermeture Exceptionnel TTS": "XXX",
"key": "XXX"
}
};
Regards,
c.elkharoussi | 2023-11-24 09:39:16 UTC | #3
Thank you @Jerome.Saint-Marc ! it works :)
I m new in working with the API Genesys Cloud :)
system | 2023-12-25 09:40:04 UTC | #4
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
This post was migrated from the old Developer Forum.
ref: 23317