Comments
We have prepared on project and one task for this test:
Response: HTTP 200, application/json (Hide)
GET /projects/1
Response:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
{
"single": {
"id": 1,
"class": "Project",
"url_path": "\/projects\/1",
"name": "Test Project",
"completed_on": null,
"completed_by_id": null,
"is_completed": false,
"members": [
1
],
"category_id": 0,
"label_id": 0,
"is_trashed": false,
"trashed_on": null,
"trashed_by_id": 0,
"created_on": 1430164963,
"created_by_id": 1,
"updated_on": 1430164964,
"updated_by_id": 1,
"body": null,
"body_formatted": "",
"company_id": 1,
"leader_id": 1,
"currency_id": 2,
"template_id": 0,
"based_on_type": null,
"based_on_id": null,
"email": "notifications+m2p-qhEW5wP@mail.manageprojects.com",
"is_tracking_enabled": true,
"is_client_reporting_enabled": false,
"budget": null,
"count_tasks": 1,
"count_discussions": 0,
"count_files": 0,
"count_notes": 0
},
"category": null,
"hourly_rates": {
"1": 100
},
"label_ids": [],
"task_lists": null
}Response: HTTP 200, application/json (Hide)
GET /projects/1/tasks/1
Response:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
{
"single": {
"id": 1,
"class": "Task",
"url_path": "\/projects\/1\/tasks\/1",
"name": "Visiting Novi Sad",
"assignee_id": 0,
"delegated_by_id": 0,
"completed_on": null,
"completed_by_id": null,
"is_completed": false,
"comments_count": 0,
"attachments": [],
"labels": [],
"is_trashed": false,
"trashed_on": null,
"trashed_by_id": 0,
"project_id": 1,
"is_hidden_from_clients": false,
"body": "",
"body_formatted": "",
"created_on": 1430164964,
"created_by_id": 1,
"updated_on": 1430164964,
"updated_by_id": 1,
"task_number": 1,
"task_list_id": 0,
"position": 1,
"is_important": false,
"due_on": null,
"estimate": 0,
"job_type_id": 0,
"total_subtasks": 0,
"completed_subtasks": 0,
"open_subtasks": 0
},
"subscribers": [
1
],
"comments": [],
"reminders": [],
"subtasks": [],
"task_list": null,
"tracked_time": 0,
"tracked_expenses": 0
}Lets try to find a term that does not exist:
Nothing? Hm, lets comment:
Response: HTTP 200, application/json (Hide)
POST /comments/task/1
Payload:
1 2 3
{
"body": "Novi Sad is the second largest city in Serbia"
}Response:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
{
"single": {
"id": 1,
"class": "Comment",
"url_path": "\/comments\/1",
"attachments": [],
"is_trashed": false,
"trashed_on": null,
"trashed_by_id": 0,
"parent_type": "Task",
"parent_id": 1,
"body": "Novi Sad is the second largest city in Serbia",
"body_formatted": "Novi Sad is the second largest city in Serbia",
"body_plain_text": "Novi Sad is the second largest city in Serbia",
"created_on": 1430164965,
"created_by_id": 1,
"updated_on": 1430164965,
"updated_by_id": 1
}
}and search:
Still nothing? If we create a comment with that term:
Response: HTTP 200, application/json (Hide)
POST /comments/task/1
Payload:
1 2 3
{
"body": "Novi Sad and Petrovaradin are really close, so much that some people feel that Petrovaradin is part of the city"
}Response:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
{
"single": {
"id": 2,
"class": "Comment",
"url_path": "\/comments\/2",
"attachments": [],
"is_trashed": false,
"trashed_on": null,
"trashed_by_id": 0,
"parent_type": "Task",
"parent_id": 1,
"body": "Novi Sad and Petrovaradin are really close, so much that some people feel that Petrovaradin is part of the city",
"body_formatted": "Novi Sad and Petrovaradin are really close, so much that some people feel that Petrovaradin is part of the city",
"body_plain_text": "Novi Sad and Petrovaradin are really close, so much that some people feel that Petrovaradin is part of the city",
"created_on": 1430164965,
"created_by_id": 1,
"updated_on": 1430164965,
"updated_by_id": 1
}
}search will return our task:
If we remove the second comment:
Search will stop returing our task for petrovaradin term:
Response: HTTP 200, application/json (Hide)
PUT /move-to-trash/comment/2
Response:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
{
"single": {
"id": 2,
"class": "Comment",
"url_path": "\/comments\/2",
"attachments": [],
"is_trashed": true,
"trashed_on": 1430164965,
"trashed_by_id": 1,
"parent_type": "Task",
"parent_id": 1,
"body": "Novi Sad and Petrovaradin are really close, so much that some people feel that Petrovaradin is part of the city",
"body_formatted": "Novi Sad and Petrovaradin are really close, so much that some people feel that Petrovaradin is part of the city",
"body_plain_text": "Novi Sad and Petrovaradin are really close, so much that some people feel that Petrovaradin is part of the city",
"created_on": 1430164965,
"created_by_id": 1,
"updated_on": 1430164965,
"updated_by_id": 1
}
}