Time slots

This card helps to get time as input by displaying the list of time slots in the window and allowing the visitor to pick one from the given slots.

AttributeMandatoryDescriptionValues
typeYesThe type of input to be displayed to the visitortimeslots
slotsYesSpecify the array of time slots in hh:mm (24 hrs) format that you would like to display[hh:mm, hh:mm]
tzNoSpecify to allow the visitor to choose the timezone in the calendartrue - To allow the visitor to choose the timezone in the calendar. If not specified, then the timezone of the visitor's device will be taken by default.
dateYesSpecify to allow the visitor to choose the date in the calendardd/mm/yyyy
time_zone_idYestime_zone_id from the java.util. TimeZone class is valid"Asia/Calcutta"
Channel compatibility and limitations

   

Facebook Messenger:

  • The card is supported on Facebook. 
  • When using this card, the user would have to type the date/time manually. 

Instagram:

  • The card is supported on Instagram. 
  • When using this card, the user would have to type the date/time manually. 

WhatsApp:

  • The card is supported on WhatsApp. 
  • When using this card, the user would have to type the date/time manually.

Telegram:

  • The card is supported on Telegram. 
  • When using this card, the user would have to type the date/time manually.

Output

Use Case

Copied{
  "type": "timeslots",
  "tz": true,
  "label": "Schedule a meeting",
  "date": "23/01/2024",
  "time_zone_id": "Asia/Calcutta",
  "slots": [
    "09:00",
    "10:00",
    "11:00",
    "01:00",
    "03:00"
  ]
}
Copiedresult = Map();
response = Map();
response.put("action", "reply");
response.put("replies", [
    "These are the available slots, please select one"
]);
response.put("input", {
    "type": "timeslots",
    "tz": true,
    "label": "Book a slot",
    "slots": [
            "09:00",
            "10:00",
            "11:00",
            "01:00",
            "03:00"
    ]
});
prompt = Map();
prompt.put("param_name", "rating");
prompt.put("data", response);
result.put("prompt", prompt);
result.put("todo", "prompt");
return result;

//Execution function
result = Map();
response = Map();
response.put("action", "reply");
response.put("replies", {
    "Choose your slot"
});
response.put("input", {
  "type": "timeslots",
  "tz": true,
  "label": "Book a slot",
  "slots": [
            "09:00",
            "10:00",
            "11:00",
            "01:00",
            "03:00"
  ]
});
result.put("data", response);
return result;
Copied{
  "type": "timeslots",
  "tz": true,
  "label": "Schedule a meeting",
  "date": "23/01/2024",
  "time_zone_id": "Asia/Calcutta",
  "slots": [
    "09:00",
    "10:00",
    "11:00",
    "01:00",
    "03:00"
  ]
}
Copied{
  "platform": "ZOHOSALESIQ",
  "replies": [
    "These are the available slots, please select one."
  ],
  "input": {
  "type": "timeslots",
  "tz": true,
  "label": "Schedule a meeting",
  "date": "24/08/2018",
  "time_zone_id": "Asia/Calcutta",
  "slots": [
    "09:00",
        "09:00",
        "10:00",
        "11:00",
        "01:00",
        "03:00"
  ]
}
}
Copied"user_defined": {
  "zohosalesiq": {
    "replies": [
      "These are the available slots, please select one."
    ],
    "input": {
      "type": "timeslots",
      "tz": true,
      "label": "Book a slot",
      "slots": [
        "09:00",
        "10:00",
        "11:00",
        "01:00",
        "03:00"
      ]
    }
  }
}
Copied"channelData":{
        "zohosalesiq": {
            "input": {
  "type": "timeslots",
  "tz": true,
  "label": "Schedule a meeting",
  "date": "24/08/2018",
  "time_zone_id": "Asia/Calcutta",
  "slots": [
        "09:00",
        "10:00",
        "11:00",
        "01:00",
        "03:00"
  ]
},
            "replies":["These are the available slots, please select one."]
        }
    }