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

Hello,

 

Thanks for your answer. That was exactly the issue. 

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!