Is it possible to fetch task assign to user and also the document which is related to that task in a single query or in one call
0 votes
1 answers
1767 views
You can use the targetDocumentIds
fetch property on the task endpoint like this:
curl -X GET 'https://yourServer/nuxeo/api/v1/task?userId=userId' -H 'accept: text/plain,application/json, application/json' -H 'Connection: keep-alive' -H 'X-NXfetch.task: targetDocumentIds,actors' -u user:password
I thought it was documented in https://doc.nuxeo.com/ but I can't find it anymore. I created https://jira.nuxeo.com/browse/NXDOC-1313 to update the doc.
Yes, please refer to https://doc.nuxeo.com/nxdoc/javascript-client/. Note that the http headers go in the options:
var options = {
method: "get",
headers: {
"X-NXfetch.task": "targetDocumentIds,actors"
}
};
request
.path("task")
.queryParams({"userId": "yourUserId"})
.execute(options)
.then(function(response) { ... }.bind(this));
09/11/2017