URL

This card helps to get the URL in a placeholder.

AttributesMandatoryDescriptionValues
typeYesThe type of input to be displayed to the visitorurl
placeholderYes

Default text that is displayed before the input is given

 

{

"placeholder": "Enter the URL"

}

valueNoThe value to be pre-filled in the input

{

"value": "www.zylker.com"

}

errorNoThe error message that is displayed when invalid input is given

{

error: {"Please enter a valid URL"}

}

Channel compatibility and limitations

     

The bot will collect all general details such as name, email address, phone number, and other information similar to website

Output:

The above is an example of getting a URL from the visitor.

 

Use Case

Copied{
  "type":"url",
  "placeholder" : "Enter the website URL", 
  "value" : "www.zylker.com",
  "error" : ["Enter a valid URL"]
}
Copied//Context handler 
result = Map();
response = Map();
response.put("action", "reply");
response.put("replies", {Awesome! Let's get you started right away. Let me get some details first...});
response.put("input", {
"type":"url",
"placeholder" : "Enter the website url", 
"value" : "www.zylker.com",
"error" :{"Enter a valid URL"}
});
prompt = Map(); 
prompt.put("param_name", "reply"); 
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", {"Awesome! Let's get you started right away. Let me get some details first..."});
response.put("input", {
"type":"url",
"placeholder" : "Enter the website url", 
"value" : "www.zylker.com",
"error" :{"Enter a valid URL}
});
result.put("data", response);
return result;
Copied{
  "type":"url",
  "placeholder" : "Enter the website URL", 
  "value" : "www.zylker.com",
  "error" : ["Enter a valid URL"]
}
Copied{
  "platform": "ZOHOSALESIQ",
  "action": "reply",
  "replies": ["Awesome. Let’s get you started right away. Let me get a few details first.."],
  "input" :
    {
      "type":"url",
      "placeholder" : "Enter the website URL", 
      "value" : "www.zylker.com",
      "error" : ["Enter a valid URL"]
    }
}
Copied"user_defined": {
  "zohosalesiq": {
    "replies": ["Awesome. Let’s get you started right away. Let me get a few details first.."],
    "input" : 
   {
     "type":"url",
     "placeholder" : "Enter the website URL", 
     "value" : "www.zylker.com",
     "error" : ["Enter a valid URL"]
    }
  }
}
Copied"channelData": {
  "zohosalesiq": {
    "replies": ["Awesome. Let’s get you started right away. Let me get a few details first..."],
    "input" : {
	"type":"url",
  "placeholder" : "Enter the website URL", 
  "value" : "www.zylker.com",
  "error" : ["Enter a valid URL"]
    }
  }
}