[#85] -32000 Error

Migrated from Redmine #85 | Author: Anonymous
Status: Closed | Priority: Normal | Created: 2018-01-04


When trying to access your API from the server it seems to connect but I get this error: JSONRpcClientException {
code: -32000,
message: ‘SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (em_cyno.sheduler_comment, CONSTRAINT sheduler_comment_ibfk_1 FOREIGN KEY (sheduler_id) REFERENCES sheduler (id))’ }

It looks like everything is connecting okay through JSONRpcClient but I’m trying to add a comment to an existing booking. Perhaps this is not allowed. I need a way to add information to the booking once the booking is made. That’s why I’m using a comment. I need to be able to add a link to the booking on the calendar that contains the booking code. I can’t do ti using additionalFields because I don’t have access to the booking code before calling the book() method. Once it is called I can’t seem to add anything to the booking using the response I get from the book() call response data. This is why I’m attempting to use a comment added to the booking from the server but it’s throwing an error.

Any ideas would be helpful, thanks!

This is the javascript code I’m using on the NodeJS server:
client.setBookingComment(event.data.val().code, ${event.data.val().code}: This is a test comment generated after booking automagically)

Redmine Admin wrote:

You need to call this method with booking id not code Company administration service methods - Company administration service methods - SimplyBook.me

Thank you for this report, we will fix function to provide correct error message.

Anonymous wrote:

It looks like I was passing in the code instead of the required “id” argument. When that was corrected now I’m getting this error: JSONRpcClientException { code: -32011, message: ‘Params is not array’ }

Anonymous wrote:

Redmine Admin wrote:

You need to call this method with booking id not code Company administration service methods - Company administration service methods - SimplyBook.me

Thank you for this report, we will fix function to provide correct error message.

Thanks!

Anonymous wrote:

Please answer my second question above: It looks like I was passing in the code instead of the required “id” argument. When that was corrected now I’m getting this error: JSONRpcClientException { code: -32011, message: ‘Params is not array’ }

Redmine Admin wrote:

Are you using admin API not user API?

Anonymous wrote:

Looks like this error was coming from the getBookings() call it was expecting an array it seems. I was not entering in any arguments/params values and it was expecting an object with filter options. I’m using the admin API. You can close this. Thanks for your help!