跳转到内容

公告

公告提醒用户有关服务台相关信息,如服务更新、服务器问题、许可证续订或 UI 发布。在 ServiceDesk Plus Cloud 中,您可以使用公告在公司范围内发布信息,仅对技术人员或特定用户组发布。

属性

user_groups (user_group)
指示可以访问公告的用户组

user_groups (user_group)
指示可以访问公告的用户组

示例

{
  "user_groups": [
    {
      "name": "User group 1",
      "id": "1000000000000224445"
    }
  ]
}

banner_style (banner_style)
包含启用横幅时的横幅样式

banner_style (banner_style)
包含横幅样式详情

示例

{
  "banner_style": {
    "bgcolor": "#6dc5fa",
    "fontcolor": "#000000",
    "ispriority_based": false,
    "iconname": "info",
    "alignment": "left"
  }
}

(string)
通过电子邮件接收公告的电子邮件地址列表。

(string)
纯文本格式。 不允许富文本或换行符。

示例

Sample Content

created_date (datetime)read only
指示公告的创建日期

created_date (datetime)
以 JSON 对象表示的日期/时间。包含 value 和 display_value 属性。

value :以长格式表示的时间(自1970年1月1日以来的毫秒数)。

display_value :以用户个性化格式显示的可读时间。若未个性化,则使用默认格式。

comments_count (long)read only
指示公告的评论数量

comments_count (long)
被视为更大数值的数字位数。

示例

234759602834500

更多属性 全部展开

created_by (用户)read only

表示创建公告的技术人员

created_by (用户)
表示创建公告的技术人员

示例

{
  "created_by": {
    "email_id": "andrews@zmail.com",
    "name": "test-created_by",
    "id": "234567890123456"
  }
}

优先级 (优先级)

公告的优先级

优先级 (优先级)
表示公告的优先级

示例

{
  "priority": {
    "name": "test-priority",
    "id": "234567890123456"
  }
}

服务 (服务类别)

公告所属的服务类别

服务 (服务类别)
公告所属的服务类别

是否启用横幅 (布尔值)

表示公告是否启用横幅

是否启用横幅 (布尔值)
布尔值,可以有两个可能的值。值为 true 和 false。

是否关注 (布尔值)read only

表示用户是否关注该公告

是否关注 (布尔值)
布尔值,可以有两个可能的值。值为 true 和 false。

模块 (模块)

公告创建所属的模块

模块 (模块)

到期显示横幅 (布尔值)

表示是否应显示横幅直到截止日期

到期显示横幅 (布尔值)
布尔值,可以有两个可能的值。值为 true 和 false。

起始日期 (datetime)

表示公告的开始日期

起始日期 (datetime)
以 JSON 对象表示的日期/时间。包含 value 和 display_value 属性。

value :以长格式表示的时间(自1970年1月1日以来的毫秒数)。

display_value :以用户个性化格式显示的可读时间。若未个性化,则使用默认格式。

技术人员组 (组)

表示可以访问该公告的技术人员组

技术人员组 (组)
指示可以访问该公告的技术人员组

示例

{
  "technician_groups": [
    {
      "name": "Technician group 1",
      "id": "1000000000000223344"
    }
  ]
}

状态 (string)read only

基于开始和结束日期表示公告的状态

状态 (string)
纯文本格式。 不允许富文本或换行符。

示例

Sample Content

浏览次数 (long)read only

公告的浏览计数

浏览次数 (long)
被视为更大数值的数字位数。

示例

234759602834500

公告类型 (公告类型)

公告所属的公告类型

公告类型 (公告类型)
公告所属的公告类型

示例

{
  "announcement_type": {
    "name": "test-announcement_type",
    "id": "234567892123456"
  }
}

编号 (long)

用于唯一标识公告的标识符

编号 (long)
被视为更大数值的数字位数。

示例

234759602834500

发送邮件 (布尔值)

确定编辑操作是否应重新发送邮件

发送邮件 (布尔值)
布尔值,可以有两个可能的值。值为 true 和 false。

最后更新时间 (datetime)read only

表示公告的最后更新时间

最后更新时间 (datetime)
以 JSON 对象表示的日期/时间。包含 value 和 display_value 属性。

value :以长格式表示的时间(自1970年1月1日以来的毫秒数)。

display_value :以用户个性化格式显示的可读时间。若未个性化,则使用默认格式。

关联 (关联)

获取公告详细信息时包含的模块数据

关联 (关联)

截止日期 (datetime)

表示公告的结束日期

截止日期 (datetime)
以 JSON 对象表示的日期/时间。包含 value 和 display_value 属性。

value :以长格式表示的时间(自1970年1月1日以来的毫秒数)。

display_value :以用户个性化格式显示的可读时间。若未个性化,则使用默认格式。

最后更新者 (用户)read only

表示最近更新公告的用户

最后更新者 (用户)
表示最后一次更新公告的用户

示例

{
  "last_updated_by": {
    "email_id": "test_user@zmail.com",
    "name": "test_user",
    "id": "234567890123456"
  }
}

访问级别 (string)read only

表示公告的访问级别

访问级别 (string)
纯文本格式。 不允许富文本或换行符。

示例

Sample Content

标题 (string)

公告标题

标题 (string)
纯文本格式。 不允许富文本或换行符。

示例

Sample Content

是否有技术人员组 (布尔值)read only

表示公告是否包含技术人员组

是否有技术人员组 (布尔值)
布尔值,可以有两个可能的值。值为 true 和 false。

描述 (html)

公告内容

描述 (html)
HTML 是一个文本区域,可以使用 html 元素。

示例

<b>The content to be displayed</b>

是否向所有技术人员显示 (布尔值)

表示是否向所有技术人员共享该公告

是否向所有技术人员显示 (布尔值)
布尔值,可以有两个可能的值。值为 true 和 false。

是否向请求者显示 (布尔值)

表示公告是否对请求者可见

是否向请求者显示 (布尔值)
布尔值,可以有两个可能的值。值为 true 和 false。

是否有用户组 (布尔值)read only

表示公告是否包含用户组

是否有用户组 (布尔值)
布尔值,可以有两个可能的值。值为 true 和 false。

附件 (附件)

附加到公告的文件。最多可附加50个文件

附件 (附件)
附加到公告的文件

示例

{
  "attachments": [
    {
      "content_type": "application/x-unknown-mime-type",
      "size": "36171",
      "file_id": "4334",
      "name": "test_file.txt"
    }
  ]
}

横幅标签 (string)read only

表示横幅上显示的标签

横幅标签 (string)
纯文本格式。 不允许富文本或换行符。

示例

Sample Content

模板 (公告模板)

表示公告的模板 

模板 (公告模板)
表示公告的模板

示例

{
  "template": {
    "name": "General Announcement Template",
    "id": "100000000000034567"
  }
}

添加公告

此操作用于创建新的公告

必填字段:from_date, state, title, description

网址

<service domain|custom domain>/app/<portal>/api/v3/announcements

属性

user_groups (user_group)
指示可以访问公告的用户组

user_groups (user_group)
指示可以访问公告的用户组

示例

{
  "user_groups": [
    {
      "name": "User group 1",
      "id": "1000000000000224445"
    }
  ]
}

banner_style (banner_style)
包含启用横幅时的横幅样式

banner_style (banner_style)
包含横幅样式详情

示例

{
  "banner_style": {
    "bgcolor": "#6dc5fa",
    "fontcolor": "#000000",
    "ispriority_based": false,
    "iconname": "info",
    "alignment": "left"
  }
}

(string)
通过电子邮件接收公告的电子邮件地址列表。

(string)
纯文本格式。 不允许富文本或换行符。

示例

Sample Content

created_date (datetime)read only
指示公告的创建日期

created_date (datetime)
以 JSON 对象表示的日期/时间。包含 value 和 display_value 属性。

value :以长格式表示的时间(自1970年1月1日以来的毫秒数)。

display_value :以用户个性化格式显示的可读时间。若未个性化,则使用默认格式。

comments_count (long)read only
指示公告的评论数量

comments_count (long)
被视为更大数值的数字位数。

示例

234759602834500

更多属性 全部展开

created_by (用户)read only

表示创建公告的技术人员

created_by (用户)
表示创建公告的技术人员

示例

{
  "created_by": {
    "email_id": "andrews@zmail.com",
    "name": "test-created_by",
    "id": "234567890123456"
  }
}

优先级 (优先级)

公告的优先级

优先级 (优先级)
表示公告的优先级

示例

{
  "priority": {
    "name": "test-priority",
    "id": "234567890123456"
  }
}

服务 (服务类别)

公告所属的服务类别

服务 (服务类别)
公告所属的服务类别

是否启用横幅 (布尔值)

表示公告是否启用横幅

是否启用横幅 (布尔值)
布尔值,可以有两个可能的值。值为 true 和 false。

是否关注 (布尔值)read only

表示用户是否关注该公告

是否关注 (布尔值)
布尔值,可以有两个可能的值。值为 true 和 false。

模块 (模块)

公告创建所属的模块

模块 (模块)

到期显示横幅 (布尔值)

表示是否应显示横幅直到截止日期

到期显示横幅 (布尔值)
布尔值,可以有两个可能的值。值为 true 和 false。

起始日期 (datetime)

表示公告的开始日期

起始日期 (datetime)
以 JSON 对象表示的日期/时间。包含 value 和 display_value 属性。

value :以长格式表示的时间(自1970年1月1日以来的毫秒数)。

display_value :以用户个性化格式显示的可读时间。若未个性化,则使用默认格式。

技术人员组 (组)

表示可以访问该公告的技术人员组

技术人员组 (组)
指示可以访问该公告的技术人员组

示例

{
  "technician_groups": [
    {
      "name": "Technician group 1",
      "id": "1000000000000223344"
    }
  ]
}

状态 (string)read only

基于开始和结束日期表示公告的状态

状态 (string)
纯文本格式。 不允许富文本或换行符。

示例

Sample Content

浏览次数 (long)read only

公告的浏览计数

浏览次数 (long)
被视为更大数值的数字位数。

示例

234759602834500

公告类型 (公告类型)

公告所属的公告类型

公告类型 (公告类型)
公告所属的公告类型

示例

{
  "announcement_type": {
    "name": "test-announcement_type",
    "id": "234567892123456"
  }
}

编号 (long)

用于唯一标识公告的标识符

编号 (long)
被视为更大数值的数字位数。

示例

234759602834500

发送邮件 (布尔值)

确定编辑操作是否应重新发送邮件

发送邮件 (布尔值)
布尔值,可以有两个可能的值。值为 true 和 false。

最后更新时间 (datetime)read only

表示公告的最后更新时间

最后更新时间 (datetime)
以 JSON 对象表示的日期/时间。包含 value 和 display_value 属性。

value :以长格式表示的时间(自1970年1月1日以来的毫秒数)。

display_value :以用户个性化格式显示的可读时间。若未个性化,则使用默认格式。

关联 (关联)

获取公告详细信息时包含的模块数据

关联 (关联)

截止日期 (datetime)

表示公告的结束日期

截止日期 (datetime)
以 JSON 对象表示的日期/时间。包含 value 和 display_value 属性。

value :以长格式表示的时间(自1970年1月1日以来的毫秒数)。

display_value :以用户个性化格式显示的可读时间。若未个性化,则使用默认格式。

最后更新者 (用户)read only

表示最近更新公告的用户

最后更新者 (用户)
表示最后一次更新公告的用户

示例

{
  "last_updated_by": {
    "email_id": "test_user@zmail.com",
    "name": "test_user",
    "id": "234567890123456"
  }
}

访问级别 (string)read only

表示公告的访问级别

访问级别 (string)
纯文本格式。 不允许富文本或换行符。

示例

Sample Content

标题 (string)

公告标题

标题 (string)
纯文本格式。 不允许富文本或换行符。

示例

Sample Content

是否有技术人员组 (布尔值)read only

表示公告是否包含技术人员组

是否有技术人员组 (布尔值)
布尔值,可以有两个可能的值。值为 true 和 false。

描述 (html)

公告内容

描述 (html)
HTML 是一个文本区域,可以使用 html 元素。

示例

<b>The content to be displayed</b>

是否向所有技术人员显示 (布尔值)

表示是否向所有技术人员共享该公告

是否向所有技术人员显示 (布尔值)
布尔值,可以有两个可能的值。值为 true 和 false。

是否向请求者显示 (布尔值)

表示公告是否对请求者可见

是否向请求者显示 (布尔值)
布尔值,可以有两个可能的值。值为 true 和 false。

是否有用户组 (布尔值)read only

表示公告是否包含用户组

是否有用户组 (布尔值)
布尔值,可以有两个可能的值。值为 true 和 false。

附件 (附件)

附加到公告的文件。最多可附加50个文件

附件 (附件)
附加到公告的文件

示例

{
  "attachments": [
    {
      "content_type": "application/x-unknown-mime-type",
      "size": "36171",
      "file_id": "4334",
      "name": "test_file.txt"
    }
  ]
}

横幅标签 (string)read only

表示横幅上显示的标签

横幅标签 (string)
纯文本格式。 不允许富文本或换行符。

示例

Sample Content

模板 (公告模板)

表示公告的模板 

模板 (公告模板)
表示公告的模板

示例

{
  "template": {
    "name": "General Announcement Template",
    "id": "100000000000034567"
  }
}

$ curl <service domain|custom domain>/app/<portal>/api/v3/announcements\
      -X POST\
      -H "Accept: application/vnd.manageengine.sdp.v3+json"\
      -H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
      -H "Content-Type: application/x-www-form-urlencoded"\
      -d input_data='{
  "announcement": {
    "isbannerenabled": true,
    "from_date": {
      "value": 1732083706992
    },
    "show_to_all_technician": false,
    "show_to_requester": true,
    "announcement_type": {
      "id": "100000000000034284"
    },
    "banner_style": {
      "bgcolor": "#4588f0",
      "fontcolor": "#001665",
      "ispriority_based": false,
      "iconname": "warning",
      "alignment": "center"
    },
    "description": "<div class=\"personalize-wrapper\" style=\"font-family: 'PT Sans',Arial,Helvetica,sans-serif, sans-serif;font-size: 13px;\"><div class=\"personalize-wrapper\" style=\"font-family:&quot;PT Sans&quot;, Arial, Helvetica, sans-serif, sans-serif; font-size:13px\"><div>General Announcement - Description [1]<br></div></div><div><br></div></div>",
    "priority": {
      "id": "100000000000006994"
    },
    "services": [
      {
        "id": "100000000000040417"
      },
      {
        "id": "100000000000040419"
      }
    ],
    "title": "General Announcement - Title [1]",
    "to": [
      "abc@test.com",
      "def.gh@test.com"
    ],
    "template": {
      "id": "100000000000033852"
    },
    "show_banner_until_expiry": true,
    "to_date": {
      "value": 1732256460000
    },
    "user_groups": [
      {
        "id": "100000000000052003"
      },
      {
        "id": "100000000000052007"
      }
    ],
    "technician_groups": [
      {
        "id": "100000000000041099"
      },
      {
        "id": "100000000000041029"
      }
    ],
    "attachments": [
      {
        "file_id": "3003"
      }
    ]
  }
}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/announcements";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
           "Content-Type": "application/x-www-form-urlencoded",
           "Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = {
  "announcement": {
    "isbannerenabled": true,
    "from_date": {
      "value": 1732083706992
    },
    "show_to_all_technician": false,
    "show_to_requester": true,
    "announcement_type": {
      "id": "100000000000034284"
    },
    "banner_style": {
      "bgcolor": "#4588f0",
      "fontcolor": "#001665",
      "ispriority_based": false,
      "iconname": "warning",
      "alignment": "center"
    },
    "description": "<div class=\"personalize-wrapper\" style=\"font-family: 'PT Sans',Arial,Helvetica,sans-serif, sans-serif;font-size: 13px;\"><div class=\"personalize-wrapper\" style=\"font-family:&quot;PT Sans&quot;, Arial, Helvetica, sans-serif, sans-serif; font-size:13px\"><div>General Announcement - Description [1]<br></div></div><div><br></div></div>",
    "priority": {
      "id": "100000000000006994"
    },
    "services": [
      {
        "id": "100000000000040417"
      },
      {
        "id": "100000000000040419"
      }
    ],
    "title": "General Announcement - Title [1]",
    "to": [
      "abc@test.com",
      "def.gh@test.com"
    ],
    "template": {
      "id": "100000000000033852"
    },
    "show_banner_until_expiry": true,
    "to_date": {
      "value": 1732256460000
    },
    "user_groups": [
      {
        "id": "100000000000052003"
      },
      {
        "id": "100000000000052007"
      }
    ],
    "technician_groups": [
      {
        "id": "100000000000041099"
      },
      {
        "id": "100000000000041029"
      }
    ],
    "attachments": [
      {
        "file_id": "3003"
      }
    ]
  }
};
params = {"input_data": input_data};
response = invokeurl
[
    url: url
    type: POST
    parameters: params
    headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/announcements"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
    "Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
    "Content-Type" = "application/x-www-form-urlencoded"}
$input_data = @'
{
  "announcement": {
    "isbannerenabled": true,
    "from_date": {
      "value": 1732083706992
    },
    "show_to_all_technician": false,
    "show_to_requester": true,
    "announcement_type": {
      "id": "100000000000034284"
    },
    "banner_style": {
      "bgcolor": "#4588f0",
      "fontcolor": "#001665",
      "ispriority_based": false,
      "iconname": "warning",
      "alignment": "center"
    },
    "description": "<div class=\"personalize-wrapper\" style=\"font-family: 'PT Sans',Arial,Helvetica,sans-serif, sans-serif;font-size: 13px;\"><div class=\"personalize-wrapper\" style=\"font-family:&quot;PT Sans&quot;, Arial, Helvetica, sans-serif, sans-serif; font-size:13px\"><div>General Announcement - Description [1]<br></div></div><div><br></div></div>",
    "priority": {
      "id": "100000000000006994"
    },
    "services": [
      {
        "id": "100000000000040417"
      },
      {
        "id": "100000000000040419"
      }
    ],
    "title": "General Announcement - Title [1]",
    "to": [
      "abc@test.com",
      "def.gh@test.com"
    ],
    "template": {
      "id": "100000000000033852"
    },
    "show_banner_until_expiry": true,
    "to_date": {
      "value": 1732256460000
    },
    "user_groups": [
      {
        "id": "100000000000052003"
      },
      {
        "id": "100000000000052007"
      }
    ],
    "technician_groups": [
      {
        "id": "100000000000041099"
      },
      {
        "id": "100000000000041029"
      }
    ],
    "attachments": [
      {
        "file_id": "3003"
      }
    ]
  }
}
'@
$data = @{ 'input_data' = $input_data}
$response = Invoke-RestMethod -Uri $url -Method post -Body $data -Headers $headers
$response
#Python version - 3.10
from urllib.error import HTTPError
from urllib.parse import urlencode
from urllib.request import urlopen,Request

url = "<service domain|custom domain>/app/<portal>/api/v3/announcements"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json", 
          "Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx", 
          "Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
  "announcement": {
    "isbannerenabled": true,
    "from_date": {
      "value": 1732083706992
    },
    "show_to_all_technician": false,
    "show_to_requester": true,
    "announcement_type": {
      "id": "100000000000034284"
    },
    "banner_style": {
      "bgcolor": "#4588f0",
      "fontcolor": "#001665",
      "ispriority_based": false,
      "iconname": "warning",
      "alignment": "center"
    },
    "description": "<div class=\"personalize-wrapper\" style=\"font-family: 'PT Sans',Arial,Helvetica,sans-serif, sans-serif;font-size: 13px;\"><div class=\"personalize-wrapper\" style=\"font-family:&quot;PT Sans&quot;, Arial, Helvetica, sans-serif, sans-serif; font-size:13px\"><div>General Announcement - Description [1]<br></div></div><div><br></div></div>",
    "priority": {
      "id": "100000000000006994"
    },
    "services": [
      {
        "id": "100000000000040417"
      },
      {
        "id": "100000000000040419"
      }
    ],
    "title": "General Announcement - Title [1]",
    "to": [
      "abc@test.com",
      "def.gh@test.com"
    ],
    "template": {
      "id": "100000000000033852"
    },
    "show_banner_until_expiry": true,
    "to_date": {
      "value": 1732256460000
    },
    "user_groups": [
      {
        "id": "100000000000052003"
      },
      {
        "id": "100000000000052007"
      }
    ],
    "technician_groups": [
      {
        "id": "100000000000041099"
      },
      {
        "id": "100000000000041029"
      }
    ],
    "attachments": [
      {
        "file_id": "3003"
      }
    ]
  }
}'''
data = urlencode({"input_data":input_data}).encode()
httprequest = Request(url, headers=headers,data=data, method="POST")
try:
    with urlopen(httprequest) as response:
        print(response.read().decode())
except HTTPError as e:
    print(e.read().decode())
{
    "response_status": {
        "status_code": 2000,
        "status": "success"
    },
    "announcement": {
        "template": {
            "inactive": false,
            "name": "General Announcement Template",
            "id": "100000000000033852"
        },
        "attachments": [
            {
                "size": "361693",
                "content_type": "image/png",
                "file_id": "3003",
                "name": "SampleImage.png",
                "content_url": "/announcements/100000000000052059/_uploads/3003",
                "id": "100000000000052069"
            }
        ],
        "has_user_group": true,
        "show_to_requester": true,
        "show_to_all_technician": false,
        "description": "<div class=\"personalize-wrapper\" style=\"font-family:&quot;PT Sans&quot;, Arial, Helvetica, sans-serif, sans-serif; font-size:13px\"><div class=\"personalize-wrapper\" style=\"font-family:&quot;PT Sans&quot;, Arial, Helvetica, sans-serif, sans-serif; font-size:13px\"><div>General Announcement - Description [1]<br></div></div><div><br></div></div>",
        "has_technician_group": true,
        "title": "General Announcement - Title [1]",
        "access_level": "SHARED",
        "last_updated_by": null,
        "to_date": {
            "display_value": "Nov 22, 2024 11:51 AM",
            "value": "1732256460000"
        },
        "rel": {
            "initiated_by_change": null,
            "initiated_by_release": null,
            "initiated_by_problem": null,
            "initiated_by_arc_request": null,
            "initiated_by_request": null
        },
        "last_updated_on": null,
        "id": "100000000000052059",
        "announcement_type": {
            "name": "New Service Launched",
            "id": "100000000000034284"
        },
        "views_count": "0",
        "state": "ACTIVE",
        "technician_groups": [
            {
                "site": {
                    "id": "100000000000006792"
                },
                "deleted": false,
                "name": "Data Management",
                "id": "100000000000041029"
            },
            {
                "site": {
                    "id": "100000000000006792"
                },
                "deleted": false,
                "name": "App Development",
                "id": "100000000000041099"
            }
        ],
        "from_date": {
            "display_value": "Nov 20, 2024 11:51 AM",
            "value": "1732083706992"
        },
        "show_banner_until_expiry": true,
        "module": null,
        "is_followed": false,
        "isbannerenabled": true,
        "services": [
            {
                "image": "emp-onboarding",
                "inactive": false,
                "name": "Employee Onboarding",
                "description": "Requests related to new employee onboarding",
                "id": "100000000000040417",
                "sort_index": 0
            },
            {
                "image": "fin-management",
                "inactive": false,
                "name": "Feature Request",
                "description": "Requests related to new features or improvements",
                "id": "100000000000040419",
                "sort_index": 0
            }
        ],
        "priority": {
            "color": "#ff0000",
            "name": "High",
            "id": "100000000000006994"
        },
        "created_by": {
            "email_id": "admin@test.com",
            "is_technician": true,
            "sms_mail": null,
            "mobile": null,
            "last_name": "M",
            "user_scope": "internal_user",
            "sms_mail_id": null,
            "cost_per_hour": "0",
            "site": {
                "deleted": false,
                "name": "Base Site",
                "id": "100000000000006792",
                "is_default": true
            },
            "phone": null,
            "employee_id": null,
            "name": "Admin",
            "id": "100000000000040117",
            "photo_url": "https://contacts.csez.zohocorpin.com/file?exp=10&ID=15646919&t=user&height=60&width=60",
            "is_vip_user": false,
            "department": null,
            "first_name": "Admin",
            "job_title": null
        },
        "deleted": false,
        "comments_count": "0",
        "created_date": {
            "display_value": "Nov 20, 2024 12:00 PM",
            "value": "1732084223469"
        },
        "to": [
            "abc@test.com",
            "def.gh@test.com"
        ],
        "banner_style": {
            "bgcolor": "#4588f0",
            "fontcolor": "#001665",
            "ispriority_based": false,
            "iconname": "warning",
            "alignment": "center"
        },
        "user_groups": [
            {
                "name": "UG - 1",
                "id": "100000000000052003"
            },
            {
                "name": "UG - 2",
                "id": "100000000000052007"
            }
        ]
    }
}

编辑公告

此操作用于编辑公告。必填字段:公告 ID

网址

<service domain|custom domain>/app/<portal>/api/v3/announcements/{announcement_id}

属性

user_groups (user_group)
指示可以访问公告的用户组

user_groups (user_group)
指示可以访问公告的用户组

示例

{
  "user_groups": [
    {
      "name": "User group 1",
      "id": "1000000000000224445"
    }
  ]
}

banner_style (banner_style)
包含启用横幅时的横幅样式

banner_style (banner_style)
包含横幅样式详情

示例

{
  "banner_style": {
    "bgcolor": "#6dc5fa",
    "fontcolor": "#000000",
    "ispriority_based": false,
    "iconname": "info",
    "alignment": "left"
  }
}

(string)
通过电子邮件接收公告的电子邮件地址列表。

(string)
纯文本格式。 不允许富文本或换行符。

示例

Sample Content

created_date (datetime)read only
指示公告的创建日期

created_date (datetime)
以 JSON 对象表示的日期/时间。包含 value 和 display_value 属性。

value :以长格式表示的时间(自1970年1月1日以来的毫秒数)。

display_value :以用户个性化格式显示的可读时间。若未个性化,则使用默认格式。

comments_count (long)read only
指示公告的评论数量

comments_count (long)
被视为更大数值的数字位数。

示例

234759602834500

更多属性 全部展开

created_by (用户)read only

表示创建公告的技术人员

created_by (用户)
表示创建公告的技术人员

示例

{
  "created_by": {
    "email_id": "andrews@zmail.com",
    "name": "test-created_by",
    "id": "234567890123456"
  }
}

优先级 (优先级)

公告的优先级

优先级 (优先级)
表示公告的优先级

示例

{
  "priority": {
    "name": "test-priority",
    "id": "234567890123456"
  }
}

服务 (服务类别)

公告所属的服务类别

服务 (服务类别)
公告所属的服务类别

是否启用横幅 (布尔值)

表示公告是否启用横幅

是否启用横幅 (布尔值)
布尔值,可以有两个可能的值。值为 true 和 false。

是否关注 (布尔值)read only

表示用户是否关注该公告

是否关注 (布尔值)
布尔值,可以有两个可能的值。值为 true 和 false。

模块 (模块)

公告创建所属的模块

模块 (模块)

到期显示横幅 (布尔值)

表示是否应显示横幅直到截止日期

到期显示横幅 (布尔值)
布尔值,可以有两个可能的值。值为 true 和 false。

起始日期 (datetime)

表示公告的开始日期

起始日期 (datetime)
以 JSON 对象表示的日期/时间。包含 value 和 display_value 属性。

value :以长格式表示的时间(自1970年1月1日以来的毫秒数)。

display_value :以用户个性化格式显示的可读时间。若未个性化,则使用默认格式。

技术人员组 (组)

表示可以访问该公告的技术人员组

技术人员组 (组)
指示可以访问该公告的技术人员组

示例

{
  "technician_groups": [
    {
      "name": "Technician group 1",
      "id": "1000000000000223344"
    }
  ]
}

状态 (string)read only

基于开始和结束日期表示公告的状态

状态 (string)
纯文本格式。 不允许富文本或换行符。

示例

Sample Content

浏览次数 (long)read only

公告的浏览计数

浏览次数 (long)
被视为更大数值的数字位数。

示例

234759602834500

公告类型 (公告类型)

公告所属的公告类型

公告类型 (公告类型)
公告所属的公告类型

示例

{
  "announcement_type": {
    "name": "test-announcement_type",
    "id": "234567892123456"
  }
}

编号 (long)

用于唯一标识公告的标识符

编号 (long)
被视为更大数值的数字位数。

示例

234759602834500

发送邮件 (布尔值)

确定编辑操作是否应重新发送邮件

发送邮件 (布尔值)
布尔值,可以有两个可能的值。值为 true 和 false。

最后更新时间 (datetime)read only

表示公告的最后更新时间

最后更新时间 (datetime)
以 JSON 对象表示的日期/时间。包含 value 和 display_value 属性。

value :以长格式表示的时间(自1970年1月1日以来的毫秒数)。

display_value :以用户个性化格式显示的可读时间。若未个性化,则使用默认格式。

关联 (关联)

获取公告详细信息时包含的模块数据

关联 (关联)

截止日期 (datetime)

表示公告的结束日期

截止日期 (datetime)
以 JSON 对象表示的日期/时间。包含 value 和 display_value 属性。

value :以长格式表示的时间(自1970年1月1日以来的毫秒数)。

display_value :以用户个性化格式显示的可读时间。若未个性化,则使用默认格式。

最后更新者 (用户)read only

表示最近更新公告的用户

最后更新者 (用户)
表示最后一次更新公告的用户

示例

{
  "last_updated_by": {
    "email_id": "test_user@zmail.com",
    "name": "test_user",
    "id": "234567890123456"
  }
}

访问级别 (string)read only

表示公告的访问级别

访问级别 (string)
纯文本格式。 不允许富文本或换行符。

示例

Sample Content

标题 (string)

公告标题

标题 (string)
纯文本格式。 不允许富文本或换行符。

示例

Sample Content

是否有技术人员组 (布尔值)read only

表示公告是否包含技术人员组

是否有技术人员组 (布尔值)
布尔值,可以有两个可能的值。值为 true 和 false。

描述 (html)

公告内容

描述 (html)
HTML 是一个文本区域,可以使用 html 元素。

示例

<b>The content to be displayed</b>

是否向所有技术人员显示 (布尔值)

表示是否向所有技术人员共享该公告

是否向所有技术人员显示 (布尔值)
布尔值,可以有两个可能的值。值为 true 和 false。

是否向请求者显示 (布尔值)

表示公告是否对请求者可见

是否向请求者显示 (布尔值)
布尔值,可以有两个可能的值。值为 true 和 false。

是否有用户组 (布尔值)read only

表示公告是否包含用户组

是否有用户组 (布尔值)
布尔值,可以有两个可能的值。值为 true 和 false。

附件 (附件)

附加到公告的文件。最多可附加50个文件

附件 (附件)
附加到公告的文件

示例

{
  "attachments": [
    {
      "content_type": "application/x-unknown-mime-type",
      "size": "36171",
      "file_id": "4334",
      "name": "test_file.txt"
    }
  ]
}

横幅标签 (string)read only

表示横幅上显示的标签

横幅标签 (string)
纯文本格式。 不允许富文本或换行符。

示例

Sample Content

模板 (公告模板)

表示公告的模板 

模板 (公告模板)
表示公告的模板

示例

{
  "template": {
    "name": "General Announcement Template",
    "id": "100000000000034567"
  }
}

$ curl <service domain|custom domain>/app/<portal>/api/v3/announcements/{announcement_id}\
      -X PUT\ 
      -H "Accept: application/vnd.manageengine.sdp.v3+json"\
      -H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
      -H "Content-Type: application/x-www-form-urlencoded"\
      -d input_data='{
  "announcement": {
    "send_mail": true,
    "description": "<div class=\"personalize-wrapper\" style=\"font-family:&quot;PT Sans&quot;, Arial, Helvetica, sans-serif, sans-serif; font-size:13px\"><div class=\"personalize-wrapper\" style=\"font-family:&quot;PT Sans&quot;, Arial, Helvetica, sans-serif, sans-serif; font-size:13px\"><div><b>General Announcement</b> - <i>Description</i>&nbsp;&gt;&gt; 1<br></div></div><div><br></div></div>",
    "to_date": null,
    "to": [
      "def.gh@test.com"
    ],
    "technician_groups": [],
    "banner_style": {
      "bgcolor": "#6dc5fa",
      "fontcolor": "#000000",
      "ispriority_based": false,
      "iconname": "emergency",
      "alignment": "left"
    },
    "attachments": [
      {
        "id": "100000000000052069",
        "file_id": "3003"
      },
      {
        "file_id": "3005"
      }
    ],
    "title": "General Announcement - Title >> 1",
    "show_to_requester": true
  }
}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/announcements/{announcement_id}";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
           "Content-Type": "application/x-www-form-urlencoded",
           "Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = {
  "announcement": {
    "send_mail": true,
    "description": "<div class=\"personalize-wrapper\" style=\"font-family:&quot;PT Sans&quot;, Arial, Helvetica, sans-serif, sans-serif; font-size:13px\"><div class=\"personalize-wrapper\" style=\"font-family:&quot;PT Sans&quot;, Arial, Helvetica, sans-serif, sans-serif; font-size:13px\"><div><b>General Announcement</b> - <i>Description</i>&nbsp;&gt;&gt; 1<br></div></div><div><br></div></div>",
    "to_date": null,
    "to": [
      "def.gh@test.com"
    ],
    "technician_groups": [],
    "banner_style": {
      "bgcolor": "#6dc5fa",
      "fontcolor": "#000000",
      "ispriority_based": false,
      "iconname": "emergency",
      "alignment": "left"
    },
    "attachments": [
      {
        "id": "100000000000052069",
        "file_id": "3003"
      },
      {
        "file_id": "3005"
      }
    ],
    "title": "General Announcement - Title >> 1",
    "show_to_requester": true
  }
};
params = {"input_data": input_data};
response = invokeurl
[
    url: url
    type: PUT
    parameters: params
    headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/announcements/{announcement_id}"
$headers = @{"Accept": "application/vnd.manageengine.sdp.v3+json", 
          "Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx", 
          "Content-Type" : "application/x-www-form-urlencoded"}
$input_data = @'
{
  "announcement": {
    "send_mail": true,
    "description": "<div class=\"personalize-wrapper\" style=\"font-family:&quot;PT Sans&quot;, Arial, Helvetica, sans-serif, sans-serif; font-size:13px\"><div class=\"personalize-wrapper\" style=\"font-family:&quot;PT Sans&quot;, Arial, Helvetica, sans-serif, sans-serif; font-size:13px\"><div><b>General Announcement</b> - <i>Description</i>&nbsp;&gt;&gt; 1<br></div></div><div><br></div></div>",
    "to_date": null,
    "to": [
      "def.gh@test.com"
    ],
    "technician_groups": [],
    "banner_style": {
      "bgcolor": "#6dc5fa",
      "fontcolor": "#000000",
      "ispriority_based": false,
      "iconname": "emergency",
      "alignment": "left"
    },
    "attachments": [
      {
        "id": "100000000000052069",
        "file_id": "3003"
      },
      {
        "file_id": "3005"
      }
    ],
    "title": "General Announcement - Title >> 1",
    "show_to_requester": true
  }
}
'@
$data = @{ 'input_data' = $input_data}
$response = Invoke-RestMethod -Uri $url -Method put -Body $data -Headers $headers
$response
#Python version - 3.10
from urllib.error import HTTPError
from urllib.parse import urlencode
from urllib.request import urlopen,Request

url = "<service domain|custom domain>/app/<portal>/api/v3/announcements/{announcement_id}"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json", 
          "Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx", 
          "Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
  "announcement": {
    "send_mail": true,
    "description": "<div class=\"personalize-wrapper\" style=\"font-family:&quot;PT Sans&quot;, Arial, Helvetica, sans-serif, sans-serif; font-size:13px\"><div class=\"personalize-wrapper\" style=\"font-family:&quot;PT Sans&quot;, Arial, Helvetica, sans-serif, sans-serif; font-size:13px\"><div><b>General Announcement</b> - <i>Description</i>&nbsp;&gt;&gt; 1<br></div></div><div><br></div></div>",
    "to_date": null,
    "to": [
      "def.gh@test.com"
    ],
    "technician_groups": [],
    "banner_style": {
      "bgcolor": "#6dc5fa",
      "fontcolor": "#000000",
      "ispriority_based": false,
      "iconname": "emergency",
      "alignment": "left"
    },
    "attachments": [
      {
        "id": "100000000000052069",
        "file_id": "3003"
      },
      {
        "file_id": "3005"
      }
    ],
    "title": "General Announcement - Title >> 1",
    "show_to_requester": true
  }
}'''
data = urlencode({"input_data":input_data}).encode()
httprequest = Request(url, headers=headers,data=data, method="PUT")
try:
    with urlopen(httprequest) as response:
        print(response.read().decode())
except HTTPError as e:
    print(e.read().decode())
{
    "response_status": {
        "status_code": 2000,
        "status": "success"
    },
    "announcement": {
        "template": {
            "inactive": false,
            "name": "General Announcement Template",
            "id": "100000000000033852"
        },
        "attachments": [
            {
                "size": "388453",
                "content_type": "image/png",
                "file_id": "3005",
                "name": "SampleImage.png",
                "content_url": "/announcements/100000000000052059/_uploads/3005",
                "id": "100000000000052083"
            },
            {
                "size": "361693",
                "content_type": "image/png",
                "file_id": "3003",
                "name": "SamplePoster.png",
                "content_url": "/announcements/100000000000052059/_uploads/3003",
                "id": "100000000000052069"
            }
        ],
        "has_user_group": true,
        "show_to_requester": true,
        "show_to_all_technician": false,
        "description": "<div class=\"personalize-wrapper\" style=\"font-family:&quot;PT Sans&quot;, Arial, Helvetica, sans-serif, sans-serif; font-size:13px\"><div class=\"personalize-wrapper\" style=\"font-family:&quot;PT Sans&quot;, Arial, Helvetica, sans-serif, sans-serif; font-size:13px\"><div><b>General Announcement</b> - <i>Description</i>&nbsp;&gt;&gt; 1<br></div></div><div><br></div></div>",
        "has_technician_group": false,
        "title": "General Announcement - Title >> 1",
        "access_level": "SHARED",
        "last_updated_by": {
            "email_id": "admin@test.com",
            "is_technician": true,
            "sms_mail": null,
            "mobile": null,
            "last_name": "M",
            "user_scope": "internal_user",
            "sms_mail_id": null,
            "cost_per_hour": "0",
            "site": {
                "deleted": false,
                "name": "Base Site",
                "id": "100000000000006792",
                "is_default": true
            },
            "phone": null,
            "employee_id": null,
            "name": "Admin",
            "id": "100000000000040117",
            "photo_url": "https://contacts.zoho.com/file?exp=10&ID=2451342&t=user&height=60&width=60",
            "is_vip_user": false,
            "department": null,
            "first_name": "Admin",
            "job_title": null
        },
        "to_date": null,
        "rel": {
            "initiated_by_change": null,
            "initiated_by_release": null,
            "initiated_by_problem": null,
            "initiated_by_arc_request": null,
            "initiated_by_request": null
        },
        "last_updated_on": {
            "display_value": "Nov 20, 2024 01:31 PM",
            "value": "1732089698031"
        },
        "id": "100000000000052059",
        "announcement_type": {
            "name": "New Service Launched",
            "id": "100000000000034284"
        },
        "views_count": "0",
        "state": "ACTIVE",
        "technician_groups": [],
        "from_date": {
            "display_value": "Nov 20, 2024 11:51 AM",
            "value": "1732083706992"
        },
        "show_banner_until_expiry": true,
        "module": null,
        "is_followed": false,
        "isbannerenabled": true,
        "services": [
            {
                "image": "emp-onboarding",
                "inactive": false,
                "name": "Employee Onboarding",
                "description": "Requests related to new employee onboarding",
                "id": "100000000000040417",
                "sort_index": 0
            },
            {
                "image": "fin-management",
                "inactive": false,
                "name": "Feature Request",
                "description": "Requests related to new features or improvements",
                "id": "100000000000040419",
                "sort_index": 0
            }
        ],
        "priority": {
            "color": "#ff0000",
            "name": "High",
            "id": "100000000000006994"
        },
        "created_by": {
            "email_id": "admin@zohotest.com",
            "is_technician": true,
            "sms_mail": null,
            "mobile": null,
            "last_name": "M",
            "user_scope": "internal_user",
            "sms_mail_id": null,
            "cost_per_hour": "0",
            "site": {
                "deleted": false,
                "name": "Base Site",
                "id": "100000000000006792",
                "is_default": true
            },
            "phone": null,
            "employee_id": null,
            "name": "Admin",
            "id": "100000000000040117",
            "photo_url": "https://contacts.zoho.com/file?exp=10&ID=156242919&t=user&height=60&width=60",
            "is_vip_user": false,
            "department": null,
            "first_name": "Varadharajan",
            "job_title": null
        },
        "deleted": false,
        "comments_count": "0",
        "created_date": {
            "display_value": "Nov 20, 2024 12:00 PM",
            "value": "1732084223469"
        },
        "to": [
            "def.gh@zohotest.com"
        ],
        "banner_style": {
            "bgcolor": "#6dc5fa",
            "fontcolor": "#000000",
            "ispriority_based": false,
            "iconname": "emergency",
            "alignment": "left"
        },
        "user_groups": [
            {
                "name": "UG - 1",
                "id": "100000000000052003"
            },
            {
                "name": "UG - 2",
                "id": "100000000000052007"
            }
        ]
    }
}

获取公告

此操作用于获取单个公告的详细信息。必填字段:公告 ID。添加 input_data 并带有 increment_hit 可增加公告的浏览计数并更新用户的公告查看时间。

网址

<service domain|custom domain>/app/<portal>/api/v3/announcements/{announcement_id}

属性

user_groups (user_group)
指示可以访问公告的用户组

user_groups (user_group)
指示可以访问公告的用户组

示例

{
  "user_groups": [
    {
      "name": "User group 1",
      "id": "1000000000000224445"
    }
  ]
}

banner_style (banner_style)
包含启用横幅时的横幅样式

banner_style (banner_style)
包含横幅样式详情

示例

{
  "banner_style": {
    "bgcolor": "#6dc5fa",
    "fontcolor": "#000000",
    "ispriority_based": false,
    "iconname": "info",
    "alignment": "left"
  }
}

(string)
通过电子邮件接收公告的电子邮件地址列表。

(string)
纯文本格式。 不允许富文本或换行符。

示例

Sample Content

created_date (datetime)read only
指示公告的创建日期

created_date (datetime)
以 JSON 对象表示的日期/时间。包含 value 和 display_value 属性。

value :以长格式表示的时间(自1970年1月1日以来的毫秒数)。

display_value :以用户个性化格式显示的可读时间。若未个性化,则使用默认格式。

comments_count (long)read only
指示公告的评论数量

comments_count (long)
被视为更大数值的数字位数。

示例

234759602834500

更多属性 全部展开

created_by (用户)read only

表示创建公告的技术人员

created_by (用户)
表示创建公告的技术人员

示例

{
  "created_by": {
    "email_id": "andrews@zmail.com",
    "name": "test-created_by",
    "id": "234567890123456"
  }
}

优先级 (优先级)

公告的优先级

优先级 (优先级)
表示公告的优先级

示例

{
  "priority": {
    "name": "test-priority",
    "id": "234567890123456"
  }
}

服务 (服务类别)

公告所属的服务类别

服务 (服务类别)
公告所属的服务类别

是否启用横幅 (布尔值)

表示公告是否启用横幅

是否启用横幅 (布尔值)
布尔值,可以有两个可能的值。值为 true 和 false。

是否关注 (布尔值)read only

表示用户是否关注该公告

是否关注 (布尔值)
布尔值,可以有两个可能的值。值为 true 和 false。

模块 (模块)

公告创建所属的模块

模块 (模块)

到期显示横幅 (布尔值)

表示是否应显示横幅直到截止日期

到期显示横幅 (布尔值)
布尔值,可以有两个可能的值。值为 true 和 false。

起始日期 (datetime)

表示公告的开始日期

起始日期 (datetime)
以 JSON 对象表示的日期/时间。包含 value 和 display_value 属性。

value :以长格式表示的时间(自1970年1月1日以来的毫秒数)。

display_value :以用户个性化格式显示的可读时间。若未个性化,则使用默认格式。

技术人员组 (组)

表示可以访问该公告的技术人员组

技术人员组 (组)
指示可以访问该公告的技术人员组

示例

{
  "technician_groups": [
    {
      "name": "Technician group 1",
      "id": "1000000000000223344"
    }
  ]
}

状态 (string)read only

基于开始和结束日期表示公告的状态

状态 (string)
纯文本格式。 不允许富文本或换行符。

示例

Sample Content

浏览次数 (long)read only

公告的浏览计数

浏览次数 (long)
被视为更大数值的数字位数。

示例

234759602834500

公告类型 (公告类型)

公告所属的公告类型

公告类型 (公告类型)
公告所属的公告类型

示例

{
  "announcement_type": {
    "name": "test-announcement_type",
    "id": "234567892123456"
  }
}

编号 (long)

用于唯一标识公告的标识符

编号 (long)
被视为更大数值的数字位数。

示例

234759602834500

发送邮件 (布尔值)

确定编辑操作是否应重新发送邮件

发送邮件 (布尔值)
布尔值,可以有两个可能的值。值为 true 和 false。

最后更新时间 (datetime)read only

表示公告的最后更新时间

最后更新时间 (datetime)
以 JSON 对象表示的日期/时间。包含 value 和 display_value 属性。

value :以长格式表示的时间(自1970年1月1日以来的毫秒数)。

display_value :以用户个性化格式显示的可读时间。若未个性化,则使用默认格式。

关联 (关联)

获取公告详细信息时包含的模块数据

关联 (关联)

截止日期 (datetime)

表示公告的结束日期

截止日期 (datetime)
以 JSON 对象表示的日期/时间。包含 value 和 display_value 属性。

value :以长格式表示的时间(自1970年1月1日以来的毫秒数)。

display_value :以用户个性化格式显示的可读时间。若未个性化,则使用默认格式。

最后更新者 (用户)read only

表示最近更新公告的用户

最后更新者 (用户)
表示最后一次更新公告的用户

示例

{
  "last_updated_by": {
    "email_id": "test_user@zmail.com",
    "name": "test_user",
    "id": "234567890123456"
  }
}

访问级别 (string)read only

表示公告的访问级别

访问级别 (string)
纯文本格式。 不允许富文本或换行符。

示例

Sample Content

标题 (string)

公告标题

标题 (string)
纯文本格式。 不允许富文本或换行符。

示例

Sample Content

是否有技术人员组 (布尔值)read only

表示公告是否包含技术人员组

是否有技术人员组 (布尔值)
布尔值,可以有两个可能的值。值为 true 和 false。

描述 (html)

公告内容

描述 (html)
HTML 是一个文本区域,可以使用 html 元素。

示例

<b>The content to be displayed</b>

是否向所有技术人员显示 (布尔值)

表示是否向所有技术人员共享该公告

是否向所有技术人员显示 (布尔值)
布尔值,可以有两个可能的值。值为 true 和 false。

是否向请求者显示 (布尔值)

表示公告是否对请求者可见

是否向请求者显示 (布尔值)
布尔值,可以有两个可能的值。值为 true 和 false。

是否有用户组 (布尔值)read only

表示公告是否包含用户组

是否有用户组 (布尔值)
布尔值,可以有两个可能的值。值为 true 和 false。

附件 (附件)

附加到公告的文件。最多可附加50个文件

附件 (附件)
附加到公告的文件

示例

{
  "attachments": [
    {
      "content_type": "application/x-unknown-mime-type",
      "size": "36171",
      "file_id": "4334",
      "name": "test_file.txt"
    }
  ]
}

横幅标签 (string)read only

表示横幅上显示的标签

横幅标签 (string)
纯文本格式。 不允许富文本或换行符。

示例

Sample Content

模板 (公告模板)

表示公告的模板 

模板 (公告模板)
表示公告的模板

示例

{
  "template": {
    "name": "General Announcement Template",
    "id": "100000000000034567"
  }
}

$ curl -G <service domain|custom domain>/app/<portal>/api/v3/announcements/{announcement_id}\
      -X GET\
      -H "Accept: application/vnd.manageengine.sdp.v3+json"\
      -H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
      -H "Content-Type: application/x-www-form-urlencoded"
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/announcements/{announcement_id}";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
           "Content-Type": "application/x-www-form-urlencoded",
           "Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};          
response = invokeurl
[
    url: url
    type: GET
    headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/announcements/{announcement_id}"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
    "Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
    "Content-Type" = "application/x-www-form-urlencoded"}  
$response = Invoke-RestMethod -Uri $url -Method get -Headers $headers 
$response
#Python version - 3.8
#This script requires requests module installed in python.
from urllib.error import HTTPError
from urllib.parse import urlencode
from urllib.request import urlopen,Request

url = "<service domain|custom domain>/app/<portal>/api/v3/announcements/{announcement_id}"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json", 
          "Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx", 
          "Content-Type" : "application/x-www-form-urlencoded"}
httprequest = Request(url, headers=headers)
try:
    with urlopen(httprequest) as response:
        print(response.read().decode())
except HTTPError as e:
    print(e.read().decode())
{
  "response_status": {
    "status_code": 2000,
    "status": "success"
  },
  "announcement": {
    "template": {
      "inactive": false,
      "name": "General Announcement Template",
      "id": "100000000000033852"
    },
    "attachments": [
      {
        "size": "361693",
        "content_type": "image/png",
        "file_id": "3002",
        "name": "SamplePoster.png",
        "content_url": "/announcements/100000000000052011/_uploads/3002",
        "id": "100000000000052051"
      }
    ],
    "has_user_group": true,
    "show_to_requester": true,
    "show_to_all_technician": false,
    "description": "<div class=\"personalize-wrapper\" style=\"font-family:&quot;PT Sans&quot;, Arial, Helvetica, sans-serif, sans-serif; font-size:13px\"><div>General Announcement - Description<br></div></div>",
    "has_technician_group": true,
    "title": "General Announcement - Title",
    "access_level": "SHARED",
    "last_updated_by": {
      "email_id": "admin@test.com",
      "is_technician": true,
      "sms_mail": null,
      "mobile": null,
      "last_name": "M",
      "user_scope": "internal_user",
      "sms_mail_id": null,
      "cost_per_hour": "0",
      "site": {
        "deleted": false,
        "name": "Base Site",
        "id": "100000000000006792",
        "is_default": true
      },
      "phone": null,
      "employee_id": null,
      "name": "Admin",
      "id": "100000000000040117",
      "photo_url": "https://contacts.zoho.com/file?exp=10&ID=15646919&t=user&height=60&width=60",
      "is_vip_user": false,
      "department": null,
      "first_name": "Admin",
      "job_title": null
    },
    "to_date": {
      "display_value": "Dec 13, 2024 11:15 AM",
      "value": "1734068700000"
    },
    "last_updated_on": {
      "display_value": "Nov 20, 2024 11:16 AM",
      "value": "1732081587161"
    },
    "id": "100000000000052011",
    "announcement_type": {
      "name": "New Service Launched",
      "id": "100000000000034284"
    },
    "views_count": "3",
    "state": "ACTIVE",
    "technician_groups": [
      {
        "site": {
          "id": "100000000000006792"
        },
        "deleted": false,
        "name": "Data Management",
        "id": "100000000000041029"
      },
      {
        "site": {
          "id": "100000000000006792"
        },
        "deleted": false,
        "name": "Major Incident Team",
        "id": "100000000000041057"
      }
    ],
    "from_date": {
      "display_value": "Nov 19, 2024 05:49 PM",
      "value": "1732018796718"
    },
    "show_banner_until_expiry": true,
    "module": {
      "api_plural_name": "problems",
      "name": "problem",
      "display_name_plural": "sdp.module.pluralname.problem",
      "id": "100000000000005097",
      "display_name": "Problem",
      "category": "SYSTEM",
      "icon_name": null
    },
    "is_followed": false,
    "isbannerenabled": true,
    "services": [
      {
        "image": "email-server",
        "inactive": false,
        "name": "Email",
        "description": "Employee email service using Exchange.",
        "id": "100000000000008971",
        "sort_index": 0
      },
      {
        "image": "corporate-website",
        "inactive": false,
        "name": "Corporate Website",
        "description": "Our external website.",
        "id": "100000000000008983",
        "sort_index": 0
      },
      {
        "image": "emp-onboarding",
        "inactive": false,
        "name": "Employee Onboarding",
        "description": "Requests related to new employee onboarding",
        "id": "100000000000040417",
        "sort_index": 0
      }
    ],
    "priority": {
      "color": "#ff0000",
      "name": "High",
      "id": "100000000000006994"
    },
    "rel": {
      "initiated_by_problem": {
        "problem": {
          "display_id": {
            "display_value": "PB-4",
            "value": "4"
          },
          "id": "100000000000046364",
          "title": "Bugs in AIX production server",
          "customer": null
        },
        "id": "100000000000052073"
      }
    },
    "created_by": {
      "email_id": "varadharajan.mt@zohotest.com",
      "is_technician": true,
      "sms_mail": null,
      "mobile": null,
      "last_name": "M",
      "user_scope": "internal_user",
      "sms_mail_id": null,
      "cost_per_hour": "0",
      "site": {
        "deleted": false,
        "name": "Base Site",
        "id": "100000000000006792",
        "is_default": true
      },
      "phone": null,
      "employee_id": null,
      "name": "Varadharajan",
      "id": "100000000000040117",
      "photo_url": "https://contacts.zoho.com/file?exp=10&ID=15646919&t=user&height=60&width=60",
      "is_vip_user": false,
      "department": null,
      "first_name": "Varadharajan",
      "job_title": null
    },
    "deleted": false,
    "comments_count": "0",
    "created_date": {
      "display_value": "Nov 19, 2024 05:50 PM",
      "value": "1732018838556"
    },
    "to": [
      "abc@test.com",
      "def+gh@test.com"
    ],
    "banner_style": {
      "bgcolor": "#4588f0",
      "fontcolor": "#001665",
      "ispriority_based": false,
      "iconname": "warning",
      "alignment": "center"
    },
    "user_groups": [
      {
        "name": "UG - 1",
        "id": "100000000000052003"
      },
      {
        "name": "UG - 2",
        "id": "100000000000052007"
      }
    ]
  }
}

获取公告列表

此操作用于获取所有公告的详细信息。

网址

<service domain|custom domain>/app/<portal>/api/v3/announcements

属性

user_groups (user_group)
指示可以访问公告的用户组

user_groups (user_group)
指示可以访问公告的用户组

示例

{
  "user_groups": [
    {
      "name": "User group 1",
      "id": "1000000000000224445"
    }
  ]
}

banner_style (banner_style)
包含启用横幅时的横幅样式

banner_style (banner_style)
包含横幅样式详情

示例

{
  "banner_style": {
    "bgcolor": "#6dc5fa",
    "fontcolor": "#000000",
    "ispriority_based": false,
    "iconname": "info",
    "alignment": "left"
  }
}

created_date (datetime)read only
指示公告的创建日期

created_date (datetime)
以 JSON 对象表示的日期/时间。包含 value 和 display_value 属性。

value :以长格式表示的时间(自1970年1月1日以来的毫秒数)。

display_value :以用户个性化格式显示的可读时间。若未个性化,则使用默认格式。

comments_count (long)read only
指示公告的评论数量

comments_count (long)
被视为更大数值的数字位数。

示例

234759602834500

created_by (用户)read only
表示创建公告的技术人员

created_by (用户)
表示创建公告的技术人员

示例

{
  "created_by": {
    "email_id": "andrews@zmail.com",
    "name": "test-created_by",
    "id": "234567890123456"
  }
}

更多属性 全部展开

优先级 (优先级)

公告的优先级

优先级 (优先级)
表示公告的优先级

示例

{
  "priority": {
    "name": "test-priority",
    "id": "234567890123456"
  }
}

服务 (服务类别)

公告所属的服务类别

服务 (服务类别)
公告所属的服务类别

是否启用横幅 (布尔值)

表示公告是否启用横幅

是否启用横幅 (布尔值)
布尔值,可以有两个可能的值。值为 true 和 false。

是否关注 (布尔值)read only

表示用户是否关注该公告

是否关注 (布尔值)
布尔值,可以有两个可能的值。值为 true 和 false。

模块 (模块)

公告创建所属的模块

模块 (模块)

到期显示横幅 (布尔值)

表示是否应显示横幅直到截止日期

到期显示横幅 (布尔值)
布尔值,可以有两个可能的值。值为 true 和 false。

起始日期 (datetime)

表示公告的开始日期

起始日期 (datetime)
以 JSON 对象表示的日期/时间。包含 value 和 display_value 属性。

value :以长格式表示的时间(自1970年1月1日以来的毫秒数)。

display_value :以用户个性化格式显示的可读时间。若未个性化,则使用默认格式。

技术人员组 (组)

表示可以访问该公告的技术人员组

技术人员组 (组)
指示可以访问该公告的技术人员组

示例

{
  "technician_groups": [
    {
      "name": "Technician group 1",
      "id": "1000000000000223344"
    }
  ]
}

状态 (string)read only

基于开始和结束日期表示公告的状态

状态 (string)
纯文本格式。 不允许富文本或换行符。

示例

Sample Content

浏览次数 (long)read only

公告的浏览计数

浏览次数 (long)
被视为更大数值的数字位数。

示例

234759602834500

公告类型 (公告类型)

公告所属的公告类型

公告类型 (公告类型)
公告所属的公告类型

示例

{
  "announcement_type": {
    "name": "test-announcement_type",
    "id": "234567892123456"
  }
}

编号 (long)

用于唯一标识公告的标识符

编号 (long)
被视为更大数值的数字位数。

示例

234759602834500

发送邮件 (布尔值)

确定编辑操作是否应重新发送邮件

发送邮件 (布尔值)
布尔值,可以有两个可能的值。值为 true 和 false。

最后更新时间 (datetime)read only

表示公告的最后更新时间

最后更新时间 (datetime)
以 JSON 对象表示的日期/时间。包含 value 和 display_value 属性。

value :以长格式表示的时间(自1970年1月1日以来的毫秒数)。

display_value :以用户个性化格式显示的可读时间。若未个性化,则使用默认格式。

关联 (关联)

获取公告详细信息时包含的模块数据

关联 (关联)

截止日期 (datetime)

表示公告的结束日期

截止日期 (datetime)
以 JSON 对象表示的日期/时间。包含 value 和 display_value 属性。

value :以长格式表示的时间(自1970年1月1日以来的毫秒数)。

display_value :以用户个性化格式显示的可读时间。若未个性化,则使用默认格式。

最后更新者 (用户)read only

表示最近更新公告的用户

最后更新者 (用户)
表示最后一次更新公告的用户

示例

{
  "last_updated_by": {
    "email_id": "test_user@zmail.com",
    "name": "test_user",
    "id": "234567890123456"
  }
}

访问级别 (string)read only

表示公告的访问级别

访问级别 (string)
纯文本格式。 不允许富文本或换行符。

示例

Sample Content

标题 (string)

公告标题

标题 (string)
纯文本格式。 不允许富文本或换行符。

示例

Sample Content

描述 (html)

公告内容

描述 (html)
HTML 是一个文本区域,可以使用 html 元素。

示例

<b>The content to be displayed</b>

附件 (附件)

附加到公告的文件。最多可附加50个文件

附件 (附件)
附加到公告的文件

示例

{
  "attachments": [
    {
      "content_type": "application/x-unknown-mime-type",
      "size": "36171",
      "file_id": "4334",
      "name": "test_file.txt"
    }
  ]
}

$ curl -G <service domain|custom domain>/app/<portal>/api/v3/announcements\
      -X GET\ 
      -H "Accept: application/vnd.manageengine.sdp.v3+json"\
      -H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
      -H "Content-Type: application/x-www-form-urlencoded"\
      --data-urlencode input_data='{
  "list_info": {
    "row_count": 10,
    "start_index": 1,
    "fields_required": [
      "created_by",
      "isbannerenabled",
      "from_date",
      "to_date",
      "priority",
      "announcement_type",
      "views_count",
      "is_followed",
      "created_date",
      "last_updated_by",
      "last_updated_on",
      "state",
      "customer",
      "show_to_requester",
      "has_user_group",
      "show_to_all_technician",
      "module",
      "title",
      "access_level",
      "comments_count",
      "has_technician_group"
    ],
    "get_total_count": true,
    "filter_by": {
      "id": "0"
    },
    "sort_fields": [
      {
        "field": "from_date",
        "order": "desc"
      }
    ]
  }
}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/announcements";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
           "Content-Type": "application/x-www-form-urlencoded",
           "Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = {
  "list_info": {
    "row_count": 10,
    "start_index": 1,
    "fields_required": [
      "created_by",
      "isbannerenabled",
      "from_date",
      "to_date",
      "priority",
      "announcement_type",
      "views_count",
      "is_followed",
      "created_date",
      "last_updated_by",
      "last_updated_on",
      "state",
      "customer",
      "show_to_requester",
      "has_user_group",
      "show_to_all_technician",
      "module",
      "title",
      "access_level",
      "comments_count",
      "has_technician_group"
    ],
    "get_total_count": true,
    "filter_by": {
      "id": "0"
    },
    "sort_fields": [
      {
        "field": "from_date",
        "order": "desc"
      }
    ]
  }
};
params = {"input_data":input_data};           
response = invokeurl
[
    url: url
    type: GET
    parameters:params
    headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/announcements"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
    "Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
    "Content-Type" = "application/x-www-form-urlencoded"}
$input_data = @'{
  "list_info": {
    "row_count": 10,
    "start_index": 1,
    "fields_required": [
      "created_by",
      "isbannerenabled",
      "from_date",
      "to_date",
      "priority",
      "announcement_type",
      "views_count",
      "is_followed",
      "created_date",
      "last_updated_by",
      "last_updated_on",
      "state",
      "customer",
      "show_to_requester",
      "has_user_group",
      "show_to_all_technician",
      "module",
      "title",
      "access_level",
      "comments_count",
      "has_technician_group"
    ],
    "get_total_count": true,
    "filter_by": {
      "id": "0"
    },
    "sort_fields": [
      {
        "field": "from_date",
        "order": "desc"
      }
    ]
  }
}'@
$data = @{ 'input_data' = $input_data}    
$response = Invoke-RestMethod -Uri $url -Method get -Body $data -Headers $headers 
$response
#Python version - 3.8
#This script requires requests module installed in python.
from urllib.error import HTTPError
from urllib.parse import urlencode
from urllib.request import urlopen,Request

url = "<service domain|custom domain>/app/<portal>/api/v3/announcements"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json", 
          "Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx", 
          "Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
  "list_info": {
    "row_count": 10,
    "start_index": 1,
    "fields_required": [
      "created_by",
      "isbannerenabled",
      "from_date",
      "to_date",
      "priority",
      "announcement_type",
      "views_count",
      "is_followed",
      "created_date",
      "last_updated_by",
      "last_updated_on",
      "state",
      "customer",
      "show_to_requester",
      "has_user_group",
      "show_to_all_technician",
      "module",
      "title",
      "access_level",
      "comments_count",
      "has_technician_group"
    ],
    "get_total_count": true,
    "filter_by": {
      "id": "0"
    },
    "sort_fields": [
      {
        "field": "from_date",
        "order": "desc"
      }
    ]
  }
}'''       
url += "?" + urlencode({"input_data":input_data})
httprequest = Request(url, headers=headers)
try:
    with urlopen(httprequest) as response:
        print(response.read().decode())
except HTTPError as e:
    print(e.read().decode())
{
  "response_status": [
    {
      "status_code": 2000,
      "status": "success"
    }
  ],
  "list_info": {
    "sort_fields": [
      {
        "field": "from_date",
        "order": "desc"
      }
    ],
    "has_more_rows": false,
    "start_index": 1,
    "fields_required": [
      "created_by",
      "isbannerenabled",
      "from_date",
      "to_date",
      "priority",
      "announcement_type",
      "views_count",
      "is_followed",
      "created_date",
      "last_updated_by",
      "last_updated_on",
      "state",
      "customer",
      "show_to_requester",
      "has_user_group",
      "show_to_all_technician",
      "module",
      "title",
      "access_level",
      "comments_count",
      "has_technician_group"
    ],
    "total_count": 3,
    "filter_by": "{\"id\":\"0\"}",
    "page": 1,
    "get_total_count": "true",
    "row_count": 3
  },
  "announcements": [
    {
      "has_user_group": true,
      "from_date": {
        "display_value": "Nov 20, 2024 11:51 AM",
        "value": "1732083706992"
      },
      "module": null,
      "is_followed": false,
      "show_to_requester": true,
      "show_to_all_technician": false,
      "has_technician_group": false,
      "isbannerenabled": true,
      "priority": {
        "color": "#ff0000",
        "name": "High",
        "id": "100000000000006994"
      },
      "title": "General Announcement - Title >> 1",
      "created_by": {
        "email_id": "admin@test.com",
        "is_technician": true,
        "sms_mail": null,
        "mobile": null,
        "last_name": "M",
        "user_scope": "internal_user",
        "sms_mail_id": null,
        "cost_per_hour": "0",
        "site": {
          "deleted": false,
          "name": "Base Site",
          "id": "100000000000006792",
          "is_default": true
        },
        "phone": null,
        "employee_id": null,
        "name": "Admin",
        "id": "100000000000040117",
        "photo_url": "https://contacts.zoho.com/file?exp=10&ID=15646919&t=user&height=60&width=60",
        "is_vip_user": false,
        "department": null,
        "first_name": "Admin",
        "job_title": null
      },
      "access_level": "SHARED",
      "last_updated_by": {
        "email_id": "admin@test.com",
        "is_technician": true,
        "sms_mail": null,
        "mobile": null,
        "last_name": "M",
        "user_scope": "internal_user",
        "sms_mail_id": null,
        "cost_per_hour": "0",
        "site": {
          "deleted": false,
          "name": "Base Site",
          "id": "100000000000006792",
          "is_default": true
        },
        "phone": null,
        "employee_id": null,
        "name": "Admin",
        "id": "100000000000040117",
        "photo_url": "https://contacts.zoho.com/file?exp=10&ID=15646919&t=user&height=60&width=60",
        "is_vip_user": false,
        "department": null,
        "first_name": "Admin",
        "job_title": null
      },
      "to_date": null,
      "comments_count": "0",
      "last_updated_on": {
        "display_value": "Nov 20, 2024 01:31 PM",
        "value": "1732089698031"
      },
      "id": "100000000000052059",
      "announcement_type": {
        "name": "New Service Launched",
        "id": "100000000000034284"
      },
      "views_count": "0",
      "created_date": {
        "display_value": "Nov 20, 2024 12:00 PM",
        "value": "1732084223469"
      },
      "state": "ACTIVE"
    },
    {
      "has_user_group": true,
      "from_date": {
        "display_value": "Nov 19, 2024 05:49 PM",
        "value": "1732018796718"
      },
      "module": null,
      "is_followed": false,
      "show_to_requester": true,
      "show_to_all_technician": false,
      "has_technician_group": true,
      "isbannerenabled": true,
      "priority": {
        "color": "#ff0000",
        "name": "High",
        "id": "100000000000006994"
      },
      "title": "General Announcement - Title >> 2",
      "created_by": {
        "email_id": "admin2@zohotest.com",
        "is_technician": true,
        "sms_mail": null,
        "mobile": null,
        "last_name": "M",
        "user_scope": "internal_user",
        "sms_mail_id": null,
        "cost_per_hour": "0",
        "site": {
          "deleted": false,
          "name": "Base Site",
          "id": "100000000000006792",
          "is_default": true
        },
        "phone": null,
        "employee_id": null,
        "name": "admin2",
        "id": "100000000000040117",
        "photo_url": "https://contacts.zoho.com/file?exp=10&ID=15646919&t=user&height=60&width=60",
        "is_vip_user": false,
        "department": null,
        "first_name": "admin2",
        "job_title": null
      },
      "access_level": "SHARED",
      "last_updated_by": {
        "email_id": "admin@test.com",
        "is_technician": true,
        "sms_mail": null,
        "mobile": null,
        "last_name": "M",
        "user_scope": "internal_user",
        "sms_mail_id": null,
        "cost_per_hour": "0",
        "site": {
          "deleted": false,
          "name": "Base Site",
          "id": "100000000000006792",
          "is_default": true
        },
        "phone": null,
        "employee_id": null,
        "name": "Admin",
        "id": "100000000000040117",
        "photo_url": "https://contacts.zoho.com/file?exp=10&ID=15646919&t=user&height=60&width=60",
        "is_vip_user": false,
        "department": null,
        "first_name": "Admin",
        "job_title": null
      },
      "to_date": {
        "display_value": "Dec 13, 2024 11:15 AM",
        "value": "1734068700000"
      },
      "comments_count": "0",
      "last_updated_on": {
        "display_value": "Nov 20, 2024 01:37 PM",
        "value": "1732090042419"
      },
      "id": "100000000000052011",
      "announcement_type": {
        "name": "New Service Launched",
        "id": "100000000000034284"
      },
      "views_count": "3",
      "created_date": {
        "display_value": "Nov 19, 2024 05:50 PM",
        "value": "1732018838556"
      },
      "state": "ACTIVE"
    },
    {
      "has_user_group": false,
      "from_date": {
        "display_value": "Nov 17, 2024 09:39 PM",
        "value": "1731859747561"
      },
      "module": {
        "api_plural_name": "requests",
        "name": "request",
        "display_name_plural": "sdp.module.pluralname.request",
        "id": "100000000000005074",
        "display_name": "Request",
        "category": "SYSTEM",
        "icon_name": null
      },
      "is_followed": false,
      "show_to_requester": false,
      "show_to_all_technician": false,
      "has_technician_group": true,
      "isbannerenabled": true,
      "priority": null,
      "title": "Announcement Template 1 - Title",
      "created_by": {
        "email_id": "admin2.mt@zohotest.com",
        "is_technician": true,
        "sms_mail": null,
        "mobile": null,
        "last_name": "M",
        "user_scope": "internal_user",
        "sms_mail_id": null,
        "cost_per_hour": "0",
        "site": {
          "deleted": false,
          "name": "Base Site",
          "id": "100000000000006792",
          "is_default": true
        },
        "phone": null,
        "employee_id": null,
        "name": "admin2",
        "id": "100000000000040117",
        "photo_url": "https://contacts.zoho.com/file?exp=10&ID=15646919&t=user&height=60&width=60",
        "is_vip_user": false,
        "department": null,
        "first_name": "admin2",
        "job_title": null
      },
      "access_level": "SHARED",
      "last_updated_by": {
        "email_id": "admin2.mt@zohotest.com",
        "is_technician": true,
        "sms_mail": null,
        "mobile": null,
        "last_name": "M",
        "user_scope": "internal_user",
        "sms_mail_id": null,
        "cost_per_hour": "0",
        "site": {
          "deleted": false,
          "name": "Base Site",
          "id": "100000000000006792",
          "is_default": true
        },
        "phone": null,
        "employee_id": null,
        "name": "admin2",
        "id": "100000000000040117",
        "photo_url": "https://contacts.zoho.com/file?exp=10&ID=15646919&t=user&height=60&width=60",
        "is_vip_user": false,
        "department": null,
        "first_name": "admin2",
        "job_title": null
      },
      "to_date": null,
      "comments_count": "0",
      "last_updated_on": {
        "display_value": "Nov 20, 2024 01:38 PM",
        "value": "1732090081603"
      },
      "id": "100000000000050316",
      "announcement_type": null,
      "views_count": "1",
      "created_date": {
        "display_value": "Nov 17, 2024 09:39 PM",
        "value": "1731859752475"
      },
      "state": "ACTIVE"
    }
  ]
}

删除公告

此操作用于删除公告。

网址

<service domain|custom domain>/app/<portal>/api/v3/announcements/{announcement_id}

$ curl <service domain|custom domain>/app/<portal>/api/v3/announcements/{announcement_id}\
      -X DELETE\ 
      -H "Accept: application/vnd.manageengine.sdp.v3+json"\
      -H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
      -H "Content-Type: application/x-www-form-urlencoded"
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/announcements/{announcement_id}";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
           "Content-Type": "application/x-www-form-urlencoded",
           "Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
response = invokeurl
[
    url: url
    type: DELETE
    headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/announcements/{announcement_id}"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
    "Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
    "Content-Type" = "application/x-www-form-urlencoded"}
$response = Invoke-RestMethod -Uri $url -Method delete -Headers $headers
$response
#Python version - 3.10
from urllib.error import HTTPError
from urllib.request import urlopen,Request

url = "<service domain|custom domain>/app/<portal>/api/v3/announcements/{announcement_id}"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json", 
          "Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx", 
          "Content-Type" : "application/x-www-form-urlencoded"}
httprequest = Request(url, headers=headers,method="DELETE")
try:
    with urlopen(httprequest) as response:
        print(response.read().decode())
except HTTPError as e:
    print(e.read().decode())
{
  "response_status": {
    "status_code": 2000,
    "status": "success"
  }
}

关注公告

此操作用于关注特定公告

网址

<service domain|custom domain>/app/<portal>/api/v3/announcements/{announcement_id}/follows/_follow

$ curl <service domain|custom domain>/app/<portal>/api/v3/announcements/{announcement_id}/follows/_follow\
      -X POST\ 
      -H "Accept: application/vnd.manageengine.sdp.v3+json"\
      -H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
      -H "Content-Type: application/x-www-form-urlencoded"\
      -d input_data=''
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/announcements/{announcement_id}/follows/_follow";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
           "Content-Type": "application/x-www-form-urlencoded",
           "Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = ;
params = {"input_data": input_data};
response = invokeurl
[
    url: url
    type: POST
    parameters: params
    headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/announcements/{announcement_id}/follows/_follow"
$headers = @{"Accept": "application/vnd.manageengine.sdp.v3+json", 
          "Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx", 
          "Content-Type" : "application/x-www-form-urlencoded"}
$input_data = @'

'@
$data = @{ 'input_data' = $input_data}
$response = Invoke-RestMethod -Uri $url -Method post -Body $data -Headers $headers
$response
#Python version - 3.10
from urllib.error import HTTPError
from urllib.parse import urlencode
from urllib.request import urlopen,Request

url = "<service domain|custom domain>/app/<portal>/api/v3/announcements/{announcement_id}/follows/_follow"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json", 
          "Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx", 
          "Content-Type" : "application/x-www-form-urlencoded"}
input_data = ''''''
data = urlencode({"input_data":input_data}).encode()
httprequest = Request(url, headers=headers,data=data, method="POST")
try:
    with urlopen(httprequest) as response:
        print(response.read().decode())
except HTTPError as e:
    print(e.read().decode())
{
  "response_status": {
    "status_code": 2000,
    "status": "success"
  },
  "follow": {
    "follower": {
      "email_id": "admin.mt@test.com",
      "is_technician": true,
      "sms_mail": null,
      "contact_info_id": "100000000000040115",
      "mobile": null,
      "last_name": "M",
      "user_scope": "internal_user",
      "sms_mail_id": null,
      "cost_per_hour": "0",
      "site": {
        "deleted": false,
        "name": "Base Site",
        "id": "100000000000006792",
        "is_default": true,
        "customer": null
      },
      "phone": null,
      "employee_id": null,
      "name": "admin",
      "id": "100000000000040117",
      "photo_url": "https://contacts.zoho.com/file?exp=10&ID=15646919&t=user&height=60&width=60",
      "is_vip_user": false,
      "department": null,
      "first_name": "admin",
      "job_title": null,
      "customer": null
    },
    "performed_by": {
      "email_id": "admin.mt@test.com",
      "is_technician": true,
      "sms_mail": null,
      "contact_info_id": "100000000000040115",
      "mobile": null,
      "last_name": "M",
      "user_scope": "internal_user",
      "sms_mail_id": null,
      "cost_per_hour": "0",
      "site": {
        "deleted": false,
        "name": "Base Site",
        "id": "100000000000006792",
        "is_default": true,
        "customer": null
      },
      "phone": null,
      "employee_id": null,
      "name": "admin",
      "id": "100000000000040117",
      "photo_url": "https://contacts.zoho.com/file?exp=10&ID=15646919&t=user&height=60&width=60",
      "is_vip_user": false,
      "department": null,
      "first_name": "admin",
      "job_title": null,
      "customer": null
    },
    "module": {
      "api_plural_name": "announcements",
      "name": "announcement",
      "display_name_plural": "sdp.home.announcement.label",
      "id": "100000000000005134",
      "display_name": "Announcement",
      "category": "SYSTEM",
      "icon_name": null
    },
    "followed_time": {
      "display_value": "Nov 20, 2024 01:46 PM",
      "value": "1732090566577"
    },
    "id": "100000000000052133",
    "entity_id": "100000000000052059"
  }
}

取消关注公告

此操作用于取消关注特定公告

网址

<service domain|custom domain>/app/<portal>/api/v3/announcements/{announcement_id}/follows/_unfollow

$ curl <service domain|custom domain>/app/<portal>/api/v3/announcements/{announcement_id}/follows/_unfollow\
      -X DELETE\ 
      -H "Accept: application/vnd.manageengine.sdp.v3+json"\
      -H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
      -H "Content-Type: application/x-www-form-urlencoded"
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/announcements/{announcement_id}/follows/_unfollow";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
           "Content-Type": "application/x-www-form-urlencoded",
           "Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
response = invokeurl
[
    url: url
    type: DELETE
    headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/announcements/{announcement_id}/follows/_unfollow"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
    "Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
    "Content-Type" = "application/x-www-form-urlencoded"}
$response = Invoke-RestMethod -Uri $url -Method delete -Headers $headers
$response
#Python version - 3.10
from urllib.error import HTTPError
from urllib.request import urlopen,Request

url = "<service domain|custom domain>/app/<portal>/api/v3/announcements/{announcement_id}/follows/_unfollow"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json", 
          "Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx", 
          "Content-Type" : "application/x-www-form-urlencoded"}
httprequest = Request(url, headers=headers,method="DELETE")
try:
    with urlopen(httprequest) as response:
        print(response.read().decode())
except HTTPError as e:
    print(e.read().decode())
{
  "response_status": {
    "status_code": 2000,
    "status": "success"
  }
}

向公告添加附件

此操作用于为公告添加附件。输入必须为 multipart - form 数据。必填字段:filename

必填字段:filename

网址

<service domain|custom domain>/app/<portal>/api/v3/announcements/{announcement_id}/_uploads

属性

文件名 (文件)
上传的文件路径必须以 '@' 开头。

文件名 (文件)
上传的文件名。

示例

test-document.txt

添加为附件 (布尔值)
表示是否将文件作为附件添加到关联实体。

添加为附件 (布尔值)
布尔值,可以有两个可能的值。

示例

True or False

文件 (文件集)
文件的详细信息包含在这里。
显示属性

文件 (文件集)
包含已上传文件的信息。

示例

{
  "size": "601",
  "content_type": "application/unknown-mime-type",
  "file_id": "6003",
  "name": "test-document.txt",
  "content_url": "<file path>"
  "id": "17322245500049868"
}

大小 (长整数)
上传文件的大小。

大小 (长整数)
被认为具有较大数值的数字。

示例

234759602834500

内容类型 (字符串)
文件内容的类型。

内容类型 (字符串)
纯文本格式。 不允许富文本或换行符。

示例

Sample Content

文件 ID (长整数)
文件 ID 用于将该文件作为附件添加到实体

文件 ID (长整数)
被认为具有较大数值的数字。

示例

234759602834500

名称 (字符串)
文件的名称。

名称 (字符串)
纯文本格式。 不允许富文本或换行符。

示例

Sample Content

内容 URL (字符串)
上传文件的 URL。

内容 URL (字符串)
纯文本格式。 不允许富文本或换行符。

示例

Sample Content

$ curl <service domain|custom domain>/app/<portal>/api/v3/announcements/{announcement_id}/_uploads\
      -X POST\
      -H "Accept: application/vnd.manageengine.sdp.v3+json"\
      -H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
      -H "Content-Type: multipart/form-data"\
      -F "filename=@local_file_path" -F "addtoattachment=true"\
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/announcements/{announcement_id}/_uploads";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
           "Content-Type": "multipart/form-data",
           "Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
file_list = List();
param1 = {"paramName":"filename", "content":"local_file_path"};   
file_list.add(param1);                 
response = invokeurl
[
    url: url
    type: POST
    headers: headers
    files: file_list 
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/announcements/{announcement_id}/_uploads"
$filePath = "local_file_path"                    
$addtoattachment = "true"

$boundary = [System.Guid]::NewGuid().ToString()
$headers = @{
    "Accept" = "application/vnd.manageengine.sdp.v3+json"
    "Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
    "Content-Type" = "multipart/form-data; boundary=`"$boundary`""
}

$content = [System.Text.Encoding]::GetEncoding('iso-8859-1').GetString([System.IO.File]::ReadAllBytes($filePath))
$body = (
    "--$boundary",
    "Content-Disposition: form-data; name=`"addtoattachment`"`r`n",
    "$addtoattachment",
    "--$boundary",
    "Content-Disposition: form-data; name=`"filename`"; filename=`"$(Split-Path $filePath -Leaf)`"",
    "Content-Type: $([System.Web.MimeMapping]::GetMimeMapping($filePath))`r`n",
    $content,
    "--$boundary--`r`n"
) -join "`r`n"
$response = Invoke-RestMethod -Uri $url -Method post -Headers $headers -Body $body
$response
#Python version - 3.10
from urllib.error import HTTPError
from urllib.request import Request,urlopen
import mimetypes
import ntpath
import uuid

url = "<service domain|custom domain>/app/<portal>/api/v3/announcements/{announcement_id}/_uploads"
file_path = "local_file_path"
add_to_attachments = "true"

boundary = uuid.uuid4()
headers = {
    "Content-Type": f"multipart/form-data; boundary={boundary}",
    "Accept": "application/vnd.manageengine.sdp.v3+json",
    "Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
}

with open(file_path, "rb") as f:
    content = f.read()
body = (
    bytes(f'--{boundary}\r\nContent-Disposition: form-data; name="addtoattachment"\r\n\r\n{add_to_attachments}\r\n', "utf-8")
    + bytes(f'--{boundary}\r\nContent-Disposition: form-data; name="filename"; filename="{ntpath.basename(file_path)}"\r\nContent-Type: {mimetypes.guess_type(file_path)[0] or "application/octet-stream"}\r\n\r\n', "utf-8")
    + content
    + bytes(f"\r\n--{boundary}--", "utf-8")
)

httprequest = Request(url, data=body, headers=headers)
try:
    with urlopen(httprequest) as response:
        print(response.read().decode("utf-8"))
except HTTPError as e:
    print(e.read().decode())
{
    "response_status": [
        {
            "status_code": 2000,
            "status": "success"
        }
    ],
    "files": [
        {
            "content_type": "image/png",
            "size": "388453",
            "file_id": "3005",
            "name": "testPoster.png",
            "content_url": "/announcements/_uploads/3005"
        }
    ]
}