Adding Classification to a Document using REST API

Hi,

Is there a way to add a classification (non-Records Management related) to a document using REST API in Content Server?

Thank you,

Ramesh Sundaresan.

Comments

  • Appu Nair
    Appu Nair Member
    edited February 4, 2021 #2

    Here's an example of me adding a non-RM Classification its ID is 23114 to a Folder whose nodeID is 74143.Postman HTTP code will show like this

    We are posting something and you will need some code/http client to fabricate a post(JQuery,XHR,OKHTTP,UniRest etc)

    POST /otcs/cs.exe/api/v1/nodes/74143/classifications HTTP/1.1

    Host : myserver.mydomain.com

    otdsticket: *OTDSSSO*THIS IS A HUGE STRING TRUNCATED BY ME*

    Content-Length: 149

    Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW

    ----WebKitFormBoundary7MA4YWxkTrZu0gW

    Content-Disposition: form-data; name="body"

    {"class_id":[{"id":23114}]}

    ----WebKitFormBoundary7MA4YWxkTrZu0gW

    OT's REST implementation is not fully JSON or something like that, that is why we have to formulate a "body" parameter. In other applications like OTDS, we send it pure JSON payload. If you use OTCSTicket put that in lieu of what I show. (my thought is OTDSTicket is superior :)


    General Guideline when you run into REST API Problems.

    Observe payload when you use SmartUI using Fiddler, with some practice you can see what the command when you click a button in SmartUI is that is the

    best debugger. That is what I did. Its REST API is discussed I think in detail at developer.opentext.com


    Screenshots


  • Thank you Appu. That API call seems to work.

  • Well explained. Well exampled and working well! Appriciate it. Thanks!