Password

This card allows getting input as hidden like password from the website visitor.

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

Default text that is displayed before the input is given

 

{

"placeholder": "Enter your bank account number"

}

valueNoThe value to be prefilled in the input

{

"value": "XXXX XXXX XXXX"

}

Note

Once the visitor enters the password and sends it, the text entered will not be available in the chat or in the transcript. It will be available in the messageobject of the bot. 

Channel compatibility and limitations

   

Pro Tip: Facebook Messenger, Instagram, WhatsApp, and Telegram channels do not support this card. However, the password text will not be masked from these channels' interfaces. Moreover, it can be handled differently using the channel value in the visitor map. For example, provide an if condition statement (if the visitor's channel is Facebook or Instagram) and handle this case alternatively. 

Use Case

Copied{
"type" : "password"
}
Copied//Context handler function
result = Map();
response = Map();
response.put("action", "reply");
response.put("replies", ["Enter ur password"]);
response.put("input", {
"type":"password"
});
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", ["Enter ur password"]);
response.put("input", {
"type":"password"
});
result.put("data", response);
return result;
Copied{
"type" : "password"
}
Copied{
  "platform": "ZOHOSALESIQ",
  "action": "reply",
  "replies": ["Enter password"],
  "input" :{
"type":"password"
}
}
Copied"user_defined": {
  "zohosalesiq": {
    "replies": ["Enter your password"],
  "input" : {
"type":"password"
}
  }
}
Copied"channelData": {
  "zohosalesiq": {
    "replies": ["Enter your password"],
    "input" : {
	"type":"password"
    }
  }
}

Message object for password

Copied{
       "meta":{
               "card_data":{
                               "type":"password",
                               "value":" 1234 5678 9101"
                                   },
                               "version":"1"
                    },
      "text":"*********",
      "type":"text"
}

Syntax to get the password

Copiedpassword = message.get("meta").get("card_data").get("value");