I'm using the Twilio Notify Service to send push notifications to APN and FCM. We would like to switch to the passthrough API for situations where we send to a large number of users at once. Howerver, I'm not getting the to_binding field in the response, so have no idea how many succeeded or failed. When sending using identity, we get an array of identities.
Here is what we are sending:
twilio_client.notify.v1.services(ENV.fetch('TWILIO_NOTIFY_SERVICE')).notifications.create(
to_binding: params[:users],
body: params[:body],
title: params[:title],
data: {data: #data},
fcm: {
data: {
title: params[:title],
body: params[:body]
}
}
)
I get notifications on the devices, but this is what I get back:
{"body": "stuff", "sound": null, "sms": null, "alexa": null, "facebook_messenger": null, "tags": [], "title": "My Title", "segments": [], "ttl": 545435, "gcm": null, "account_sid": "account_id", "priority": "high", "apn": null, "data": {"data": {"a_thing": 995, "type": "My Type", "id": 4344}}, "sid": "myid", "action": null, "date_created": "2019-11-05T15:25:27Z", "service_sid": "service_id", "identities": [], "fcm": {"data": {"body": "stuff", "title": "My Title"}}}
in the example from the docs (https://www.twilio.com/docs/notify/api/notification-resource?code-sample=code-send-a-notification-to-bindings-in-the-request-1&code-language=Ruby&code-sdk-version=5.x), it looks like a toBindings field should come back.
Is there a way to get this working, or some way to fetch received receipt data after with the notification id?
It looks like as of now, this feature is not implemented, and is mentioned in their coming soon section along with iOS/Android SDKs
Related
I'm setting up a test connect account through Stripe, but for some reason during the onboarding I get:
You cannot request any capability other than transfers for accounts that are under the recipient service agreement.
even though I set the capabilities only to transfers.requested: true.
Full details:
1. I created a connect account
Request:
POST https://api.stripe.com/v1/accounts
x-www-form-urlencoded body:
tos_acceptance[service_agreement]: recipient
capabilities[transfers][requested]: true
country: AT
type: express
Response:
{
"id": "acct_1IEKs6Q5kVIyiDKZ",
"object": "account",
"business_profile": {
"mcc": null,
"name": null,
"product_description": null,
"support_address": null,
"support_email": null,
"support_phone": null,
"support_url": null,
"url": null
},
"business_type": null,
"capabilities": {
"transfers": "inactive"
},
"charges_enabled": false,
"country": "AT",
"created": 1611780255,
"default_currency": "eur",
"details_submitted": false,
"email": null,
"external_accounts": {
"object": "list",
"data": [],
"has_more": false,
"total_count": 0,
"url": "/v1/accounts/acct_1IEKs6Q5kVIyiDKZ/external_accounts"
},
"login_links": {
"object": "list",
"total_count": 0,
"has_more": false,
"url": "/v1/accounts/acct_1IEKs6Q5kVIyiDKZ/login_links",
"data": []
},
"metadata": {},
"payouts_enabled": false,
"requirements": {
"current_deadline": null,
"currently_due": [
"business_type",
"external_account",
"tos_acceptance.date",
"tos_acceptance.ip"
],
"disabled_reason": "requirements.past_due",
"errors": [],
"eventually_due": [
"business_type",
"external_account",
"tos_acceptance.date",
"tos_acceptance.ip"
],
"past_due": [
"business_type",
"external_account",
"tos_acceptance.date",
"tos_acceptance.ip"
],
"pending_verification": []
},
"settings": {
"bacs_debit_payments": {},
"branding": {
"icon": null,
"logo": null,
"primary_color": null,
"secondary_color": null
},
"card_payments": {
"decline_on": {
"avs_failure": false,
"cvc_failure": false
},
"statement_descriptor_prefix": null
},
"dashboard": {
"display_name": "Some business LLC",
"timezone": "Etc/UTC"
},
"payments": {
"statement_descriptor": null,
"statement_descriptor_kana": null,
"statement_descriptor_kanji": null
},
"payouts": {
"debit_negative_balances": false,
"schedule": {
"delay_days": 7,
"interval": "daily"
},
"statement_descriptor": null
},
"sepa_debit_payments": {}
},
"tos_acceptance": {
"date": null,
"ip": null,
"service_agreement": "recipient",
"user_agent": null
},
"type": "express"
}
2. Got the onboarding link:
Request:
POST https://api.stripe.com/v1/accounts
x-www-form-urlencoded body:
account: acct_1IEKs6Q5kVIyiDKZ
refresh_url: https://example.com/reauth
return_url: https://example.com/return
type: account_onboarding
Response:
{
"object": "account_link",
"created": 1611780861,
"expires_at": 1611781161,
"url": "https://connect.stripe.com/express/onboarding/<some string>"
}
3. Went to the onboarding link
I got an error after pressing Next on the Tell us about your business section.
You cannot request any capability other than transfers for accounts that are under the recipient service agreement. For more information on recipient service agreements, see https://stripe.com/docs/connect/service-agreement-types#recipient.
Why does stripe think I'm requesting capabilities other than transfers?
Stripe got back to me:
The error is a bit cryptic but it is likely due to the way you configured Connect Onboarding in your settings in the Dashboard. This error happens because we try to request the card_payments capability for this account but it's not supported because you use the recipient agreement type. The reason we ask for that capability comes from the fact that you configured Connect to require that capability for European accounts. You can change this default behaviour in your dashboard settings in Test mode here: https://dashboard.stripe.com/test/settings/applications/express (and you would do the same for Live mode). With your flow you want only Transfers as a capability.
The suggestion worked:
Incorrect Settings:
Correct Settings:
It's strange because I used to be able to create accounts from these requests. So the settings must have changed at some point. But to my knowledge I never went and changed them.
If you have a bot-generated in-line button in a chat, that inline button can be used to take you to a bot.
My question is - is the reverse possible?
Can the bot have an inline button (when directly communicating with it) and it can transfer control to a group where the user and bot are both present
Consider this scenario:
I have a bot that track country names. When added to a group it detects a country name and says “see information about the country”.
When you click the button, the bot takes you to a chat with it (changes wondows and moves you out) and then the bot displays information about the country.
The bot then has a “go back or cancel” inline button.
If you click that button, it should take you BACK to the originating group you came from. Is that possible?
Variation:
Can it move you back to the originating group automatically (without an inline button) but say based on some text you type?
All I got is you wanna to take back your users to their refer place right?
For example you have "Back" button in your channel. If user came from Channel A you want to detect that when it clicks on Back button you want to take it back to Channel A.
No it's not possible. Telegram bots can't track user activity like this. But Telegram do itself. For example if you visit some channels like this:
Channel A => First Post => Go to another channel (Channel B) => Then go to admin profile
If you click Back button triple time you will go to first step which in this case is Channel A
Bot if your bot is in one private group or private channel you can get the link of every message because Telegram added this feature here :
you can now copy links to messages in private groups and channels – just like you could with public messages.
So if user mention your bot's username on any message in private group/channel you can get the link of that message. Here is some example :
{
"ok": true,
"result": [{
"update_id": 954197936,
"message": {
"message_id": 188,
"from": {
"id": 223110107,
"is_bot": false,
"first_name": "Ğąme ",
"last_name": "Ǿver!",
"username": "GameO7er",
"language_code": "en"
},
"chat": {
"id": -1001241538300,
"title": "Game Over Test Group",
"type": "supergroup"
},
"date": 1576312634,
"reply_to_message": {
"message_id": 130,
"from": {
"id": 156878147,
"is_bot": false,
"first_name": "Carlos F",
"username": "#Carlos****",
"language_code": "en"
},
"chat": {
"id": -1001241538300,
"title": "Game Over Test Group",
"type": "supergroup"
},
"date": 1554783715,
"text": "Hello Game Over!"
},
"text": "#Go***bot",
"entities": [{
"offset": 0,
"length": 10,
"type": "mention"
}]
}
}]
}
The link of this message is:
https://t.me/c/1241538300/130
As you can see it will be generate from chat id
"chat": {
"id": -1001241538300,
"title": "Game Over Test Group",
"type": "supergroup"
},
remove -100 from -1001241538300 then you have 1241538300 and contact /c/message_id to end of it.
"date": 1576312634,
"reply_to_message": {
"message_id": 130,
"from": {
"id": 156878147,
"is_bot": false,
"first_name": "Carlos F",
"username": "#Carlos****",
"language_code": "en"
},
and you will have :
https://t.me/c/1241538300/130
now I'm testing http request using POSTMAN
**"to": "/topics/all", ---> ?? how can i write this line??**
"priority": "high",
"notification": {
"title": "テスト Title",
"body": "テスト Body"
},
"data": {
"click_action": "FLUTTER_NOTIFICATION_CLICK"
}
I checked status 200 ok
when I send message with firebase web page, it works well
but without firebase cloud message service, it doesn't work
In firebase cloud message service, the targeting condition is
I'm suppose that if i can write targeting condition in http format, I can send message to my app
help me
What you are looking for is key "topic"
{
"topic": "all",
"notification":{
"title": "テスト Title",
"body": "テスト Body"
},
"data":{
"click_action": "FLUTTER_NOTIFICATION_CLICK"
}
}
I could http post only with Input.Number now, but Input.Date and Input.Text both receive 400 error.
I was planning to create a Microsoft Flow to receive some value from Outlook Adaptive Card Action.Http Post method, I followed some articles from internet show me how to do that, finally I get rid of the 401 error because it needs Authorisation header.
Okay, then I moved on to test http payload. The body couldn't be something like "body": "test", otherwise it will either gives me an 400 or even not shows adaptive card in email at all. After I learned that I have to use they officially suggested {{someId.value}} into "body".
I succeeded for the first time with Input.Number:
{
"type": "Input.Number",
"id": "test1",
"title": "New Input.Toggle",
"value": "",
"validation": null,
"placeholder": "Placeholder text",
"min": "0",
"max": "60"
}
Then outlook tells me it is successful and I did get the endpoint flow run and receive correct payload. And this is the "Action.Http" part:
"actions": [
{
"type": "Action.Http",
"title": "Say hello",
"method": "POST",
"url": "myflowhttptriggerurl",
"body": "{{nameInput.value}}",
"headers": [
{ "name": "Authorization", "value": "" }
]
}
]
Below is what get error:
After then, I tried with Input.Text and Input.Date, they all give me 400, below is payload, and don't worry for Action.Http, I change id each time when testing:
{
"type": "Input.Date",
"id": "h",
"title": "New Input.Toggle",
"value": "",
"validation": null
}
Text payload:
{
"type": "Input.Text",
"id": "newTask",
"isRequired": true,
"placeholder": "Enter a new task"
}
OK, first I would install the "Actionable Messages Debugger" into Microsoft Office to make it easier to understand if the contents of your card is correct.
It appears from the card you are doing it correct, what happening on your flow that is receiving the message?
You could always try send through a JSON object, so your body will be
"body": "{\"comment\":\"{{comment.value}}\"}"
Where comment is the id of your Input.Text as such:
{
"id": "comment",
"type": "Input.Text"
"isMultiline": true,
"placeholder": "Comments"
}
I am trying to send to multiple messages within one Webhook call to Dialogflow, which shall be passed to Messenger. Right now my Webhook responds with a malfunctioning JSON body:
{
'fulfillmentText': "Text",
'fulfillmentMessages': [{
"platform": "facebook",
"text": [{
"text": "Text"
}]
}],
'source': "facebook"
}
When I test the Webhook via Messenger I see the is typing symbol, but never receive the Text message. While testing the same Webhook from the Dialogflow Console I get
Webhook execution successful
returned. I guess I am missing some JSON fields to tell Dialogflow in which format it has to send the JSON two the Messenger API. Anybody having any clues on how to solve this issue?
Edit:
My latest not working trial...
{
"fulfillmentText": "Hola!",
"fulfillmentMessages": [
{
"text": {
"text": [
"Title: this is a title"
]
},
"platform": "FACEBOOK"
},
{
"text": {
"text": [
"Title: this is a title"
]
},
"platform": "FACEBOOK"
}
]
}
If you're only sending text you only need to provide a string to the fulfillmentText and don't have to provide the fulfillmentMessages attribute.
If you do provide a fulfillmentMessages attribute with the target platform Dialogflow will send your payload to Facebook. In this case, where the payload is invalid, no message will actually be surfaced in Facebook. remove the fulfillmentMessages attribute of the response JSON and your bot should respond.
If you'd like to add a card to your response you can send the following response:
{
"fulfillmentMessages": [
{
"platform": "FACEBOOK",
"card": {
"title": "Title: this is a title",
"subtitle": "This is an subtitle. Text can include unicode characters including emoji 📱.",
"imageUri": "https://developers.google.com/actions/images/badges/XPM_BADGING_GoogleAssistant_VER.png",
"buttons": [
{
"text": "This is a button",
"postback": "https://assistant.google.com/"
}
]
}
}
]
}
EDIT: If you want to send multiple messages you can do so by sending a response like this (this JSON will send two identical cards but you can change the message type (card/text/etc) based on this documentation):
{
"fulfillmentMessages": [
{
"platform": "FACEBOOK",
"card": {
"title": "Title: this is a title",
"subtitle": "This is an subtitle. Text can include unicode characters including emoji 📱.",
"imageUri": "https://developers.google.com/actions/images/badges/XPM_BADGING_GoogleAssistant_VER.png",
"buttons": [
{
"text": "This is a button",
"postback": "https://assistant.google.com/"
}
]
}
},
{
"platform": "FACEBOOK",
"card": {
"title": "Title: this is a title",
"subtitle": "This is an subtitle. Text can include unicode characters including emoji 📱.",
"imageUri": "https://developers.google.com/actions/images/badges/XPM_BADGING_GoogleAssistant_VER.png",
"buttons": [
{
"text": "This is a button",
"postback": "https://assistant.google.com/"
}
]
}
}
]
}
I mailed the Dialogflow support about this issue and it turns out that it is currently not possible to send multiple messages from a webhook.
Hi,
At this point, it's not possible to send sequential messages directly
from webhook. However, if you are using one of our one-click
integrations that support rich messages, you can invoke intents in
which multiple messages are defined from webhook through an event as
described at
https://dialogflow.com/docs/events#invoking_event_from_webhook.
Let me know if you have any questions.
Regards, Ankita from Dialogflow