Gets To-Do details

GET /api/sync/v1/todos/{todoId}

Operation id: FetchTodoDetailsAsPerRole

Description

This API will provide details for an specific to-do or an assignment created for a recipient provided during the CREATE or UPDATE to-do APIs. When only a to-do Id is provided, the API provides details for the to-do created by the creator and will check if the user was that creator or not. If the assignment Id is provided along with the to-do Id, the API checks for permission whether the user is an assignee of the assignment or has a task-view-all permission and they belong to the same site as the recipient/creator of the to-do/assignment.

The details of the to-do or assignment will provide platform based names for the user, role, department and site with rest of the details.

The valid status for a to-do that can be seen: DRAFT, LAUNCHED, RECALLED The valid status for an assignment of a to-do that can be seen: NEW, READ, COMPLETED

If the assignment has been recalled, the assignment details will not shared, it will throw an error message. If the to-do is recalled, the details will be still shared to the creator.

Permissions Required:

  1. For To-Do details: - Creator of the to-do
  2. For Assignment details: - Assignee of the assignment or have task-view-all and access to that site where the assignment is created.

Tags: To-Do APIs

Parameters

Path parameters

NameTypeRequiredDescription
todoIdinteger (int32)YesIdentifier of a To-Do

Query parameters

NameTypeRequiredDescription
assignmentIdinteger (int32)NoAssignment Id

Security

  • Bearer (http / bearer)
    • enter the client service token value.

Responses

200 — To-Do Details Retrieved Successfully

Content type: application/json

400 — Bad Request

401 — Unauthorized Access

403 — Forbidden

500 — Internal Server Error

Response models

200 — To-Do Details Retrieved Successfully

Content type: application/json

Schema

PropertyTypeRequiredDescription
taskRecipientsarrayNo
taskAttachmentsarrayNo
creatorDetailsobjectNo
{
  "type": "object",
  "required": [
    "scheduleType"
  ],
  "properties": {
    "taskRecipients": {
      "items": {
        "type": "object",
        "properties": {
          "platformUserId": {
            "type": "string",
            "description": "user Id"
          },
          "platformRoleId": {
            "type": "string",
            "description": "role Id"
          },
          "platformSiteId": {
            "type": "string",
            "description": "site Id"
          },
          "platformDepartmentId": {
            "type": "string",
            "description": "department Id"
          },
          "platformRegionId": {
            "type": "string",
            "description": "region Id"
          }
        }
      }
    },
    "taskAttachments": {
      "items": {
        "type": "object",
        "required": [
          "fileName",
          "fileuri"
        ],
        "properties": {
          "size": {
            "type": "integer",
            "format": "int32",
            "description": "size of file in bytes",
            "example": 921000
          },
          "duration": {
            "type": "integer",
            "format": "int32",
            "description": "duration of audio/video in milliseconds",
            "example": 120000
          },
          "mimetype": {
            "type": "string",
            "description": "mime Type of file",
            "example": "image/jpeg"
          },
          "fileuri": {
            "type": "string",
            "description": "url of file",
            "example": "https://storage.googleapis.com/testbucket/file1.jpeg"
          },
          "fileName": {
            "type": "string",
            "description": "name of file",
            "example": "file1.jpeg"
          },
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "creatorDetails": {
            "type": "object",
            "properties": {
              "profilePhoto": {
                "type": "string"
              },
              "presence": {
                "type": "object"
              },
              "name": {
                "type": "string"
              },
              "roles": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "platformUserId": {
                "type": "string",
                "description": "user Id"
              },
              "platformRoleId": {
                "type": "string",
                "description": "role Id"
              },
              "platformSiteId": {
                "type": "string",
                "description": "site Id"
              },
              "platformDepartmentId": {
                "type": "string",
                "description": "department Id"
              },
              "platformRegionId": {
                "type": "string",
                "description": "region Id"
              }
            }
          }
        }
      }
    },
    "creatorDetails": {
      "type": "object",
      "properties": {
        "profilePhoto": {
          "type": "string"
        },
        "presence": {
          "type": "object",
          "properties": {
            "state": {
              "type": "integer",
              "format": "int32",
              "description": "state for user"
            },
            "status": {
              "type": "string",
              "description": "status for user"
            },
            "updatedAt": {
              "type": "string",
              "format": "date-time",
              "description": "date and time when user information is updated"
            }
          }
        },
        "name": {
          "type": "string"
        },
        "roles": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer",
                "format": "int32"
              },
              "name": {
                "type": "string"
              }
            }
          }
        },
        "platformUserId": {
          "type": "string",
          "description": "user Id"
        },
        "platformRoleId": {
          "type": "string",
          "description": "role Id"
        },
        "platformSiteId": {
          "type": "string",
          "description": "site Id"
        },
        "platformDepartmentId": {
          "type": "string",
          "description": "department Id"
        },
        "platformRegionId": {
          "type": "string",
          "description": "region Id"
        }
      }
    }
  }
}