Request

POST /requests

Creates a new request of a workflow or form to the groups associated.

Parameters

Name Type Description
visto_id integer Required. Visto identifier for the request

Example

{
  "visto_id" : 201
}

Response

Status: 201
{
    "id": 2187,
    "title": "Network Verification",
    "created_at": "2015-10-19 12:41:45 -0200",
    "updated_at": "2015-10-19 12:42:06 -0200",
    "user_id": 98,
    "status": "created",
    "started_at": null,
    "due_date": "2015-10-19 13:11:45 -0200",
    "user": {
        "id": 98,
        "email": "[email protected]",
        "name": "Example Name"
    }
}

GET /tasks

List all open and finished tasks.

Response

Status: 200
{
    "total": 2,
    "tasks": [
        {
            "id": 1,
            "title": "My Visto - Checklist 1",
            "workflow_id": "1",
            "workflow": "My Workflow 1",
            "requesting_user_id": 2,
            "requesting_user_name": "User Name 2",
            "executing_user_id": 1,
            "executing_user_name": "User Name 1",
            "status": "assigned",
            "started_at": null,
            "due_date": "2015-10-08 15:46:39 -0300",
            "result": null,
            "assigned_at": "2015-10-08 15:16:39 -0300",
            "classification": "corrective",
            "finished_at": null,
            "duration": "00:30",
            "time_spent": null,
            "created_by": 67,
            "elapsed_time": null,
            "group_id": null,
            "group_name": null,
            "elapsed_time_duration": "",
            "created_at": "2015-10-08 15:16:39 -0300",
            "updated_at": "2015-10-08 15:16:39 -0300"
        },
        {
            "id": 2,
            "title": "My Visto - Check Task 2",
            "workflow_id": "1",
            "workflow": "My Workflow 1",
            "requesting_user_id": 2,
            "requesting_user_name": "User Name 2",
            "executing_user_id": 1,
            "executing_user_name": "User Name 1",
            "status": "assigned",
            "started_at": null,
            "due_date": "2015-10-08 15:46:39 -0300",
            "result": null,
            "assigned_at": "2015-10-08 15:16:39 -0300",
            "classification": "corrective",
            "finished_at": null,
            "duration": "00:30",
            "time_spent": null,
            "created_by": 67,
            "elapsed_time": null,
            "group_id": null,
            "group_name": null,
            "elapsed_time_duration": "",
            "created_at": "2015-10-08 15:16:39 -0300",
            "updated_at": "2015-10-08 15:16:39 -0300"
        }
    ]
}

GET /tasks/{id}

Get details for one task.

Response

Status: 200
[
    {
        "task_result": {
            "id": 1484,
            "task": {
                "id": 2216,
                "title": "My Visto - Check Task 1",
                "workflow_id": "1",
                "workflow": "My Workflow 1",
                "requesting_user_id": 2,
                "requesting_user_name": "User Name 2",
                "executing_user_id": 1,
                "executing_user_name": "User Name 1",
                "status": "assigned",
                "started_at": null,
                "due_date": "2015-10-08 15:46:39 -0300",
                "result": null,
                "assigned_at": "2015-10-08 15:16:39 -0300",
                "classification": "corrective",
                "finished_at": null,
                "duration": "00:30",
                "time_spent": null,
                "created_by": 67,
                "elapsed_time": null,
                "group_id": null,
                "group_name": null,
                "elapsed_time_duration": "",
                "created_at": "2015-10-08 15:16:39 -0300",
                "updated_at": "2015-10-08 15:16:39 -0300"
            }
        },
        "steps": [
            {
                "id": "2d0e700b-87dc-4a00-aeec-087ed5c6aab9",
                "text": "We'll check all itens on this room for this verification",
                "location": {
                    "latitude": "-23.6022214",
                    "longitude": "-46.6586337",
                    "date": "08/10/2015 15:22",
                    "address": "767 Fifth Avenue New York, NY 10153"
                },
                "result": "1",
                "answer": "Sim",
                "actions": [
                    {
                        "id": "20315562-e11f-4a83-84cc-d978140beae9",
                        "action_type": "message",
                        "data": "{\"description\":\"Take some notes!\",\"type_field\":\"0\",\"value_range\":[\"0\",\"99\"],\"length_range\":[1,200]}",
                        "results": [
                            {
                                "task_id": 2216,
                                "file": {
                                    "url": null
                                },
                                "id": 1854,
                                "description": null,
                                "data": "Testing 1, 2, 3...",
                                "created_at": "2015-10-22 01:37:19 -0200",
                                "updated_at": "2015-10-22 01:37:19 -0200",
                            }
                        ],
                        "step_link": "1",
                        "file": {
                            "file": {
                                "url": null
                            }
                        },
                        "filename": null
                    },
                    {
                        "id": "3485a85c-3357-4e4d-ba1b-700d9a762e2d",
                        "action_type": "audio",
                        "data": "{\"time\":\"pequeno\",\"description\":\"Attach some noise!\"}",
                        "results": [
                            {
                                "task_id": 2216,
                                "file": {
                                    "url": "/uploads/action_result/file/1857/97744_ALARM.mp3"
                                },
                                "id": 1857,
                                "description": null,
                                "data": null,
                                "created_at": "2015-10-22 01:37:22 -0200",
                                "updated_at": "2015-10-22 01:37:22 -0200",
                                "action_id": "3485a85c-3357-4e4d-ba1b-700d9a762e2d"
                            }
                        ],
                        "step_link": "1",
                        "file": {
                            "file": {
                                "url": "/uploads/action_result/file/1857/97744_ALARM.mp3"
                            }
                        },
                        "filename": "97744_ALARM.mp3"
                    },
                    {
                        "id": "b859bd49-266c-4bc2-bd92-54db22c388fd",
                        "action_type": "attachment",
                        "data": "{\"description\":\"Attach some file!\"}",
                        "results": [
                            {
                                "task_id": 2216,
                                "file": {
                                    "url": "/uploads/action_result/file/1856/mydoc.docx"
                                },
                                "id": 1856,
                                "description": null,
                                "data": null,
                                "created_at": "2015-10-22 01:37:21 -0200",
                                "updated_at": "2015-10-22 01:37:21 -0200",
                                "action_id": "b859bd49-266c-4bc2-bd92-54db22c388fd"
                            }
                        ],
                        "step_link": "1",
                        "file": {
                            "file": {
                                "url": "/uploads/action_result/file/1856/mydoc.docx"
                            }
                        },
                        "filename": "mydoc.docx"
                    },
                    {
                        "id": "c061133f-f3b1-4a3d-847f-6f6bc9d0207e",
                        "action_type": "picture",
                        "data": "{\"pictures_quantity\":\"1\",\"description\":\"\",\"descriptions\":[\"Centralize and focus!\"]}",
                        "results": [
                            {
                                "task_id": 2216,
                                "file": {
                                    "url": "/uploads/action_result/file/1855/mypic.jpg"
                                },
                                "id": 1855,
                                "description": null,
                                "data": null,
                                "created_at": "2015-10-22 01:37:21 -0200",
                                "updated_at": "2015-10-22 01:37:21 -0200",
                                "action_id": "c061133f-f3b1-4a3d-847f-6f6bc9d0207e"
                            }
                        ],
                        "step_link": "1",
                        "file": {
                            "file": {
                                "url": "/uploads/action_result/file/1855/mypic.jpg"
                            }
                        },
                        "filename": "mypic.jpg"
                    },
                    {
                        "id": "cdb5867d-341e-4e46-aa11-cd244d7a5dfe",
                        "action_type": "email",
                        "data": "{\"email_to\":[\"[email protected]\"],\"subject\":\"Testing\",\"body\":\"1, 2, 3...\",\"send_result\":false}",
                        "results": [
                            {
                                "task_id": 2216,
                                "file": {
                                    "url": null
                                },
                                "id": 1853,
                                "description": null,
                                "data": "{\"email_to\"=>[\"[email protected]\"], \"subject\"=>\"Testing\", \"body\"=>\"1, 2, 3...\", \"send_result\"=>false}",
                                "created_at": "2015-10-22 01:37:18 -0200",
                                "updated_at": "2015-10-22 01:37:18 -0200",
                                "action_id": "cdb5867d-341e-4e46-aa11-cd244d7a5dfe"
                            }
                        ],
                        "step_link": "1",
                        "file": {
                            "file": {
                                "url": null
                            }
                        },
                        "filename": null
                    }
                ]
            }
        ]
    }
]