Releases: bottenderjs/messaging-apis
0.7.2 / 2018-06-08
messaging-api-messenger
- [new] Verifying Graph API Calls with
appsecret_proof
If appSecret
is provided, MessengerClient
will enable this feature automatically and include appsecret_proof
in every Graph API requests.
const client = MessengerClient.connect({
accessToken,
appSecret,
});
0.7.1 / 2018-05-16
messaging-api-messenger
There are no any visible breaking changes between 2.11 and 3.0, so after this version it uses Graph API 3.0 (https://graph.facebook.com/v3.0/
) as default (#349).
In this version, we bring some fetaures in Messenger Platform 2.4 into messaging-api-messenger
.
- [new] Support scheduling broadcasts
To schedule a broadcast, specify the schedule_time
property when you call the sendBroadcastMessage
API request to send the message.
client
.sendBroadcastMessage(938461089, {
schedule_time: '2018-04-05T20:39:13+00:00',
})
.then(result => {
console.log(result);
// {
// broadcast_id: '115517705935329',
// }
});
To cancel a scheduled broadcast:
client.cancelBroadcast('115517705935329');
To check on broadcast status.
client.getBroadcast('115517705935329').then(broadcast => {
console.log(broadcast);
// {
// scheduled_time: '2018-04-05T20:39:13+00:00',
// status: 'SCHEDULED',
// id: "115517705935329"
// }
});
- [new] Support nested predicate in Broadcast API, so you can send broadcast messages with label predicates (and, or, not):
import { MessengerBroadcast } from 'messaging-api-messenger';
const { add, or, not } = MessengerBroadcast;
client.sendBroadcastMessage(938461089, {
targeting: {
labels: and(
'<CUSTOM_LABEL_ID_1>'
or(
'<UNDER_25_CUSTOMERS_LABEL_ID>',
'<OVER_50_CUSTOMERS_LABEL_ID>'
)
),
},
});
- [new] Support getting the thread owner when using Handover Protocol:
client.getThreadOwner().then(threadOwner => {
console.log(threadOwner);
// {
// app_id: '12345678910'
// }
});
- [new] Support new insights API
getTotalMessagingConnections()
:
client.getTotalMessagingConnections().then(result => {
console.log(result);
// {
// name: 'page_messages_total_messaging_connections',
// period: 'day',
// values: [
// values: [
// { value: 1000, end_time: '2018-03-12T07:00:00+0000' },
// { value: 1000, end_time: '2018-03-13T07:00:00+0000' },
// ],
// title: 'Messaging connections',
// 'Daily: The number of people who have sent a message to your business, not including people who have blocked or reported your business on Messenger. (This number only includes connections made since October 2016.)',
// id:
// '1386473101668063/insights/page_messages_total_messaging_connections/day',
// }
});
- [new] Support programmatically checking the feature submission status of Page-level Platform features using
getMessagingFeatureReview
:
client.getMessagingFeatureReview().then(data => {
console.log(data);
// [
// {
// "feature": "subscription_messaging",
// "status": "<pending|rejected|approved|limited>"
// }
// ]
});
- [deprecated]
getOpenConversations()
is deprecated and replaced by newgetTotalMessagingConnections()
See messenger official blog post for more Messenger Platform 2.4 details.
0.7.0 / 2018-04-27
- [changed] use class methods instead of class properties #310
- [fix] handle network error better by fallback to original message #338
messaging-api-messenger
- [new] move message creation api into singleton: #255
Messenger.createMessage;
Messenger.createText;
Messenger.createAttachment;
Messenger.createAudio;
Messenger.createImage;
Messenger.createVideo;
Messenger.createFile;
Messenger.createTemplate;
Messenger.createButtonTemplate;
Messenger.createGenericTemplate;
Messenger.createListTemplate;
Messenger.createOpenGraphTemplate;
Messenger.createMediaTemplate;
Messenger.createReceiptTemplate;
Messenger.createAirlineBoardingPassTemplate;
Messenger.createAirlineCheckinTemplate;
Messenger.createAirlineItineraryTemplate;
Messenger.createAirlineUpdateTemplate;
MessengerBatch.sendRequest;
MessengerBatch.sendMessage;
MessengerBatch.sendText;
MessengerBatch.sendAttachment;
MessengerBatch.sendAudio;
MessengerBatch.sendImage;
MessengerBatch.sendVideo;
MessengerBatch.sendFile;
MessengerBatch.sendTemplate;
MessengerBatch.sendButtonTemplate;
MessengerBatch.sendGenericTemplate;
MessengerBatch.sendListTemplate;
MessengerBatch.sendOpenGraphTemplate;
MessengerBatch.sendReceiptTemplate;
MessengerBatch.sendMediaTemplate;
MessengerBatch.sendAirlineBoardingPassTemplate;
MessengerBatch.sendAirlineCheckinTemplate;
MessengerBatch.sendAirlineItineraryTemplate;
MessengerBatch.sendAirlineUpdateTemplate;
MessengerBatch.getUserProfile;
MessengerBatch.sendSenderAction;
MessengerBatch.typingOn;
MessengerBatch.typingOff;
MessengerBatch.markSeen;
MessengerBatch.passThreadControl;
MessengerBatch.passThreadControlToPageInbox;
MessengerBatch.takeThreadControl;
MessengerBatch.requestThreadControl;
MessengerBatch.associateLabel;
MessengerBatch.dissociateLabel;
MessengerBatch.getAssociatedLabels;
- [new] add 2 new metrix to messenger insights: #304
getOpenConversations(options)
:
client.getOpenConversations().then(result => {
console.log(result);
// {
// name: 'page_messages_open_conversations_unique',
// period: 'day',
// values: [
// { end_time: '2018-03-12T07:00:00+0000' },
// { end_time: '2018-03-13T07:00:00+0000' },
// ],
// title: 'Daily unique open conversations count',
// description:
// 'Daily: The total number of open conversations between your Page and people in Messenger. This metric excludes blocked conversations.',
// id:
// '1386473101668063/insights/page_messages_open_conversations_unique/day',
// }
});
getNewConversations(options)
:
client.getNewConversations().then(result => {
console.log(result);
// {
// name: 'page_messages_new_conversations_unique',
// period: 'day',
// values: [
// { value: 1, end_time: '2018-03-12T07:00:00+0000' },
// { value: 0, end_time: '2018-03-13T07:00:00+0000' },
// ],
// title: 'Daily unique new conversations count',
// description:
// 'Daily: The number of messaging conversations on Facebook Messenger that began with people who had never messaged with your business before.',
// id:
// '1386473101668063/insights/page_messages_new_conversations_unique/day',
// }
});
- [breaking] rename
Messenger
toMessengerBatch
: #255 - [breaking] rename
getDailyUniqueActiveThreadCounts
togetActiveThreads
#307 - [breaking] remove deprecated MessengerClient method -
sendQuickReplies
- [breaking] Messenger Insights API: resolve
obj
instead of[obj]
: #302
Affected APIs:
- getActiveThreads
- getBlockedConversations
- getReportedConversations
- getReportedConversationsByReportType
Before:
client.getBlockedConversations().then(counts => {
console.log(counts);
// [
// {
// "name": "page_messages_blocked_conversations_unique",
// "period": "day",
// "values": [
// {
// "value": "<VALUE>",
// "end_time": "<UTC_TIMESTAMP>"
// },
// {
// "value": "<VALUE>",
// "end_time": "<UTC_TIMESTAMP>"
// }
// ]
// }
// ]
});
After:
client.getBlockedConversations().then(counts => {
console.log(counts);
// {
// "name": "page_messages_blocked_conversations_unique",
// "period": "day",
// "values": [
// {
// "value": "<VALUE>",
// "end_time": "<UTC_TIMESTAMP>"
// },
// {
// "value": "<VALUE>",
// "end_time": "<UTC_TIMESTAMP>"
// }
// ]
// }
});
- [breaking] removed deprecated
getDailyUniqueConversationCounts
insights API #304 - [changed] rename
AirlineFlightUpdateTemplate
toAirlineUpdateTemplate
to match typename #329
AirlineFlightUpdateTemplate -> AirlineUpdateTemplate
- [fix] fix sending attachment with buffer (allow filename) #335
- [fix] fix getReportedConversationsByReportType and improve docs #297
- [fix] avoid pass undefined value to messenger in batch api #326
messaging-api-line
- [new] support LINE issue link token for account linking: #332
client.issueLinkToken(USER_ID).then(result => {
console.log(result);
// {
// linkToken: 'NMZTNuVrPTqlr2IF8Bnymkb7rXfYv5EY',
// }
});
- [new] allow pass object as image, audio, video, sticker args: #309
client.pushImage(RECIPIENT_ID, {
originalContentUrl: 'https://example.com/original.jpg',
previewImageUrl: 'https://example.com/preview.jpg',
});
client.pushVideo(RECIPIENT_ID, {
originalContentUrl: 'https://example.com/original.mp4',
previewImageUrl: 'https://example.com/preview.jpg',
});
client.pushAudio(RECIPIENT_ID, {
originalContentUrl: 'https://example.com/original.m4a',
duration: 240000,
});
client.pushSticker(RECIPIENT_ID, {
packageId: '1',
stickerId: '1',
});
-
[new] support LINE ButtonsTemplate alias to match typename
buttons
:- client.sendButtonsTemplate == client.sendButtonTemplate
- client.replyButtonsTemplate == client.replyButtonTemplate
- client.pushButtonsTemplate == client.pushButtonTemplate
- client.multicastButtonsTemplate == client.multicastButtonTemplate
-
[breaking] remove deprecated method
isValidSignature
inLineClient
messaging-api-telegram
- [breaking] Throw error when
ok
isfalse
in Telegram: #268
{
ok: false,
result: { /* ... */ }
}
Now throws Telegram API
error.
- [breaking] telegram api return result instead of
{ ok: true, result }
: #313
Before:
{
ok: true,
result: {
key: val
}
}
After:
{
key: val,
}
Make it easier to access result and consist with other platforms.
0.6.16 / 2018-02-27
messaging-api-line
- [fix] fix LINE API URL typos for getting group and room member ids
0.6.15 / 2018-02-26
messaging-api-messenger
- [new] implement
requestThreadControl
:
client.requestThreadControl(USER_ID, 'free formed text for primary app');
- [fix] handle axios error in batch
- [fix] let batch api use internal axios instance
0.6.14 / 2018-02-20
messaging-api-messenger
- [fix] broadcast
startReachEstimation
request path - [fix] broadcast
getReachEstimate
request method
0.6.13 / 2018-02-12
- [new] Support
origin
for test:
const { MessengerClient } = require('messaging-api-messenger');
const client = MessengerClient.connect({
accessToken: ACCESS_TOKEN,
origin: 'https://mydummytestserver.com',
});
0.6.12 / 2018-02-05
messaging-api-line
- [fix] Add default value for LINE
_sendCarouselTemplate
options
0.6.11 / 2018-01-22
messaging-api-viber
- [new] Support broadcast methods:
broadcastMessage(broadcastList, message)
broadcastText(broadcastList, text [, options])
broadcastPicture(broadcastList, picture [, options])
broadcastVideo(broadcastList, video [, options])
broadcastFile(broadcastList, file [, options])
broadcastContact(broadcastList, contact [, options])
broadcastLocation(broadcastList, location [, options])
broadcastURL(broadcastList, url [, options])
broadcastSticker(broadcastList, stickerId [, options])
broadcastCarouselContent(broadcastList, richMedia [, options])
0.6.10 / 2018-01-12
messaging-api-slack
- [new] add Slack
postEphemeral
method:
client.postEphemeral('C8763', 'U56781234', { attachments: [someAttachments] });
- [new] add
SlackOAuthClient
custom token support:
client.callMethod('chat.postMessage', {
token: 'custom token',
channel: CHANNEL,
text: 'hello',
});