Add a Custom Time Zone

Add a custom time zone.

Request URL

POST {base_url}/{api_path}/timezone/create?access_token={access_token}

Request parameters

Parameter Required Type Description
name Yes String The name of the time zone.
timezone Yes String The time zone information, including the UTC offset and identifier.
Note: You can query the available time zones using the Get Menu Options interface (menu set to timezone).
enable_dst No Integer Whether to enable daylight saving time.

Valid value:

  • 0: Disabled.
  • 1: Enabled.
assign_extension No Array<Assign_Ext> A list of objects assigned to use the time zone.
Assign_Ext
Parameter Required Type Description
type Yes String The type of associated object.

Valid value:

  • extension: Extension.
  • ext_group: Extension group.
  • organization: Organization.
id Yes Integer The ID of the extension, extension group, or organization.
Note: You can query the IDs using the following interfaces:

Response parameters

Parameter Type Description
errcode Integer Returned error code.
  • 0: Succeed.
  • Non-zero value: Failed.
Note: You can check the error code and error message in Error Code and Error Message.
errmsg String Returned message.
  • SUCCESS: Succeed.
  • FAILURE: Failed.
id Integer The ID of the created time zone.
reboot Integer Whether a system reboot is required.
Note: A system reboot is required for the custom time zone to take effect. This parameter is fixed to 1 when the creation succeeds.
  • 0: No reboot required.
  • 1: Reboot required.

Example

Request example

POST /openapi/v1.0/timezone/create?access_token=gwakjgu9ZBUfz36wql4ndsVKkryI0kdj HTTP/1.1

Host: yeastardocs.example.yeastarcloud.com
Content-Type: application/json
{
  "name": "Shanghai",
  "timezone": "UTC+8 Asia/Shanghai",
  "enable_dst": 0
}

Response example

HTTP/1.1 200 OK
{
  "errcode": 0,
  "errmsg": "SUCCESS",
  "submsg": "",
  "id": 3,
  "reboot": 1
}