Get To-Do assignments for Recall or Reset

POST /api/sync/v1/todos/assignments

Operation id: getAssignments

Description

This API will return a list of assignments for a to-do eligible based on the process and status mentioned. The status param is not mandatory. If status is not provided as input, the API will compute all eligible assignments based on the given to-do Id.

Process : "RECALL", "RESET", "EXECUTION"

  • Process: RECALL; Status: NEW, READ, COMPLETED
  • Process: RESET; Status: READ, COMPLETED
  • Process: EXECUTION; Status: NEW, READ, COMPLETED

groupByEnum : "NONE, SITE"

  • NONE: The API will return a flat list of people, roles, and departments.
  • SITE: The API will return roles and departments grouped by site, along with a flat list of people.

Permission Required:

  1. Creator of the to-do when process is RECALL or RESET

Tags: To-Do Recall/Reset APIs

Security

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

Responses

200 — Assignments fetched Successfully

Content type: application/json

400 — Bad Request

401 — Unauthorized Access

500 — Internal Server Error

Request body

Required: Yes

application/json

Schema

PropertyTypeRequiredDescription
taskIdinteger (int32)Yestask id on which assignment list is to be fetched
statusstringNostatus of task
processstringYestask process
groupByEnumstringNotask process
{
  "type": "object",
  "required": [
    "process",
    "taskId"
  ],
  "properties": {
    "taskId": {
      "type": "integer",
      "format": "int32",
      "description": "task id on which assignment list is to be fetched",
      "example": 1
    },
    "status": {
      "type": "string",
      "description": "status of task",
      "enum": [
        "DRAFT",
        "PENDING_APPROVAL",
        "REJECTED",
        "LAUNCHED",
        "APPROVED",
        "NEW",
        "READ",
        "COMPLETED",
        "OVERDUE",
        "EXPIRED",
        "RECALLED",
        "PENDING_LAUNCH",
        "COMPLETED_LATE",
        "ONGOING",
        "DISCARDED",
        "APPLIED"
      ],
      "example": "DRAFT"
    },
    "process": {
      "type": "string",
      "description": "task process",
      "enum": [
        "CREATE",
        "APPROVAL",
        "EXECUTION",
        "TASK_EDIT",
        "REJECT",
        "RECALL",
        "RESET",
        "SURVEY_ANSWER_REFUSAL"
      ],
      "example": "RECALL"
    },
    "groupByEnum": {
      "type": "string",
      "description": "task process",
      "enum": [
        "NONE",
        "SITE"
      ],
      "example": "NONE, SITE"
    }
  }
}

Response models

200 — Assignments fetched Successfully

Content type: application/json

Schema

PropertyTypeRequiredDescription
messagestringNo
statusstringNo
statusCodeinteger (int32)No
debugErrorMessagestringNo
messageCodestringNo
messageParamsarrayNo
dataobjectNo
{
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "SUCCESS",
        "FAIL",
        "BAD_REQUEST",
        "NO_CONTENT",
        "UNAUTHORIZED",
        "FORBIDDEN",
        "NOT_FOUND",
        "INTERNAL_SERVER_ERROR",
        "UNSUPPORTED_MEDIA_TYPE"
      ]
    },
    "statusCode": {
      "type": "integer",
      "format": "int32"
    },
    "debugErrorMessage": {
      "type": "string"
    },
    "messageCode": {
      "type": "string"
    },
    "messageParams": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "data": {
      "type": "object",
      "properties": {
        "users": {
          "type": "array",
          "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"
              },
              "assignmentId": {
                "type": "integer",
                "format": "int32",
                "description": "assignment Id"
              },
              "statusId": {
                "type": "integer",
                "format": "int32",
                "description": "status Id"
              },
              "statusDisplayName": {
                "type": "string",
                "description": "status display name"
              },
              "statusEnum": {
                "type": "string",
                "description": "status of task",
                "enum": [
                  "DRAFT",
                  "PENDING_APPROVAL",
                  "REJECTED",
                  "LAUNCHED",
                  "APPROVED",
                  "NEW",
                  "READ",
                  "COMPLETED",
                  "OVERDUE",
                  "EXPIRED",
                  "RECALLED",
                  "PENDING_LAUNCH",
                  "COMPLETED_LATE",
                  "ONGOING",
                  "DISCARDED",
                  "APPLIED"
                ],
                "example": "DRAFT"
              },
              "presence": {
                "type": "object"
              }
            }
          }
        },
        "departments": {
          "type": "array",
          "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"
              },
              "assignmentId": {
                "type": "integer",
                "format": "int32",
                "description": "assignment Id"
              },
              "statusId": {
                "type": "integer",
                "format": "int32",
                "description": "status Id"
              },
              "statusDisplayName": {
                "type": "string",
                "description": "status display name"
              },
              "statusEnum": {
                "type": "string",
                "description": "status of task",
                "enum": [
                  "DRAFT",
                  "PENDING_APPROVAL",
                  "REJECTED",
                  "LAUNCHED",
                  "APPROVED",
                  "NEW",
                  "READ",
                  "COMPLETED",
                  "OVERDUE",
                  "EXPIRED",
                  "RECALLED",
                  "PENDING_LAUNCH",
                  "COMPLETED_LATE",
                  "ONGOING",
                  "DISCARDED",
                  "APPLIED"
                ],
                "example": "DRAFT"
              },
              "presence": {
                "type": "object"
              }
            }
          }
        },
        "roles": {
          "type": "array",
          "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"
              },
              "assignmentId": {
                "type": "integer",
                "format": "int32",
                "description": "assignment Id"
              },
              "statusId": {
                "type": "integer",
                "format": "int32",
                "description": "status Id"
              },
              "statusDisplayName": {
                "type": "string",
                "description": "status display name"
              },
              "statusEnum": {
                "type": "string",
                "description": "status of task",
                "enum": [
                  "DRAFT",
                  "PENDING_APPROVAL",
                  "REJECTED",
                  "LAUNCHED",
                  "APPROVED",
                  "NEW",
                  "READ",
                  "COMPLETED",
                  "OVERDUE",
                  "EXPIRED",
                  "RECALLED",
                  "PENDING_LAUNCH",
                  "COMPLETED_LATE",
                  "ONGOING",
                  "DISCARDED",
                  "APPLIED"
                ],
                "example": "DRAFT"
              },
              "presence": {
                "type": "object"
              }
            }
          }
        }
      }
    }
  }
}