Yay.com loading

Loading

Call us on (917) 9001 YAY

0

Login to Yay.com

Phone Numbers & Call Routing

API Access

Build custom apps using our JSON API

1st month FREE
Become a Reseller

Out of Hours

Out of Hours Diaries are used to modify routing based on the time of day

Become a Reseller

Filter:

  • All
  • GET
  • POST
  • PUT
  • DELETE
  • Chargeable *

* You will be charged every time this command is run.

  • GET/voip/out-of-hours

    Gets a list of all of the active Out of Hours diaries on an account

    Back to top

    Request Details

    Response Details

    Request Details

    This command has no URL/Query String parameters

    Response Details

    200 Response

    {
        "result" : [
            {
                "name" : "Pete's Work Schedule",
                "elements" : [
                    {
                        "call_flow" : "74da1282-6aa9-4f00-b452-ba37f7b832e6",
                        "closed_time" : "18:00-9:00,mon-fri,*,*"
                    }
                ],
                "exceptions" : [
                    {
                        "call_flow" : "74da1282-6aa9-4f00-b452-ba37f7b832e6",
                        "start_date" : "2016-12-24",
                        "start_time" : "09:00:00",
                        "end_date" : "2016-12-28",
                        "end_time" : "16:59:59"
                    }
                ],
                "uuid" : "31347d42-00bd-44a5-9b5c-20dc4197a2f6",
                "created_on" : "2018-11-19",
                "updated_on" : "2018-11-19"
            }
        ],
        "status_code" : 200,
        "status_message" : "OK"
    }
  • GET/voip/out-of-hours/{uuid}

    Gets the details for a specific Out of Hours diary on an account

    Back to top

    Request Details

    Response Details

    Request Details

    URL and Query String Parameters

    • Name

    • Type

    • Required

      • uuid

      • String

      • True

      The UUID of the Out of Hours diary to be queried

    Response Details

    200 Response

    {
        "result" : {
            "name" : "Pete's Work Schedule",
            "elements" : [
                {
                    "call_flow" : "74da1282-6aa9-4f00-b452-ba37f7b832e6",
                    "closed_time" : "18:00-9:00,mon-fri,*,*"
                }
            ],
            "exceptions" : [
                {
                    "call_flow" : "74da1282-6aa9-4f00-b452-ba37f7b832e6",
                    "start_date" : "2016-12-24",
                    "start_time" : "09:00:00",
                    "end_date" : "2016-12-28",
                    "end_time" : "16:59:59"
                }
            ],
            "uuid" : "31347d42-00bd-44a5-9b5c-20dc4197a2f6",
            "created_on" : "2018-11-19",
            "updated_on" : "2018-11-19"
        },
        "status_code" : 200,
        "status_message" : "OK"
    }

    404 Response

    {
        "result" : {},
        "status_code" : 404,
        "status_message" : "Not Found"
    }
  • POST/voip/out-of-hours

    Creates a new Out of Hours diary

    Back to top

    Request Details

    Response Details

    Request Details

    This command has no URL/Query String parameters

    POST body

    • Name

    • Type

    • Required

      • elements

      • Array of Diary Element

      • True

      The list of diary elements

      • exceptions

      • Array of Diary Exception

      • True

      The list of exception times which override the diary elements

      • name

      • String

      • True

      The name of this Out of Hours Diary

    Diary Element

    A Diary Element describes a time pattern to match against, and the Call Flow to use during those times.

      • call_flow

      • String

      • True

      The UUID of the Call Flow used during these times

      • closed_time

      • String

      • True

      The pattern for the times during which this Call Flow is in effect.The format of the closed_time is as follows:

      <time_range>,<days_of_week>,<days_of_month>,<months>
      <time_range> = <hour>:<minute>-<hour>:<minute>
      <hour> = A number, 0 to 23 inclusive
      <minute> = A number, 0 to 59 inclusive
      <days_of_week> = <dayname> | <dayname>-<dayname>
      <dayname> = "sun" | "mon" | "tue" | "wed" | "thu" | "fri" | "sat"
      <days_of_month> = <daynum> | <daynum>-<daynum>
      <daynum> = A number, 1 to 31 inclusive
      <months> = <monthname> | <monthname>-<monthname>
      <monthname> = "jan" | "feb" | "mar" | "apr" | "may" | "jun" | "jul" | "aug" | "sep" | "oct" | "nov" | "dec"

      Any range can also be replaced with "*" to be ignored when matching.

    Diary Exception

    A Diary Exception describes a continuous time span during which the Diary Elements will be overridden.

      • call_flow

      • String

      • True

      The UUID of the Call Flow used during these times

      • end_date

      • LocalDate

      • True

      The date on which this exception ends

      • end_time

      • LocalTime

      • True

      The time at which this exception ends

      • start_date

      • LocalDate

      • True

      The date on which this exception starts

      • start_time

      • LocalTime

      • True

      The time at which this exception starts

    JSON all-fields example:

    {
        "name" : "Pete's Work Schedule",
        "elements" : [
            {
                "call_flow" : "74da1282-6aa9-4f00-b452-ba37f7b832e6",
                "closed_time" : "18:00-9:00,mon-fri,*,*"
            }
        ],
        "exceptions" : [
            {
                "call_flow" : "74da1282-6aa9-4f00-b452-ba37f7b832e6",
                "start_date" : "2016-12-24",
                "start_time" : "09:00:00",
                "end_date" : "2016-12-28",
                "end_time" : "16:59:59"
            }
        ]
    }

    Response Details

    201 Response

    {
        "result" : {
            "name" : "Pete's Work Schedule",
            "elements" : [
                {
                    "call_flow" : "74da1282-6aa9-4f00-b452-ba37f7b832e6",
                    "closed_time" : "18:00-9:00,mon-fri,*,*"
                }
            ],
            "exceptions" : [
                {
                    "call_flow" : "74da1282-6aa9-4f00-b452-ba37f7b832e6",
                    "start_date" : "2016-12-24",
                    "start_time" : "09:00:00",
                    "end_date" : "2016-12-28",
                    "end_time" : "16:59:59"
                }
            ],
            "uuid" : "31347d42-00bd-44a5-9b5c-20dc4197a2f6",
            "created_on" : "2018-11-19"
        },
        "status_code" : 201,
        "status_message" : "Created"
    }

    400 Response

    {
        "result" : {},
        "status_code" : 400,
        "status_message" : "Bad Request"
    }
  • PUT/voip/out-of-hours/{uuid}

    Updates the specified Out of Hours diary

    Back to top

    Request Details

    Response Details

    Request Details

    URL and Query String Parameters

    • Name

    • Type

    • Required

      • uuid

      • String

      • True

      The UUID of the Out of Hours diary to be updated

    PUT body

    • Name

    • Type

    • Required

      • elements

      • Array of Diary Element

      • True

      The list of diary elements

      • exceptions

      • Array of Diary Exception

      • True

      The list of exception times which override the diary elements

      • name

      • String

      • True

      The name of this Out of Hours Diary

    Diary Element

    A Diary Element describes a time pattern to match against, and the Call Flow to use during those times.

      • call_flow

      • String

      • True

      The UUID of the Call Flow used during these times

      • closed_time

      • String

      • True

      The pattern for the times during which this Call Flow is in effect.The format of the closed_time is as follows:

      <time_range>,<days_of_week>,<days_of_month>,<months>
      <time_range> = <hour>:<minute>-<hour>:<minute>
      <hour> = A number, 0 to 23 inclusive
      <minute> = A number, 0 to 59 inclusive
      <days_of_week> = <dayname> | <dayname>-<dayname>
      <dayname> = "sun" | "mon" | "tue" | "wed" | "thu" | "fri" | "sat"
      <days_of_month> = <daynum> | <daynum>-<daynum>
      <daynum> = A number, 1 to 31 inclusive
      <months> = <monthname> | <monthname>-<monthname>
      <monthname> = "jan" | "feb" | "mar" | "apr" | "may" | "jun" | "jul" | "aug" | "sep" | "oct" | "nov" | "dec"

      Any range can also be replaced with "*" to be ignored when matching.

    Diary Exception

    A Diary Exception describes a continuous time span during which the Diary Elements will be overridden.

      • call_flow

      • String

      • True

      The UUID of the Call Flow used during these times

      • end_date

      • LocalDate

      • True

      The date on which this exception ends

      • end_time

      • LocalTime

      • True

      The time at which this exception ends

      • start_date

      • LocalDate

      • True

      The date on which this exception starts

      • start_time

      • LocalTime

      • True

      The time at which this exception starts

    JSON all-fields example:

    {
        "name" : "Pete's Work Schedule",
        "elements" : [
            {
                "call_flow" : "74da1282-6aa9-4f00-b452-ba37f7b832e6",
                "closed_time" : "18:00-9:00,mon-fri,*,*"
            }
        ],
        "exceptions" : [
            {
                "call_flow" : "74da1282-6aa9-4f00-b452-ba37f7b832e6",
                "start_date" : "2016-12-24",
                "start_time" : "09:00:00",
                "end_date" : "2016-12-28",
                "end_time" : "16:59:59"
            }
        ]
    }

    Response Details

    201 Response

    {
        "result" : {
            "name" : "Pete's Work Schedule",
            "elements" : [
                {
                    "call_flow" : "74da1282-6aa9-4f00-b452-ba37f7b832e6",
                    "closed_time" : "18:00-9:00,mon-fri,*,*"
                }
            ],
            "exceptions" : [
                {
                    "call_flow" : "74da1282-6aa9-4f00-b452-ba37f7b832e6",
                    "start_date" : "2016-12-24",
                    "start_time" : "09:00:00",
                    "end_date" : "2016-12-28",
                    "end_time" : "16:59:59"
                }
            ],
            "uuid" : "31347d42-00bd-44a5-9b5c-20dc4197a2f6",
            "created_on" : "2018-11-19",
            "updated_on" : "2018-11-19"
        },
        "status_code" : 201,
        "status_message" : "Created"
    }

    400 Response

    {
        "result" : {},
        "status_code" : 400,
        "status_message" : "Bad Request"
    }

    404 Response

    {
        "result" : {},
        "status_code" : 404,
        "status_message" : "Not Found"
    }
  • DELETE/voip/out-of-hours/{uuid}

    Deletes the specified Out of Hours diary

    Back to top

    Request Details

    Response Details

    Request Details

    URL and Query String Parameters

    • Name

    • Type

    • Required

      • uuid

      • String

      • True

      The UUID of the Out of Hours diary to be deleted

    Response Details

    204 Response

    {
        "result" : {},
        "status_code" : 204,
        "status_message" : "No Content"
    }

    404 Response

    {
        "result" : {},
        "status_code" : 404,
        "status_message" : "Not Found"
    }