-
Couldn't load subscription status.
- Fork 5.5k
Open
Labels
actionNew Action RequestNew Action RequestenhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is neededtriagedFor maintainers: This issue has been triaged by a Pipedream employeeFor maintainers: This issue has been triaged by a Pipedream employee
Description
Is there a specific app this action is for?
Microsoft Teams Bot
Example workflow for testing:
https://pipedream.com/@pd-component-dev/projects/proj_mJs6Ybr/ms-teams-bot-p_WxCWqBN/build
API Documentation:
https://learn.microsoft.com/en-us/azure/bot-service/rest-api/bot-framework-rest-connector-quickstart?view=azure-bot-service-4.0#reply-to-the-users-message
Example working code:
import { axios } from "@pipedream/platform"
export default {
props: {
microsoft_teams_bot: {
type: "app",
app: "microsoft_teams_bot",
}
},
async run({steps, $}) {
// Get the incoming message data
const incomingMessage = steps.trigger.event.body;
const data = {
type: "message",
from: {
id: incomingMessage.recipient.id,
name: incomingMessage.recipient.name
},
conversation: {
id: incomingMessage.conversation.id
},
recipient: {
id: incomingMessage.from.id,
name: incomingMessage.from.name
},
text: "Hello! I received your message: " + incomingMessage.text,
replyToId: incomingMessage.id
};
return await axios($, {
url: `${incomingMessage.serviceUrl}/v3/conversations/${incomingMessage.conversation.id}/activities/${incomingMessage.id}`,
method: 'POST',
headers: {
'Authorization': `Bearer ${this.microsoft_teams_bot.$auth.oauth_access_token}`,
'Content-Type': 'application/json'
},
data,
});
},
}
Metadata
Metadata
Assignees
Labels
actionNew Action RequestNew Action RequestenhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is neededtriagedFor maintainers: This issue has been triaged by a Pipedream employeeFor maintainers: This issue has been triaged by a Pipedream employee
Type
Projects
Status
Blocked