Create an announcement
POST /api/sync/v1/announcements
Operation id: CreateAnnouncement
Description
This API will create an Announcement in DRAFT state. This API will provide a id value for the announcement created. This id value can be used to either update the details for announcement or use the Launch API to launch the announcement.
The following parameters are mandatory to create an announcement:-
- Title: Max limit is 222 characters
- Start Date: Default value is Current Timestamp. The date can be in the future but not in past. The time should be in UTC
- Due Date: The date cannot be in past. The time should be in UTC
- Priority: Default value is STANDARD. Other values are IMPORTANT or URGENT.
- Status: Value has to be set as DRAFT.
- Recipients:
The other optional parameters are:-
- Description: Max 2000 characters.
- sendNow: This parameter can be used to tell the API if the announcement needs to be sent immediately or not. Boolean value accepted: true or false.
- expiryLimitInDays: Default is 90 days. Value can be from 1 to 90 days.
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
Security
- Bearer (http / bearer)
- enter the client service token value.
Responses
200 — Announcement Created Successfully
Content type: application/json
400 — Bad Request
401 — Unauthorized Access
500 — Internal Server Error
Request body
Required: Yes
application/json
Schema
| Property | Type | Required | Description |
|---|---|---|---|
taskType | string | No | task type |
title | string | No | title for announcement |
description | string | No | description for announcement |
startDate | string (date-time) | No | start date for announcement |
dueDate | string (date-time) | No | due date for announcement |
priority | string | No | priority for announcement |
status | string | No | status of task |
recipients | array | No | |
expiryLimitInDays | integer (int32) | No | no of days that will be used to calculate expireDate for an announcement by adding it to dueDate |
sendNow | boolean | No | if 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 Created Successfully
Content type: application/json
Schema
| Property | Type | Required | Description |
|---|---|---|---|
message | string | No | response message |
status | string | No | response status |
statusCode | integer (int32) | No | response status code |
debugErrorMessage | string | No | error message |
messageCode | string | No | message codes |
messageParams | array | No | message parameters |
data | object | No | |
announcementId | integer (int32) | No | announcement 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"
}
}
}