• Use REST API to create file with keywords included

  • We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #54595  by foundry
 
Hello, I have set up a javascript function to create a file in openKM. I am looking to add a keyword at the time of creation. The following code uploads a file to openKM, but does not apply keywords
Code: Select all
const form = new FormData();
    form.append('docPath', `/okm:root/${contentObj.name}`);
    form.append('content', contentObj, `${contentObj.name}`);

    const response = await fetch(`${OPENKM_API}/document/createSimple`, {
        method: 'POST',
        headers: {
            'Accept': 'application/json',
            'Authorization': 'Basic ' + btoa('username:password')
        },
        body: form
    })
    .then((res) => {
        return res.json();
    });
What do I need to add in order to add keywords?
 #54618  by jllort
 
In the professional edition there's a plugin architecture with which you can extend the REST API methods ... unfortunately in the CE still we have not added this feature.

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.