Update an announcement

PUT /api/sync/v1/announcements/{announcementId}

Operation id: UpdateAnnouncement

Description

This API will update an Announcement in DRAFT state. The user needs to pass the id value generated from the CREATE API.This API will provide a id value for the announcement created.

The following parameters can be updated:-

  1. Title: Max limit is 222 characters
  2. Start Date: Default value is Current Timestamp. The date can be in the future but not in past. The time should be in UTC.
  3. Due Date: The date cannot be in past. The time should be in UTC.
  4. Priority: Default value is STANDARD. Other values are IMPORTANT or URGENT.
  5. Recipients
  6. Description: Max 2000 characters.
  7. sendNow: This parameter can be used to tell the API if the announcement needs to be send immediately or not. Boolean value accepted: true or false.
  8. expiryLimitInDays: Default is 90 days. Value can be from 1 to 90 days.

Th Status param would still need to be set as DRAFT.

The other parameters such as taskType Id can be ignored. The value for this parameter is ANNOUNCEMENT.

Permission required: announcements which depends on wcc-chat(base)

Tags: Announcement APIs

Parameters

Path parameters

NameTypeRequiredDescription
announcementIdinteger (int32)YesAnnouncement Id

Security

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

Responses

200 — Announcement Updated Successfully

Content type: application/json

400 — Bad Request

401 — Unauthorized Access

500 — Internal Server Error

Request body

Required: Yes

application/json

Schema

PropertyTypeRequiredDescription
taskTypestringNotask type
titlestringNotitle for announcement
descriptionstringNodescription for announcement
startDatestring (date-time)Nostart date for announcement
dueDatestring (date-time)Nodue date for announcement
prioritystringNopriority for announcement
statusstringNostatus of task
recipientsarrayNo
expiryLimitInDaysinteger (int32)Nono of days that will be used to calculate expireDate for an announcement by adding it to dueDate
sendNowbooleanNoif true announcement will be sent immediately, else announcement will be visible after start date
{
  "type": "object",
  "properties": {
    "taskType": {
      "type": "string",
      "description": "task type",
      "enum": [
        "ANNOUNCEMENT"
      ],
      "example": "ANNOUNCEMENT"
    },
    "title": {
      "type": "string",
      "description": "title for announcement",
      "example": "Create Purchase Orders"
    },
    "description": {
      "type": "string",
      "description": "description for announcement",
      "example": "Create Purchase Orders"
    },
    "startDate": {
      "type": "string",
      "format": "date-time",
      "description": "start date for announcement"
    },
    "dueDate": {
      "type": "string",
      "format": "date-time",
      "description": "due date for announcement"
    },
    "priority": {
      "type": "string",
      "description": "priority for announcement",
      "enum": [
        "URGENT",
        "IMPORTANT",
        "STANDARD"
      ],
      "example": "STANDARD"
    },
    "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"
    },
    "recipients": {
      "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"
          }
        }
      }
    },
    "expiryLimitInDays": {
      "type": "integer",
      "format": "int32",
      "description": "no of days that will be used to calculate expireDate for an announcement by adding it to dueDate",
      "example": 10
    },
    "sendNow": {
      "type": "boolean",
      "description": "if true announcement will be sent immediately, else announcement will be visible after start date"
    }
  }
}

Response models

200 — Announcement Updated Successfully

Content type: application/json

Schema

PropertyTypeRequiredDescription
messagestringNoresponse message
statusstringNoresponse status
statusCodeinteger (int32)Noresponse status code
debugErrorMessagestringNoerror message
messageCodestringNomessage codes
messageParamsarrayNomessage parameters
dataobjectNo
announcementIdinteger (int32)Noannouncement Id
{
  "type": "object",
  "properties": {
    "message": {
      "type": "string",
      "description": "response message"
    },
    "status": {
      "type": "string",
      "description": "response status",
      "enum": [
        "SUCCESS",
        "FAIL",
        "BAD_REQUEST",
        "NO_CONTENT",
        "UNAUTHORIZED",
        "FORBIDDEN",
        "NOT_FOUND",
        "INTERNAL_SERVER_ERROR",
        "UNSUPPORTED_MEDIA_TYPE"
      ]
    },
    "statusCode": {
      "type": "integer",
      "format": "int32",
      "description": "response status code"
    },
    "debugErrorMessage": {
      "type": "string",
      "description": "error message"
    },
    "messageCode": {
      "type": "string",
      "description": "message codes",
      "items": {
        "type": "string",
        "example": [
          "ERROR62- Error launching announcement.",
          "ERROR44-Error creating announcement.",
          "ERROR45-Error updating announcement.",
          "Error49-Error deleting announcement"
        ]
      }
    },
    "messageParams": {
      "type": "array",
      "description": "message parameters",
      "items": {
        "type": "string"
      }
    },
    "data": {
      "type": "object"
    },
    "announcementId": {
      "type": "integer",
      "format": "int32",
      "description": "announcement Id"
    }
  }
}