cancel
Showing results for 
Search instead for 
Did you mean: 

REST API get/post request question

airwick219
Champ in-the-making
Champ in-the-making
I am trying to work with the activiti API with tomcat and using postman to test my get/post request, but I was not able to get request the data, like show all the tasks, complete a task and other.

Here is what I did

1. Put acitiviti-explorer and activiti-rest inside webapp in tomcat 7.0.42
2. Startup tomcat
3. go to http://localhost:8080/acitiviti-explorer
4. log in as username: kermit, pw: kermit
5. Tasks -> create a couple Tasks like
     1. Task1
     2. Task2
     3. Task3

6. Use chrome Postman - REST Client
7. setup postman
    - Basic Auth: username: kermit, pw: kermit
    - Header: Content-Type,  Value: application/json

8. Input
    URL: http://localhost:8080/activiti-rest/service/tasks
    select: GET

     result:
     {
         "errorMessage": "Tasks must be filtered with 'assignee', 'owner', 'involved', 'candidate' or 'candidate-group'",
         "statusCode": 400
     }

———————————————————————————————
     From the User guild under REST API
     List of tasks: GET runtime/tasks
    URL: http://localhost:8080/activiti-rest/service/runtime/tasks
    select: GET

     result:
{
    "data": [
        {
            "id": "101",
            "url": "http://localhost:8080/activiti-rest/service/runtime/tasks/101",
            "owner": null,
            "assignee": "gonzo",
            "delegationState": null,
            "name": "enim Ut ut fugiat adipisicing in",
            "description": "Duis do Ut anim do cupidatat aute dolore nisi et reprehenderit laborum ad Excepteur dolore",
            "createTime": "2013-10-15T19:42:17.352+0000",
            "dueDate": null,
            "priority": 50,
            "suspended": false,
            "taskDefinitionKey": null,
            "parentTaskId": null,
            "parentTaskUrl": null,
            "executionId": null,
            "executionUrl": null,
            "processInstanceId": null,
            "processInstanceUrl": null,
            "processDefinitionId": null,
            "processDefinitionUrl": null,
            "variables": []
        },
        {
            "id": "103",
            "url": "http://localhost:8080/activiti-rest/service/runtime/tasks/103",
            "owner": null,
            "assignee": null,
            "delegationState": null,
            "name": "irure do adipisicing eiusmod veniam amet",
            "description": "Ut minim Lorem elit officia laborum dolore consequat pariatur enim adipisicing adipisicing quis amet aliquip",
            "createTime": "2013-10-15T19:42:17.358+0000",
            "dueDate": null,
            "priority": 50,
            "suspended": false,
            "taskDefinitionKey": null,
            "parentTaskId": null,
            "parentTaskUrl": null,
            "executionId": null,
            "executionUrl": null,
            "processInstanceId": null,
            "processInstanceUrl": null,
            "processDefinitionId": null,
            "processDefinitionUrl": null,
            "variables": []
        },
        ………………
            ],
         "total": 100,
         "start": 0,
         "sort": "id",
         "order": "asc",
         "size": 10
         }

I have also tried a couple others as well but it's too long to post it all up but ideally I would like get back all the information about
Task1, Task2 and Task3 using the API. Also I notice that there are total of 100 Tasks from Get URL: http://localhost:8080/activiti-rest/service/runtime/tasks in Postman where as only total of 3 tasks that we created, from http://localhost:8080/activiti-explorer/#database/ACT_RU_TASK or under tasks in the browser

We have also tried to start a Vacation Request process and claimed the tasks and was not able to get those information from the rest API


I was wondering if we have used the wrong URL or other processes that we have missed

Please let me know if additional information is needed
thank you so much


4 REPLIES 4

frederikherema1
Star Contributor
Star Contributor
I'm not sure what your problem is… You're callign both OLD (URL: http://localhost:8080/activiti-rest/service/tasks) and new (runtime/tasks) methods. What information exactly are you NOT getting back?

alessandro_hola
Champ in-the-making
Champ in-the-making
I have the same problem.

Trying to get the list of tasks for a particular user at the new REST API, the http://localhost:8080/activiti-rest/service/runtime/tasks, seems to return a FAKE result, because always return the same 100 tasks, independent of the  assignee/owner filter.

This result appear not come from database, because i changed db.properties config file, to point to my oracle database and i can't see my tasks created with activiti-explorer for this user, i see the same 100 tasks from before.

thanks

jbarrez
Star Contributor
Star Contributor
That sounds very unlikely. The rest api never gives back fake results.

What happens when you close down the server? Does it still work?
Where did you make the db.properties change?

jbarrez
Star Contributor
Star Contributor
And those are probably demo tasks …. what happens if you start with a clean db and remove the demogenerator bean in the config xml?