Dialogflow Messenger Integration - Add a chat-icon - dialogflow-es

I'm trying to change the dialogflow default icon in the web integration using the "Dialogflow Messenger" integration option.
I added the "chat-icon" tag to the "df-messenger" tag and it's not showing the custom logo.
Image of the web integration
Thanks!

Have you checked if the image link you are using is publicly accessible? As you said, you just need to set this on your embed:
<script src="https://www.gstatic.com/dialogflow-console/fast/messenger/bootstrap.js?v=1"></script>
<df-messenger
chat-icon="<a valid and public link here>"
intent="WELCOME"
chat-title="<your chatbot title here>"
agent-id="<your agent id here>"
language-code="pt-br"
></df-messenger>
Maybe you could try using another random image first (ie. a link from google images) just checking if it works and then troubleshooting with your custom image?

I fixed this issue by making the icon exactly 36x36 px as written in the documentation:
https://cloud.google.com/dialogflow/es/docs/integrations/dialogflow-messenger
I uploaded it to Firebase and got the public link, it works.
Hope it helps!

Related

Add sample image in template header in whatsapp cloud API

I am doing a project using WhatsApp cloud API. I need to create a template with a media header. I have created a template with a media header without a sample image and it gets rejected. So I want to create a template with a sample image in Node JS.
Template with a media header
Add sample image for a template
curl -X POST "https://graph.facebook.com/v14.0/{whatsapp-business-account-ID}/message_templates
?name={template-name}
&language=en_US
&category=TRANSACTIONAL,
&components=[{
type:BODY,
text:{message-text}
},
{
type:HEADER,
format:IMAGE,
example:{header_handle:[{uploaded-image-file-url}]}
}],
&access_token={system-user-access-token}"
I want to add a sample image using Node JS (Not manually like the second picture).
header_handle requires a encrypted file upload provided by facebook.
This can be done by calling 2 apis.
First,
We have to create a session for the file to be uploaded.
For creating session refer this
After creating session, we will get session id to upload the original file to it.Response will look something like this:
{"id":"upload:MTphdHRhY2htZW50Ojlk2mJiZxUwLWV6MDUtNDIwMy05yTA3LWQ4ZDPmZGFkNTM0NT8=?sig=ARZqkGCA_uQMxC8nHKI"}
Second,We have to upload the file to
https://graph.facebook.com/v14.0/{above_id}
This will give a response something similar to
{"h":"2:c2FtcGxlLm1wNA==:image/jpeg:GKAj0gAUCZmJ1voFADip2iIAAAAAbugbAAAA:e:1472075513:ARZ_3ybzrQqEaluMUdI"}
Finally,
{header_handle:["2:c2FtcGxlLm1wNA==:image/jpeg:GKAj0gAUCZmJ1voFADip2iIAAAAAbugbAAAA:e:1472075513:ARZ_3ybzrQqEaluMUdI"]}
Should be added during the request to create template.
It worked for me.
See this for better understanding on how to do it.
The answer Provided by Aravindh is correct, you can follow This document from Meta to upload the Image you want.
Just make sure you use a supported type by WhatsApp API ( For WhatsApp Business Platform Cloud API , For WhatsApp Business Platform On-Premises API ) and the upload end point (file-type — The file's MIME type. Valid values are: image/jpeg, image/jpg, image/png, and video/mp4
)
Double Check if you are following exacly the types supported, for example in case of png, you need to set "file_type" to "image/png" no just "png" when creating the upload session.
I have tested it and it works for me.
Hope this helps

How do i do a Contact form hosted in an Azure app using Mailgun?

I finally got my html website working in an Azure App.
Now I want to add a Contact Form.
I have done a simple HTML form that calls the MailGun API but nothing happens when I click submit.
There are no errors showing in the browser.
I followed the instructions here to create the form.
It turned out that I had incorrect settings in
$api_key = 'INSERT_API_KEY_HERE';
$api_domain = 'INSERT_DOMAIN_HERE';
$send_to = 'YOUR_EMAIL';
This became apparent after displaying the error from the Ajax call.
As explained here

Chat bot-Can I display html content using node.js in Microsoft bot framework & bot builder

I'm developing a chatbot on azure using node.js. It's a data visualization bot which generates chart in html format using d3 library and display to user.
It seems that Microsoft bot builder doesn't support html format. But I have looked through this link:
https://blog.botframework.com/2017/09/07/html-not-supported-web-chat/
It says that there is a way to enable html content:
"If HTML rendering in Web Chat is a critical feature for your applications, you can clone or fork a copy of the Web Chat source code from GitHub, and enable it (on your own custom Web Chat client)."
I tried to clone the file and changed ‘html : false’ to ‘html : true’. But it's not working.
Can anyone tell me what I can do? Really appreciate it!!!
Depending on what data you are attempting to visualize, you might be able to use a service like Google Image Charts: https://developers.google.com/chart/image/docs/chart_playground
Using this service, with the following code:
// attach the card to the reply message
var msg = new builder.Message(session).addAttachment(createHeroCard(session));
session.send(msg);
function createHeroCard(session) {
return new builder.HeroCard(session)
.title('Months with Numbers Bar Chart')
.subtitle('Using a Chart as Image service...')
.text('Build and connect intelligent bots that have charts rendered as images.')
.images([
builder.CardImage.create(session, 'http://chart.googleapis.com/chart?cht=bvg&chs=250x150&chd=s:Monkeys&chxt=x,y&chxl=0:|Jan|Feb|Mar|Apr|May|Jun|Jul')
])
.buttons([
builder.CardAction.openUrl(session, 'https://learn.microsoft.com/bot-framework/', 'Get Started')
]);
}
Produces this hero card:

Flickr api - call photo sets

I have API key and API secret and i have downloaded the recent library 3.1.
When i use the example mentioned, i get public photos. And the library i am using included this file phpFlickr.php which has all methods.
I am now trying to access the photo sets api, which is not returning anything. And the document says there is no other authentication that is required. please check the code below
require_once("phpFlickr.php");
$f = new phpFlickr("56cc01317fdce40c31c8f66498746c4d");
$sets = $f->photosets_getList();
#sandy : If you want to show flickr slider gallery in your website then you can use pictobrowser its best way to display flickr and Piccasa albums on website.
Using PictoBrowser one can easily embed Flickr and Picasa photostreams in anywebsite. All you need is follow few simple steps given here.
- visit http://pictobrowser.com/
- Click PictoBuilder at the top left corner of the page.
- Enter your Flickr/Picasa username.
- Choose images/ albums.
- Set Tag or Groups.
- It outputs some HTML code
- Copy that HTML code and paste it in your website or blog.

Google docs viewer not working

Using this code:
<iframe height="780" src="http://docs.google.com/viewer?url=http://ruh.kz/sites/default/files/doc/ritorika.pdf&embedded=true" style="border: none;" width="600"></iframe>
But all the time im getting this annoying message:
Sorry, we are unable to retrieve the document for viewing or you don't have permission to view the document.
By the way, i have read about ISP might block google docs. But i've checked another sites with google docs viewer and they seemed to work perfectly.
to embed your pdf without putting it in your server , just login to your gmail and upload it in google docs then copy the link and put it in your iframe's src
first you try with online version to view your file if it shows your file,you gave wrong url to iframe,if viewer does not show your file at embedded version and online version check your file size,file url and file permissions to viewer can reach your document.You can try your url, for example http://www.foo.com/bar.pdf paste in your browser,if url is right browser shows the file...

Resources