Reply to multiple users telegram (Message Id) PHP Bot - bots

I have question, When I send a message from my api to several users, the message_id is the same for all users or each chat have a different id?
because when I try to send a reply to all my user I get this error
https://api.telegram.org/mytoken/sendMessage?chat_id=loopIDs&parse_mode=HTML&text=test&reply_to_message_id=1338
request failed! HTTP/1.1 400 Bad Request in ...
{
"ok": false,
"error_code": 400,
"description": "Bad Request: reply message not found"
}
the message id I get it when I send the request to telegram api.

each message has a different id, and you should reply to each message of any user separately.
https://api.telegram.org/mytoken/sendMessage?chat_id=user1ID&parse_mode=HTML&text=test&reply_to_message_id=user1MessageID
https://api.telegram.org/mytoken/sendMessage?chat_id=user2ID&parse_mode=HTML&text=test&reply_to_message_id=user2MessageID

Related

Slack webhook not sending personal message

I am trying to send personal message to particular user using webhook. I created webhook so i am getting personal message. But I am not able to send personal message to others personal chat. I don't want to use bot.
slack.setWebhook("Webhook");
slack.webhook({
channel: "D01KMUZ4E4S",
username: "webhookbot",
text: "This is posted to #general and comes from a bot named webhookbot."
}, function(err, response) {
console.log(response);
});
Slack Webhook URLs are tied to a particular channel, individual message, or group message. You need to create a new webhook in your workspace for each user you would like to send messages to.

Power Automate Send E-Mail via HTTP Post Error

I have set-up an approval workflow where a user gets notified if his / her request has been submitted for approval. The request is submitted via Microsoft Forms, the workflow then takes the submitters e-mail as the "To" for said notification. This is done via a HTTP Post Action so that the e-mail is directly from SharePoint and not me, the process owner.
This works fine for most user e-mails... however there are some cases where this error message pops up:
{"odata.error":{"code":"-2130242040, Microsoft.SharePoint.SPException","message":{"lang":"en-US","value":"The e-mail message cannot be sent. Make sure the e-mail has a valid recipient."}}}
My action is configured as follows:
HTTP Post Action Configuration
The flow successfully retrieves the user's e-mail address but it is not sending it. This happens to roughly 20% of users.
Thank you!
The body of an unsuccessful e-mail HTTP Post:
"body": {
"status": 400,
"message": "{\"odata.error\":{\"code\":\"-2130242040, Microsoft.SharePoint.SPException\",\"message\":{\"lang\":\"en-US\",\"value\":\"The e-mail message cannot be sent. Make sure the e-mail has a valid recipient.\"}}}\r\nclientRequestId: xyz\r\nserviceRequestId: xyz",
"source": "https://www.sharepoint.com/Teams/Team_Name/_api/SP.Utilities.Utility.SendEmail",
"errors": []
}
}
Successful HTTP Post:
{
"odata.null": true
}

How to get user id using email id in teams using python

I'm creating a bot to notify a user after an action has been done. Where i'm able to get my details using the below(screenshot) code.
Now in order to send a message to a user through a bot i would need his/her ID before hand to send a notification like in the above case i'm able to extract my info as i'm already logged in Teams. Unfortunately alphanumeric ID is very difficult to use and needs to be there before requesting and sending the notification.
Below is the JSON result if the ID is already known.
Response body
{
"id": "29:1GcS4EyB_oSI8A88XmWBN7NJFyMqe3QGnJdgLfFGkJnVelzRGos0bPbpsfJjcbAD22bmKc4GMbrY2g4JDrrA8vM06X1-cHHle4zOE6U4ttcc",
"objectId": "9d3e08f9-a7ae-43aa-a4d3-de3f319a8a9c",
"givenName": "Larry",
"surname": "Brown",
"email": "Larry.Brown#fabrikam.com",
"userPrincipalName": "labrown#fabrikam.com",
"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47",
"userRole":"user"
}
How i can get the unique ID of the user by using email id so that i can send a personal message to him/her using bot.
There is an option to fetch conversationChatId to send proactive message.
Before you fetch the conversation Id, you should check whether your bot is currently installed for a message recipient or not.
Note: Installation of app via Graph API triggers conversation update event for Bot.

Microsoft Bot Framework and Slack - always returning Forbidden when testing

I've registered a bot and write a demo with MS bot and LUIS.I also hosted it in azure and got a https endpoint like
https://$team***plus:t27oCcSM0b85uzQhl2bg2W****KQAbe8yyjojegY4HrMvs#teambotplus.******eweb****et/deploy ,
and I paste it like https://$team***plus:t27oCcSM0b85uzQhl2bg2W****KQAbe8yyjojegY4HrMvs#teambotplus.******eweb****et/deploy/api/messages
However,when typed the Test button ,I just got :
enter image description here
It's also added in slack channel,and returned nothing after I send a message.
Three messages from slack channel issues
*POST to luckybot failed: POST to the bot's endpoint failed with HTTP status 403
*There was an error sending this message to your bot: Forbidden
*There was an error sending this message to your bot: Forbidden
The https endpoint should looks like https://YourWebAppName.azurewebsites.net/api/messages and that's the URL you should put in your Bot's configuration page.

Facebook messenger, testing chatbot, incorrect sender.id (data.pageEntry.messaging.event.sender.id)

Clarifying my post:
I'm setting up a facebook chatbot using the sample code. This should allow me to send messages to the chatbot (via Messenger iOS app, or via chat window at Facebook.com, app page). The expected behavior would be
Send chat message
Echo chat message
Display correct logging, no errors
However, when I send a chat message, while it correctly echoes the chat message, I am finding an error in my logging. It produces the following error message:
{ message: '(#100) No matching user found',
type: 'OAuthException',
code: 100,
fbtrace_id: 'D+PAc3ZfmLS' }
After investigation, it appears as though the app is identifying the incorrect userID for my account (app owner). It has the correct receiver ID (page ID of the application). I cannot figure out why this occurs. A copy of typical logging information is below. The incorrect sender ID is listed as "1053426944750274".
Received message for user 1053426944750274 and page 289085874757891 at 2016-07-06T20:32:31+00:00 with message: {"mid":"mid.1467837151667:954f158fd950334f60", "seq":212, "text":"marco"}
Successfully sent generic message with id mid.1467837152021:729cf052bc826dc592 to recipient 1053426944750274
Received message for user 289085874757891 and page 1053426944750274 at 2016-07-06T20:32:32+00:00 with message: {"is_echo":true,"app_id":284007785268790, "mid":"mid.1467837152021:729cf052bc826dc592", "seq":213, "text":"marco"}
Are you sure you are using the sender.id in the message recipient.id?
be aware that Facebook id is different than what you need to use when you respond to users via messenger send API.
When representing a user, these IDs are page-scoped IDs (PSID). This means that the IDs of users are unique for a given page.
If you have an existing Facebook Login integration, user IDs are app-scoped and will not work with the Messenger platform.
source

Resources