POST - Create a business hours profile
Purpose
Use this API to create a business hours profile.
Authorization
HeaderKey | Description |
Authorization* | Zoho-oauthtoken<space><ACCESS_TOKEN> |
Accept* | Set to application/json. |
Request URL
Method: POST
https://voice.zoho.com/rest/json/zv/workday |
Scope: ZohoVoice.telephony.CREATE
Parameters:
Param Name | Data Type | Description |
profileName* | String | Represents the name of the profile. |
timezone* | String | Represents the timezone of the profile. |
holidayPid | Long | Represents the ID of an existing holiday profile to be linked to this business hours profile. |
emailId | String | Represents the email address to receive alerts when calls land outside the configured business hours. |
hours* | JSONObject | Represents the business hours configured for each day of the week. Day "0" corresponds to Monday.
Sample Request Body: { "0":[ {"startTime":"09:00", "endTime":"17:00"}], "1":[{"startTime":"09:00","endTime":"17:00"}], "2":[{"startTime":"09:00","endTime":"17:00"}], "3":[{"startTime":"09:00","endTime":"17:00"}], "4":[{"startTime":"09:00","endTime":"17:00"}], "5":[{"startTime":"09:00","endTime":"17:00"}], "6":[{"startTime":"09:00","endTime":"17:00"}] } |
fallback* | JSONObject | Represents the fallback configuration for calls received outside the configured business hours.
Sample Request Body: { |
Sample Request
Copiedcurl "https://voice.zoho.com/rest/json/zv/workday" \
-X POST \
--data-raw 'data=ENCODE({"profileName":"US Weekday Hours", "emailId":"","timezone":"PST","holidayPid":"","hours":{"0":[{"startTime":"09:00","endTime":"17:00"}],"1":[{"startTime":"09:00","endTime":"17:00"}],"2":[{"startTime":"09:00","endTime":"17:00"}],"3":[{"startTime":"09:00","endTime":"17:00"}],"4":[{"startTime":"09:00","endTime":"17:00"}],"5":[{"startTime":"09:00","endTime":"17:00"}],"6":[{"startTime":"09:00","endTime":"17:00"}]}, "fallback":{"mode":"text","audioId":"","message":"Hi there. Sorry, we could not pick your call. You have called outside our business hours. Please call later.","audioName":"","config":{"name":"Default Action Handler", "busy":{"actionType":"voicemail","mode":"text","message":"Sorry, you've reached voicemail. Please leave a message.","audioId":"","audioLanguage":"en-US","audioVoice":"2"},"offline":{"actionType":"voicemail","mode":"text","message":"Sorry, you've reached voicemail. Please leave a message.","audioId":"","audioLanguage":"en-US","audioVoice":"2"}},"audioLanguage":"en-US","audioVoice":"2"}})'
-H "Content-Type: application/json"
-H "Authorization:Zoho-oauthtoken *****"Sample Response - Success
Copied{
"code": "200",
"workday": {
"id": "4501000006488123",
"profileName":"US Weekday Hours",
"holidayPid":"",
"hours":[...],
"timezone":"PST",
"fallback":{...}
},
"status": "SUCCESS"
}Sample Response - Error
Copied{
"status": "ERROR",
"code": "ZVT0095",
"message": "Start time must be earlier than end time."
}