10-14-2014 05:31 PM
Hi,
I'd like to get (or set!) a tag to a document using the REST API.
How can this be done?
Thanks for any advice
Christian
08-06-2015 04:23 AM
Is there a solution to setting and getting tags via the REST API
08-06-2015 04:51 AM
Hi
After all, since no operation exists, I have developed a new operation SetDocumentTag callable from the APIREST:
@Operation(id=SetDocumentTag.ID, category=Constants.CAT_DOCUMENT, label="SetDocumentTag", description="")
public class SetDocumentTag {
public static final String ID = "SetDocumentTag";
private static final Log log = LogFactory.getLog(SetDocumentTag.class);
@Context
protected CoreSession session;
@Param(name = "label", required = true)
protected String label;
@Param(name = "username", required = true)
protected String username;
@OperationMethod
public void run(DocumentModel input) throws Exception {
TagService service = Framework.getLocalService(TagService.class);
String docId = input.getId();
log.error("SetDocumentTag> docId=" + docId + " tag=" + label + " username=" + username);
service.tag(session, docId, label, username);
session.save();
}
}
Christian
08-13-2015 03:27 AM
Thanks for the operation for setting tags. My only problem is that I do not get the relations via API with the calls outlines above. Do I need a special API call to retrieve tags. Is there some special X-NXDocumentProperties set. If I use the asterisk tags are not included in the response.
08-13-2015 03:59 AM
Hi
08-13-2015 05:51 AM
Hi Christian,
08-13-2015 06:05 AM
...
08-13-2015 08:34 AM
The strange thing is that there are Operations for "Tag", "Untag" and "Remove all tags" from a document available but there seems to be no means for getting the tags set on a document via the API. I will have a look at the TagService now.
08-13-2015 08:43 AM
Hi,
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.