ACTIONS
  • Home
  • My Actions
  • My Projects
  • My Packages
Brevo -> Send SMS
Function Documentation: Brevo → Send SMS

Action summary

Brevo -> Send SMS

Unico Connect

Function Documentation: Brevo → Send SMS

Brevo API documentation

Overview

This function sends an SMS using the Brevo (Sendinblue) API. The function requires inputs such as the API key, sender name, recipient's phone number, and the message content. It processes the inputs and sends the SMS via an API request to Brevo.

Inputs

  1. brevo_api_key (registry/text) Required

    • Description: The API key used for authenticating the Brevo (Sendinblue) API.
    • Example: xkeysib-...
  2. sender_name (text) Required

    • Description: The name of the sender that appears on the recipient’s phone.
    • Example: CompanyName
  3. recipient_number (text) Required

    • Description: The phone number of the SMS recipient.
    • Example: +1234567890
  4. message (text) Required

    • Description: The content of the SMS.
    • Example: Your OTP is 123456. Please use it to verify your account.

Function Stack

1. Try / Catch Block

1. API Request to https://api.brevo.com/v3/transactionalSMS/sms

  • Purpose: Sends the SMS via the Brevo API with the provided inputs.
  • Return Value: The API response is stored as api_response.

2. Create Variable: response

  • Variable: var: response = var: api_response.response.result
  • Purpose: Stores the API response for the SMS send operation.

2 Error Handling (Catch)

  1. Create Variable: response
    • Purpose: If the API call fails or returns an error, this block catches the error and provides an error message.

Response

The function returns the result of the SMS send operation, including success or error messages from the Brevo API.

Success Response

{
  "reference": "ab1cde2fgh3i4jklmno",
  "messageId": 1511882900176220,
  "smsCount": 2,
  "usedCredits": 0.7,
  "remainingCredits": 82.85
}

Error Response

{
  "message": "Key not found",
  "code": "unauthorized"
}

Example

Input

{
    "sender_name":"John Doe",
    "recipient_number":"918327705****",
    "message":"Hello world"
}

Output

{
  "reference": "ab1cde2fgh3i4jklmno",
  "messageId": 1511882900176220,
  "smsCount": 2,
  "usedCredits": 0.7,
  "remainingCredits": 82.85
}

Version notes

Current
2024-10-11T16:18:01.000+00:00