Add a Business Hours Profile

Adds a business hours profile. A profile defines the business hours of the 7 days of the week and is referenced by time-based routing.

Request URL

POST {base_url}/uc-cconfig/api/v1/business-hours-profiles

Request parameters

Headers
Parameter Required Type Description
Authorization Yes String The access token used for authentication.

Format: Bearer {access_token}.

x-tenant-code No String The tenant name.
Note: You can obtain tenant name using the Query Tenants interface.
Body parameters
Parameter Required Type Description
name No String The name of the profile, which must be unique within the tenant. The value ranges from 1 to 255 characters.
timeZoneId No String The time zone of the profile in the "offset + IANA" display format, such as UTC+8 Asia/Shanghai.
daylightSavingEnabled No Boolean

Whether daylight saving time is enabled.

Valid value:

  • true: Enabled.
  • false: Disabled.
remark No String The remark of the profile.
businessHours No Array<Business_Hours_Day_Input> The business hours of the 7 days of the week.
statusSwitchCode No String The status switch code. If not specified, it is generated by the system as prefix + sequence.
Business_Hours_Day_Input
Parameter Required Type Description
weekday No String

The day of the week.

Valid value:

  • SUN
  • MON
  • TUE
  • WED
  • THU
  • FRI
  • SAT
enabled No Boolean

Whether this day has business hours.

Valid value:

  • true: Enabled.
  • false: Disabled.
fullDay No Boolean

Whether the whole day is business hours.

Valid value:

  • true: The whole day.
  • false: Only the time segments.
segments No Array<Time_Segment> The list of business hour segments of this day.
Time_Segment
Parameter Required Type Description
start No String The start time of the segment in HH:mm format.
end No String The end time of the segment in HH:mm format.

Response parameters

Parameter Type Description
requestId String The unique ID of the request, which can be used to quickly locate the request.
code String The HTTP status code of the request.
  • 200: Request succeeded.
  • Non-200 value: Request failed.
message String The status message of the request.
detailMessage String The detailed error information.

When the request is successful, this parameter returns empty.

result Object<Business_Hours_Profile> The added business hours profile.
Business_Hours_Profile
Parameter Type Description
id String The ID of the business hours profile.
name String The name of the profile, which is unique within the tenant.
timeZoneId String The time zone of the profile in the "offset + IANA" display format, such as UTC+8 Asia/Shanghai.
daylightSavingEnabled Boolean

Whether daylight saving time is enabled.

  • true: Enabled.
  • false: Disabled.
currentUtcOffset String The UTC offset in effect right now in ISO 8601 format, such as +08:00.
remark String The remark of the profile.
statusSwitchCode String The status switch code, which is generated by the system as prefix + sequence.
businessHours Array<Business_Hours_Day> The business hours of the 7 days of the week.
Business_Hours_Day
Parameter Type Description
weekday String

The day of the week:

  • SUN
  • MON
  • TUE
  • WED
  • THU
  • FRI
  • SAT
enabled Boolean

Whether this day has business hours.

  • true: Enabled.
  • false: Disabled.
fullDay Boolean

Whether the whole day is business hours.

  • true: The whole day.
  • false: Only the time segments.
segments Array<Time_Segment> The list of business hour segments of this day.
Time_Segment
Parameter Type Description
start String The start time of the segment in HH:mm format.
end String The end time of the segment in HH:mm format.

Example

Request example

POST /uc-cconfig/api/v1/business-hours-profiles HTTP/1.1
Host: api.cn.novoone.com
Authorization: Bearer eyJraWQiOiJjbi0wLWtleS0xIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiIxMDAwQGNvbG9ydGVzdDIiLCJncmFudF90eXBlIjoicGFzc3dvcmQiLCJ1c2VyX25hbWUiOiIxMDAwQGNvbG9ydGVzdDIiLCJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiY2xpZW50X2V4dCI6eyJkZXNjcmlwdGlvbiI6IueuoeeQhuWQjuWPsFdlYuW6lOeUqCIsInBsYXRmb3JtIjoid2ViIn0sImV4cCI6MTc5MzYyMjY0NCwiaWF0IjoxNzkzNjAxMDQ0LCJqdGkiOiIyMzU2N2JhMC02MDFmLTQxNDMtYTFjNy1iOWM2MzUwZjgyMmIiLCJjbGllbnRfaWQiOiJub3ZvLWFkbWluLXdlYiIsInNpZCI6ImM4Mjg2MjNhLTVkZGYtNGExYS1iOWQ4LWJmNzY5YmMzYmQyZiIsInVzZXJfZXh0Ijp7InJvbGVJZHMiOlsxMDJdLCJwdWlkIjozMDc2OTEzNjQ0OTE1OTk4NzIwLCJ0ZW5hbnRJZCI6MjA3OTUwNDIwNTMwOTE5NDI0MSwicGFyZW50VWNJZCI6MzA3NjkxMzY0NDg5MDgzMjg5NiwidGVuYW50Q29kZSI6ImNvbG9ydGVzdDIiLCJ0eXBlIjoiVF9VU0VSIiwidXNlcklkIjoyMDc5NzQ2OTE1Mzg4MDc2MDMzLCJlbWFpbCI6Imxlb0BzYW1wbGUuY29tIiwidXNlcm5hbWUiOiIxMDAwQGNvbG9ydGVzdDIiLCJ1Y0lkIjozMDc2OTEzNjQ0ODkwODMyODk2fX0.yjIo4A2kQM7UM_y8eHTgjqDmSnJwwPnRZskKLRBM9WXO8e35wlCgiEl92qdKEVF-T5iHDAi9wgoEAfZgvTT8sAb4VmdMjV3e-V--VxGpKpzTzcrxrA_GMQaHq-VjCskLINTP-DTVOHdMB3o46Sk3Rg8S2qv2zEI1W58WWHJaTuJu27msNcJEiixhXvvq6eqE2nw_ZZzWsCMlRItTu053nLTLrFfPOPKvS7CUXGNi9bkfqC5autEZQz1jG81wli4CKS7AbMS0f5gumsh6Lbat2RZgu6wj3fywkONhvfk-lRD4V21Jqi_VGbEXxMbanRG1TrmrEok7woZ037Lyf4MBNQ
x-tenant-code: jint
Content-Type: application/json
{
  "name": "doc-test-profile",
  "timeZoneId": "UTC+8 Asia/Shanghai",
  "daylightSavingEnabled": false,
  "remark": "Created for doc testing.",
  "businessHours": [
    {
      "weekday": "MON",
      "enabled": true,
      "fullDay": false,
      "segments": [
        {
          "start": "09:00",
          "end": "18:00"
        }
      ]
    },
    {
      "weekday": "TUE",
      "enabled": true,
      "fullDay": false,
      "segments": [
        {
          "start": "09:00",
          "end": "18:00"
        }
      ]
    },
    {
      "weekday": "WED",
      "enabled": true,
      "fullDay": false,
      "segments": [
        {
          "start": "09:00",
          "end": "18:00"
        }
      ]
    },
    {
      "weekday": "THU",
      "enabled": true,
      "fullDay": false,
      "segments": [
        {
          "start": "09:00",
          "end": "18:00"
        }
      ]
    },
    {
      "weekday": "FRI",
      "enabled": true,
      "fullDay": false,
      "segments": [
        {
          "start": "09:00",
          "end": "18:00"
        }
      ]
    },
    {
      "weekday": "SAT",
      "enabled": false,
      "fullDay": false,
      "segments": [
        {
          "start": "09:00",
          "end": "18:00"
        }
      ]
    },
    {
      "weekday": "SUN",
      "enabled": false,
      "fullDay": false,
      "segments": [
        {
          "start": "09:00",
          "end": "18:00"
        }
      ]
    }
  ],
  "statusSwitchCode": ""
}

Response example

HTTP/1.1 200 OK
{
  "requestId": "254b9856a1cf042cb51dd4187e34db12",
  "code": "200",
  "message": "SUCCESS",
  "detailMessage": "",
  "result": {
    "id": "375532167350280192",
    "name": "doc-test-profile",
    "timeZoneId": "UTC+8 Asia/Shanghai",
    "daylightSavingEnabled": false,
    "currentUtcOffset": "+08:00",
    "remark": "Created for doc testing.",
    "statusSwitchCode": "*992",
    "businessHours": [
      {
        "weekday": "SUN",
        "enabled": false,
        "fullDay": false,
        "segments": []
      },
      {
        "weekday": "MON",
        "enabled": true,
        "fullDay": false,
        "segments": [
          {
            "start": "09:00",
            "end": "18:00"
          }
        ]
      },
      {
        "weekday": "TUE",
        "enabled": true,
        "fullDay": false,
        "segments": [
          {
            "start": "09:00",
            "end": "18:00"
          }
        ]
      },
      {
        "weekday": "WED",
        "enabled": true,
        "fullDay": false,
        "segments": [
          {
            "start": "09:00",
            "end": "18:00"
          }
        ]
      },
      {
        "weekday": "THU",
        "enabled": true,
        "fullDay": false,
        "segments": [
          {
            "start": "09:00",
            "end": "18:00"
          }
        ]
      },
      {
        "weekday": "FRI",
        "enabled": true,
        "fullDay": false,
        "segments": [
          {
            "start": "09:00",
            "end": "18:00"
          }
        ]
      },
      {
        "weekday": "SAT",
        "enabled": false,
        "fullDay": false,
        "segments": []
      }
    ],
    "createdAt": "1793601045749",
    "updatedAt": "1793601045749"
  }
}