08-25-2022 11:26 AM
I am trying to update a documents keywords with RestSharp using the Keyword Operations documentation here: https://sdk.onbase.com/rest/OnBase/FoundationEP3/document/programmers-guide/working-with-keywords.ht...
I am not able to get past a “Bad Request” error when executing the final PUT.
The steps in this scenario:
Am I missing anything here, perhaps something obvious?
Any advice appreciated!
09-01-2022 09:02 AM
Thanks fellas: After some additional work. I am down to a specific error:
"The Date Format for Keyword Value with Keyword Type Id: 104 is incorrect"
104 is a Date type, and the JSON string looks like this:
\"typeId\":\"104\",\"values\":[{\"value\":\"11/16/2021 12:00:00 AM\"}]
That is actually the current value of the Keyword, retrieved by the previous GET, and it doesn't seem to matter how I reformat the date-time (removing the time portion, changing the date format, even just setting it empty) - the PUT always fails with this error.
For clarity, here is the Keyword Type definition for the 104:
Any thoughts?
UPDATE
>>>>
This keyword (104) has dataType:"Date"
Trying to set the value to "11/16/2021 12:00:00 AM\" fails because the string has a time-stamp.
If I strip the time-stamp off, leaving "11/16/2021", the update succeeds.
Lesson: Date and DateTime values are NOT coercive!
<<<<
08-26-2022 12:37 PM
Hi
If no one in our community can identify what is causing your “Bad Request” error, you can reach out to OnBase API Support.
To receive direct support from the Hyland API Support team, you or a member of your organization needs to have completed the OnBase API Certification Course (OCAPI). This requirement is in place to ensure that code troubleshooting be done with a person that is familiar with the OnBase APIs.
If you do not have anyone in your organization that is API Certified, then you can reach out for a Services engagement through your account manager.
Thanks!
~Alan
08-26-2022 12:59 PM
Hi
In order to determine the root cause, you would have to provide more information on the details of the issue. Bad Request is a bit of a generic error message simply stating that the HTTP request you made to the Document Management REST API endpoint is a bad request.
You can reference the Update Keywords Request Body section of the Working with Keywords programs guide of the REST API SDK ...
If you are encountering errors, then there are two places to look for the reason.
Take care.
09-01-2022 09:02 AM
Thanks fellas: After some additional work. I am down to a specific error:
"The Date Format for Keyword Value with Keyword Type Id: 104 is incorrect"
104 is a Date type, and the JSON string looks like this:
\"typeId\":\"104\",\"values\":[{\"value\":\"11/16/2021 12:00:00 AM\"}]
That is actually the current value of the Keyword, retrieved by the previous GET, and it doesn't seem to matter how I reformat the date-time (removing the time portion, changing the date format, even just setting it empty) - the PUT always fails with this error.
For clarity, here is the Keyword Type definition for the 104:
Any thoughts?
UPDATE
>>>>
This keyword (104) has dataType:"Date"
Trying to set the value to "11/16/2021 12:00:00 AM\" fails because the string has a time-stamp.
If I strip the time-stamp off, leaving "11/16/2021", the update succeeds.
Lesson: Date and DateTime values are NOT coercive!
<<<<
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.