NiteLordz
NiteLordz

Reputation: 607

Message Type on Facebook Messenger using Bot Framework

According to this documentation (https://developers.facebook.com/docs/messenger-platform/reference/send-api/) there will need to be a "messaging_type" property needed to be added to the payload for use on Facebook Messenger bots. Will this be automatically injected into the payload, or is this something we need to handle as a developer?

I stumbled upon this as I am researching how to add certain "tags" to the payload for pro-active messaging.

Upvotes: 0

Views: 316

Answers (1)

Stu Price
Stu Price

Reputation: 163

This issue Will Bot Framework support Facebook messaging_types? states the messaging_type is already set on every message and by default it's set to 'Response' and you can change this using ChannelData.

FranciscoPonceGomez on GitHub

We already support It. It defaults to ‘Response’ and can be changed via ‘messaging_type’ in channeldata. I will send you a link with the updated documentation soon.

In C# you set the messaging_type like this:

activity.ChannelData = JObject.FromObject(new
{
    messaging_type = "MESSAGE_TAG"
});

If you have successfully set the tag could you post your solution as it would really be of help to me and others :-)

Upvotes: 1

Related Questions