Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Sends WhatsApp messages and manages templates, WABAs, and phone numbers through the Telnyx WhatsApp Business API in JavaScript.
50% 100%+50 ptsof test cases passed
Passed 22 of 22 test cases with the skill, and 11 of 22 without it.
Write a Node.js function using the Telnyx library to retrieve all WhatsApp Business Accounts tied to the account and print their IDs and status.
Calls client.whatsapp.businessAccounts.list method
3 of 3 safety checks passed
npm install telnyx
import Telnyx from 'telnyx';
const client = new Telnyx({ apiKey: process.env['TELNYX_API_KEY'] });
All examples below assume client is already initialized as shown above.
All API calls can fail with network errors, rate limits (429), validation errors (422), or authentication errors (401). Always handle errors in production code:
try {
const response = await client.messages.sendWhatsapp({
from: "+19452940762",
to: "+18005551234",
type: "WHATSAPP",
whatsapp_message: {
type: "text",
text: { body: "Hello from Telnyx!" },
},
});
} catch (error) {
if (error instanceof Telnyx.APIError) {
console.log(`API error: ${error.status} - ${error.message}`);
} else if (error instanceof Telnyx.AuthenticationError) {
console.log("Invalid API key");
} else if (error instanceof Telnyx.RateLimitError) {
Published skills whose descriptions closely match this one, with their benchmark result.
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.