cancel
Showing results for 
Search instead for 
Did you mean: 

Upload document failed

Clément_DELFORG
Confirmed Champ
Confirmed Champ

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.

1 ACCEPTED ANSWER

Justin_Carlson
Employee
Employee

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.

View answer in original post

6 REPLIES 6

Ryan_Wakefield
World-Class Innovator
World-Class Innovator

Have you verified that the document type that you are uploading to is able to be stored to through the MANAGER account? I would highly suggest double checking the document type's User Group settings.

As another suggestion, have you tried another Document Type?  Possibly a System Document?

Justin_Carlson
Employee
Employee

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.

To confirm, I performed a test using a previous keywordGUID and did in fact receive this error message.

 

{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.3",
"title": "Forbidden",
"status": 403,
"detail": "User does not have rights to create/modify hidden and/or readonly keywords",
"instance": "/documents"
}