08-12-2021 02:00 AM
Hello,
I'm trying to create document into OnBase by calling the url: POST /document
That return Bad Request (400) withing message: "User does not have rights to create/modify hidden and/or readonly keywords"
everything else is working (create upload space, upload file to tempfs, etc...)
I'm using manager account for test purpose & manager has access to restricted keyword.
I've try document without readonly keyword too.
here's some example of the post request:
{
"documentTypeId": "402",
"fileTypeId": "2",
"storeAsNew": true,
"documentDate": "2021-08-12T09:32:42.000Z",
"uploads": [
{
"id": "2cda143a-36af-4989-8804-9c8578d3ec35"
}
],
"keywordCollection":
{
"keywordGuid": "454a0195-1244-4f91-8c2a-0309e3344074",
"items": [
{
"keywords": [
{
"typeId": "681",
"values": [
{
"value": "MANAGER"
}
]
}
]
}
]
}
}
I've try same call without keyword with the same issue:
{
"documentTypeId": "402",
"fileTypeId": "2",
"storeAsNew": true,
"documentDate": "2021-08-12T09:32:42.000Z",
"uploads": [
{
"id": "2cda143a-36af-4989-8804-9c8578d3ec35"
}
],
"keywordCollection": {
"keywordGuid": "454a0195-1244-4f91-8c2a-0309e3344074",
"items":
[
{
"keywords": []
}
]
}
}
Thanks for any idea.
08-12-2021 07:53 AM
Another suggestion, where are you obtaining that keyword GUID from? You have to get a fresh keyword GUID with each upload by calling the default keywords endpoint (/document-types/{documentTypeId}/default-keywords). The keyword guid is document specific, so once you upload a document with it, that keyword guid is no longer valid.
I think that could cause the error message you are seeing.
08-13-2021 05:36 AM
Hello,
Thanks for your answer. That was exactly the issue.
01-21-2022 08:10 PM
Thanks for posting this. I was walking through the SDK (EP4) for archiving a document and there wasn't any mention of fetching the keyword guid from the doc type endpoint. I ended up getting that error (because I was just generating my own) and then saw this. Thanks!
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.