Time Picker
  • 05 Jun 2024
  • 2 Minutes to read
  • Contributors
  • Dark
    Light
  • PDF

Time Picker

  • Dark
    Light
  • PDF

Article summary

Overview

With Time Picker, you can provide customers with a convenient tool for scheduling an appointment, meeting, or event.

Time Picker

For more information on Time Picker, go to the official documentation of Apple Messages for Business: Time Picker Message.

Example

Below, you can see the timePicker task reference in the Attachments State Diagram.

{
    "abc": {
        "type": "time_picker",
        "time_picker": {
            "event": {
                "identifier": "1", 
                "location": { 
                    "latitude": 37.7725,
                    "longitude": -22.4311,
                    "radius": "2",
                    "title": "Building One"
                },
                "timeslots": [
                    {
                        "duration": 3600,
                        "identifier": "5",
                        "startTime": "2020-04-01T15:30+0000"
                    },
                    {
                        "duration": 3600,
                        "identifier": "7",
                        "startTime": "2020-04-02T08:30+0000"
                    },
                    {
                        "duration": 3600,
                        "identifier": "9",
                        "startTime": "2020-04-03T21:30+0000"
                    }
                ],
                "timezoneOffset": 0,
                "title": "Schedule an Appointment"
            },
            "receivedMessage": {
                "style": "icon",
                "title": "Please pick a time",
                "subtitle": "This should be 10:00am for -7h users"
            },
            "replyMessage": {
                "style": "icon",
                "title": "Thank you!"
            }
        }
    }
}

Parameters

ParameterTypeRequiredDescription
typestring+A type of an object to send.
time_pickerobject+An object in where all Time Picker Message parameters are described.
time_picker.eventobject+An object in which all events are described.
time_picker.event.identifierstring+An item ID sent to Corezoid when it has been selected by the client.
time_picker.event.locationobjectAn object in which an event location is described.
time_picker.event.location.latitudedoubleLocation latitude.
time_picker.event.location.longitudedoubleLocation longitude.
time_picker.event.location.radiusdoubleLocation radius (in meters). This field is used whether there’s no latitude or longitude.
time_picker.event.location.titlestring+An item’s title.
time_picker.event.timeslotsarrayAn array of timeslots.
time_picker.event.titlestring+An item’s title.
time_picker.event.timeslots[].durationintegerA time slot duration (in seconds).
time_picker.event.timeslots[].startTimedouble+An event start time, a date in the UTC format (ISO 8601). An example: 2017-05-26T08:27:55+00:00, 2017-05-26T08:27:55+0000, or 2017-05-26T08:27:55Z
time_picker.event.timeslots[].identifierstring+An item ID sent to Corezoid when it has been selected by the client.
time_picker.event.event.timezoneOffsetintegerMinutes quantity from GMT, that settles an event location time zone. If it’s not defined, the time is displayed according to the current client’s time zone. If defined, the time is displayed according to the event time zone, independently from the client’s location.
time_picker.receivedMessageobject+An object that describes a received message from a list of items selected by the user.
time_picker.receivedMessage.titlestring+A title displayed when a client receives a message.
time_picker.receivedMessage.subtitlestring+A subtitle displayed when a client receives a message.
time_picker.receivedMessage.stylestring+Defines an item style. The default is "icon". Available values: "icon", "small", and "large".
time_picker.replyMessageobject+An object in which it is described how to display a message after a reply.
time_picker.replyMessage.titlestring+A title displayed when the message has been sent by the user.
time_picker.replyMessage.subtitlestring+A subtitle displayed when the message has been sent by the user.
time_picker.replyMessage.stylestring+Defines an item style. The default is "icon". Available values: "icon", "small", and "large".

Adding item

TimePicker_Add

To add an item to Time Picker, the following object needs to be added to the timeslots array:

"timeslots": [
     {
             "duration": 3600, 
             "identifier": "1",
             "startTime": "2020-04-1T15:30+0000" 
        }
]

Was this article helpful?

What's Next