Anyway to format messages injecting into Zoom channels? Trying to process with the Zoom message marking format but the API keeps kicking a 400 back claiming invalid JSON.
Hi @gmerideth
First off, welcome to the Pipedream community. Happy to have you!
Can you share an example of the body of your Zoom request?
Can you also share the content of the HTTP response from Zoom? Usually in the body of the API response from another service, there’s an errors object that will tell you exactly why your API call was rejected.
It’s the verbatim code from the site. The only thing I tried to modify and understand in injecting a message was how to provide my own text to the message through using {{steps.trigger.event.body}} but clearly this is wrong.
With the API call, how do I go about using my own zoom formatted text in the message body field?
const https = require("https")
const data = JSON.stringify({"data":{"message":"Hello"}})
const options = {
hostname: "", port: 443, path: "/", method: "POST", headers: {
"Content-Type": "application/json",
"Content-Length": data.length,
},}
const req = https.request(options)
req.write(data)
req.end()
Have you tried using the example code scaffolding with the Pipedream Zoom - Use any Zoom API step?
From there you can see an example request to the Zoom API with Node.js, then you can modify the API endpoint URL, and the body of the API call.
For example, out of the box, the Zoom - Use any Zoom API Node.js scaffolding looks like this:
import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
zoom: {
type: "app",
app: "zoom",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://api.zoom.us/v2/users/me`,
headers: {
Authorization: `Bearer ${this.zoom.$auth.oauth_access_token}`,
},
})
},
})
Then you can modify it according to the Zoom API docs.
import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
zoom: {
type: "app",
app: "zoom",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://api.zoom.us/v2/chat/users/{userId}/messages`,
headers: {
Authorization: `Bearer ${this.zoom.$auth.oauth_access_token}`,
},
data: steps.trigger.event.body
})
},
})
Just a side note, I’m not sure where your example code is from. The API endpoint I’m seeing for sending a message to a channel looks very different: Zoom Chat API
Could you share the link to the docs you’re seeing?