Use Cases Integrations
api transactional
May 19, 2023
Sending an SMS
E-goi's transactional API makes it easy to send SMS messages to virtually any country with a single API call.

Requirements

  • E-goi Account
  • Active Transactional Service
  • Valid Mobile Phone Sender

Scenario

You want to text a customer their payment reference for an outstanding invoice.

Sending an SMS

Before you send an SMS using our API, you’ll need to activate E-goi’s transactional service (at https://developers.e-goi.com/transactional/v1/#operation/create or via the Reports > Transactional menu in the E-goi interface).

Once the service is active, you’ll need to add and confirm an SMS sender (under the User > Senders > Mobile menu in the E-goi interface)

Mobile Senders

Encoding

Character limits apply to your SMS, depending on how your message is encoded.

If you use unicode, you can include special characters and emojis (your SMS will be limited to 70 chars overall).

If you don’t need special chars, opt for gsm0338 encoding to increase your character limit to 160 chars per message.

If the message exceeds the character limit, you can use the maxCount field in your payload to set how many parts it will be split into.

To help you with your calculations, our API provides a service that gives you the total chars in a message based on its encoding: https://developers.e-goi.com/transactional/v2/#operation/smsLengthCalculator

Webhooks

If you later need to get data from the SMS you sent (eg. using a webhook), you can use custom data to include your own identifier.

E-goi Public API Server -> https://slingshot.egoiapp.com/api/v2/sms/messages/action/send/single


NOTE!

If you want to send more than 1 SMS in the same request (maximum 100 SMS by request), you can use the Send Multiple Sms Messages method.


Payload Example:

{
  "to": "351-987654321",
  "from": "1234",
  "textBody": "Here's a bunch of props to you, {{ name }}, enjoy!",
  "encoding": "unicode",
  "maxCount": 1,
  "mergeTags": [
    "name:John Doe"
  ],
  "priority": "non-urgent",
  "customData": "meta-data, my relevant metadata",
  "registered": false,
  "group": "welcome",
  "scheduleTo": "yyyy-MM-dd HH:mm:ss"
}

Answer Payload Example:

{
  "messageId": "1234"
}