This is our new version of API. If you want to use the old version of API: Transactional v1
Use Cases Integrations
Transactional API

Transactional API (V2)

Introduction

This API is a service provided by E-goi to send transactional messages.

Transactional Messaging is a 1-to-1 communication channel, usually from an organization directed to a specific consumer.
They can be triggered by:

  • Actions - The consumer interacts with the organization (ie.: online shopping);
  • Time - The consumer's actions are time-bounded by the organization (ie.: period of inactivity).

Because of the nature of these messages,
it is expected that the consumer is interested in the content of these messages.
Therefore, they have a different treatment from marketing messages, and have a higher acceptance and opening rate.

DISCLAIMER

Please notice that this platform is more delicate in regards to the nature and processing of its messages.

It should NOT be used as a mean of mass marketing, scams, phishing or overall unruly behaviour.

Failure to comply may lead to limitation of use and even termination of account.

Transport Layer Security (TLS)

Transport Layer Security (TLS) is a widely used authentication and encryption protocol that establishes a secure communications channel for data-in-transit while ensuring that the client and server can validate one another.
Our API requires TLS 1.2 or TLS 1.3. We recommend TLS 1.3.

TLS 1.3 ciphers

  • TLS_AES_256_GCM_SHA384 (0x1302) ECDH x25519 (eq. 3072 bits RSA) FS
  • TLS_CHACHA20_POLY1305_SHA256 (0x1303) ECDH x25519 (eq. 3072 bits RSA) FS
  • TLS_AES_128_GCM_SHA256 (0x1301) ECDH x25519 (eq. 3072 bits RSA) FS

TLS 1.2 ciphers

  • TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (0xc030) ECDH x25519 (eq. 3072 bits RSA) FS
  • TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (0xc02f) ECDH x25519 (eq. 3072 bits RSA) FS
  • TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 (0x9f) DH 4096 bits FS
  • TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 (0x9e) DH 4096 bits FS

Character limits

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. More info

SDKs

Get started quickly with Transactional with our integration tools. Our SDK is a modern open source library that makes it easy to integrate your application with Transactional services.

SMTP

The Transactional SMTP Service consists of a simple SMTP server, listening to SSL/TLS connections on port 1587.

To configure your preferred client you need to add an account with the same e-mail as the desired client's user -
it will be used to identify the real sender in the client list of senders.
For the example below we will use the sender - info@example.com - and the username of client's user account - egoi@example.com.

The configuration for the Outgoing SMTP Server in Thunderbird would be as follows:

Parameter Description Definition/Example
Mail Server the address of the smtp server bo51.e-goi.com
Port the port to connect to the smtp 1587
Connection Security the security type STARTTLS
Authentication Method the authentication method password
User Name the user name egoi@example.com

After you add this configuration, you can use it by sending from the info@example.com account and using the configured SMTP Server.
After you hit send the first time, the program should challange you for a password to authenticate -
use the password you normally you to access the E-Goi Backoffice with the configured User Name (egoi@example.com in this case).

// This example uses PHPMailer 
require 'PHPMailerAutoload.php'; 
 
// Configure PHPMailer instance 
$mail = new PHPMailer; 
$mail->isSMTP(); 
$mail->SMTPAuth = true; 
$mail->Host = "bo51.e-goi.com"; 
$mail->Port = 1587; 
$mail->SMTPSecure = "tls"; 
 
// Username and Password 
$mail->Username = "egoi@example.com"; 
$mail->Password = "the password"; 
 
// From 
$mail->setFrom('info@example.com', 'Sales Dept.'); 
    // .. or $mail->addCustomHeader('X-Sender-Hash: abcdef1234567890abcdef1234567890'); 
 
// Destination 
$mail->addAddress('johndoe@mail.com', 'John Doe'); 
    // .. or $mail->addCustomHeader('X-Reply-To-Hash: abcdef1234567890abcdef1234567890'); 
 
// Set the appropriate encoding for subject/body/alternate 
$mail->CharSet = "UTF-8"; 
 
$mail->Subject = 'Here is your reciept'; 
 
// The content is read from a file on the filesystem 
$mail->msgHTML(file_get_contents("/path/to/receipt.html")); 
 
// [optional] Set the text version of the message 
$mail->AltBody = file_get_contents("/path/to/receipt.txt"); 
 
// Define custom headers 
$mail->addCustomHeader("X-Open-Tracking-Enabled: true"); 
$mail->addCustomHeader("X-Click-Tracking-Enabled: true"); 
 
// Define Registered headers  
$mail->addCustomHeader("X-Registered: true"); 
 
// Define message priority (optional)  
//(X-Priority header is overriden by PHPMailer when using addCustomHeader) 
$mail->Priority = "urgent"; 
 
//send the message, check for errors 
if (!$mail->send()) { 
    echo "Mailer Error: " . $mail->ErrorInfo; 
} else { 
    echo "Message sent!"; 
} 

Alerts

Alert are a routine of messages, prepared in advance, to be triggered by events set by the user. The channel of the message can be either Sms or Email.

The Acknowledge Alerts entails two distinct steps: Create and Execute.

Create is the step where a Acknowledge Alerts flow (or template) is set.
It requires some identifying information, as well as the message to be sent.

Execute takes the Acknowledge Alerts flow, customizes the messages with To addresses and merge tags. Then, it starts the flow by sending the first message.

When the Alarm is executed, the message is resent after the interval,
unless someone responds to it (Acknowledge) or the repetition limit is reached.

states

The alert can be in specific states. the following is a list of states an alert can be in.

states

State Description Is Final?
pending The Alert has been activated, and its awaiting recipient input No
acknowledge The Alert was responded by a recipient Yes
noaction The Alert was not responded by a recipient, having reached the Max Attempts Yes
cancelack The Alert was canceled by the sender Yes;

Execute Alert

This method executes an alert flow , using a pre-created alert template.

Authorizations:
ApiKey
Request Body schema: application/json

default response

One of
alertTemplateName
required
string

the name of the alert template to use. Already has to exist in the system.

senderId
required
string

the id to identify the sender.

required
Array of objects (ToEmailAlertObject)

a list of recipients of the alert.

Responses

Request samples

Content type
application/json
Example
{
  • "alertTemplateName": "welcome",
  • "senderId": "1234",
  • "to": [
    ]
}

Response samples

Content type
application/json
{
  • "alertId": "1234"
}

Stop Alert

This method will stop any alerts that are being processed

Authorizations:
ApiKey
Request Body schema: application/json
alertName
string

The name of the Request.

Responses

Request samples

Content type
application/json
{
  • "alertName": "1234"
}

Response samples

Content type
application/json
{
  • "alertId": "1234"
}

Get All Alert Templates

This method returns all the Alert Templates

Authorizations:
ApiKey

Responses

Request samples

curl --location --max-time 30 --request GET 'slingshot.egoiapp.com/api/v2/alert/template' \
--header 'ApiKey: '

Response samples

Content type
application/json
[
  • {
    }
]

Create An Alert Template

This method will create and add an alert template

Authorizations:
ApiKey
Request Body schema: application/json
name
string

Text Identifier for the template.

templateId
string

Template used to create the alert.

channel
string

Channel to where the alert template belongs to.

interval
integer <int64>

The interval in seconds between messages to the recipient(s). Maximum interval is 86400 seconds (24 hours).

maxAttempts
integer <int64>

The maximum amount of attempts to be made.

Responses

Request samples

Content type
application/json
{
  • "name": "Alert1.",
  • "templateId": "2",
  • "channel": "sms",
  • "interval": 3600,
  • "maxAttempts": 1
}

Response samples

Content type
application/json
{
  • "alertTemplateId": "1234"
}

Get Single Alert Template

This method returns the Alert Template wih the id in the path

Authorizations:
ApiKey
path Parameters
id
required
string
Example: 1234

The id of the Alert Template

Responses

Request samples

curl --location --max-time 30 --request GET 'slingshot.egoiapp.com/api/v2/alert/template/<string>' \
--header 'ApiKey: '

Response samples

Content type
application/json
{
  • "alertId": 1,
  • "name": "Alert1.",
  • "templateId": "2",
  • "channel": "sms,email,push",
  • "interval": 3600,
  • "maxAttempts": 1
}

Remove An Alert Template

This method removes an Alert Template from the system

Authorizations:
ApiKey
path Parameters
id
required
string
Example: 1234

The id of the Alert Template to remove

Responses

Request samples

curl --location --max-time 30 --request DELETE 'slingshot.egoiapp.com/api/v2/alert/template/<string>' \
--header 'ApiKey: '

Response samples

Content type
application/json
{}

Update Single Alert Template

This method will change information about the template

Authorizations:
ApiKey
path Parameters
id
required
string
Example: 1234

The id of the Alert Template to edit

Request Body schema: */*
name
string

Text Identifier for the template.

templateId
string

Template used to create the alert.

channel
string

Channel to where the alert template belongs to.

interval
integer <int64>

The interval in seconds between messages to the recipient(s). Maximum interval is 86400 seconds (24 hours).

maxAttempts
integer <int64>

The maximum amount of attempts to be made.

Responses

Request samples

curl --location --max-time 30 --request PATCH 'slingshot.egoiapp.com/api/v2/alert/template/<string>' \
--header 'ApiKey: ' \
--header 'Content-Type: */*' \
--data-raw '{"name":"<string>","templateId":"<string>","channel":"<string>","interval":"<long>","maxAttempts":"<long>"}'

Multi-Channel

Multi-channel are a set of pre configured messages, using all available channels,
whose sending depends on the state of the previous message.

The Multi-channel entails two distinct steps: Create and Execute

Create is the step where a multichannel flow (or template) is set.
It requires some identifying information, as well as the messages sorted and conditions defined.

Execute takes the multichannel flow, customizes the messages with To addresses and merge tags. Then, it starts the flow by sending the first message.

In order to track the state of the messages the following parameters will be set to true.

  • openTracking

  • clickTracking

The following diagram shows the workflow of the multi-channel.

MultiChannelFlux

The following diagram shows the states of the multi-channel.

states

State Description Is Final?
pending The Multi-channel has been activated, and its awaiting recipient input No
interrupted The Multi-channel was interrupted by the recipient, by performing an action Yes
finished The Multi-channel ran out of messages, and terminated Yes
canceled The Multi-channel was canceled due to an error Yes

Condition of messages

Name Description Channel
none no condition on previous message email, sms
delivered The message was successfully delivered email, sms
not_delivered the message was not successfully delivered email, sms
open previous message has been opened email
not_open previous message hasnt been opened email
click previous message has a link that has been clicked email
not_click previous message has a link that has not been clicked email;

Get All Multi-Channel Flows

This method returns all Multi-Channels Flows set in the system

Authorizations:
ApiKey

Responses

Request samples

curl --location --max-time 30 --request GET 'slingshot.egoiapp.com/api/v2/multi-channel/flow' \
--header 'ApiKey: '

Response samples

Content type
application/json
[
  • {
    }
]

Create Multi-Channel Flow

This method will create and add a Multi-Channel Flow. First message doesn't need interval or condition, since it doesn't depend on other messages

Authorizations:
ApiKey
Request Body schema: application/json
name
string

the colloquial name to refer to the plan

group
string

the tag to group the messages

Array of objects (MultiChannelMessageObject)

A list of the messages in order.

Responses

Request samples

Content type
application/json
{
  • "name": "Welcome Cycle",
  • "group": "welcome",
  • "messages": [
    ]
}

Response samples

Content type
application/json
{
  • "multiChannelId": "1234"
}

Get Single Multi-Channel Flow

This method returns the Multi-Channel Flow wih the id in the path

Authorizations:
ApiKey
path Parameters
id
required
string
Example: 1234

The id of the Multi-Channel Flow

Responses

Request samples

curl --location --max-time 30 --request GET 'slingshot.egoiapp.com/api/v2/multi-channel/flow/<string>' \
--header 'ApiKey: '

Response samples

Content type
application/json
[
  • {
    }
]

Remove Single Multi-Channel

This method removes a Multi-Channel Flow from the system

Authorizations:
ApiKey
path Parameters
id
required
string
Example: 1234

The id of the Multi-Channel Flow to remove

Responses

Request samples

curl --location --max-time 30 --request DELETE 'slingshot.egoiapp.com/api/v2/multi-channel/flow/<string>' \
--header 'ApiKey: '

Response samples

Content type
application/json
{}

Execute Multi-Channel

This method will create and start a flow, sending the Multi-Channel of messages to the appropriate recipient

Authorizations:
ApiKey
Request Body schema: application/json
templateId
required
string

the id of the Multi Channel Template to be used.

object (ToMultiChannelObject)

information about the recipient.

object (SenderMultiChannelObject)

information about the sender.

Responses

Request samples

Content type
application/json
{
  • "templateId": "1234",
  • "to": {
    },
  • "sender": {
    }
}

Response samples

Content type
application/json
{
  • "multiChannelId": "1234"
}

Verify

Verify is the E-goi version of a 2-Factor Authentication (2FA) via Sms messaging.

A 2FA request is sent when a sender (organization) needs to verify the identity of a recipient.
To do this an intermediary (E-goi) will provide an independent tunnel between the two.
A successful string of events should be the following:

  1. The sender requests a validation code to be sent to the recipient;
  2. The system generates the code;
  3. The system sends the code to the recipient;
  4. The recipient submits the code to the sender;
  5. The sender submits the code in the system;
  6. The system validates the code.

Verify SSD

In this series of events some alternatives may occur.

  • Alternative - The sender wants to cancel the Verify request.
    • Solution - The sender can cancel the Verify request at any point in time before the recipient validates the code.
  • Alternative - The code validity expires.
    • Solution - The system marks the request as expired.
  • Alternative - The recipient submits the wrong code.
    • Solution - The system waits for the correct code (while request has not expired).

Verify SSD

State Description Is Final?
pending The Verify has been activated, and its awaiting recipient input No
Validated The code the recipient sent was valid, and the Verify resquest was successful Yes
Invalidated The code the recipient sent was not valid, ant the Verify code of the user is not valid Yes
Canceled The Verify request was canceled by the sender, or it has expired its validity Yes;

Request Token (Sms)

This method will generate a code and send a message with it to a recipient, via sms

Authorizations:
ApiKey
Request Body schema: application/json
senderId
required
string

The id of the sender.

to
required
string

The phone number of the recipient of the code. Format should be countryCode-phoneNumber

message
string

the message that the user is going to receive. location of the code should be given by using the tag {{ code }}. All instances of {{ code }} will be replaced with a code that is in accordance with the settings. If the tag is not present, the code will be added at the end of the message.

codeLength
integer <int32>
Default: 6

the length of the code in characters. Maximum is 20 characters. Default is 6 characters.

codeValidity
integer <int32>
Default: 600

the period of time the code is valid after the message has been sent, in seconds. Defaults to 600 seconds (10 min). Maximum validity is 3600 seconds (1 hour).

codeType
string
Default: "numeric"
Enum: "numeric" "alpha" "alphanumeric" "hex"

the format of the code. can be:

Format Description RegEx
numeric numbers [0-9]
alpha letters [A-Z]
alphanumeric numbers and letters [0-9A-Z]
hex numbers and letters up to F [0-9A-F]

Responses

Request samples

Content type
application/json
{
  • "senderId": "1234",
  • "to": "351-987654321",
  • "message": "To authorize the operation please introduce the following code code: {{ code }}",
  • "codeLength": 6,
  • "codeValidity": 600,
  • "codeType": "numeric"
}

Response samples

Content type
application/json
{
  • "requestId": "1234"
}

Request Token (Email)

This method will generate a code and send a message with it to a recipient, via email

Authorizations:
ApiKey
Request Body schema: application/json
email
required
string

Email address to where the token will be sent to

subject
required
string

Email subject of the message that will be sent

senderId
string

Send Identifier that will send the Token via EMAIL

senderHash
string

Send Identifier that will send the Token via EMAIL

group
string

Group name, Used to group multiple message (useful as a tag in statistics)

message
string

the message that the user is going to receive. location of the code should be given by using the tag {{ code }}. All instances of {{ code }} will be replaced with a code that is in accordance with the settings. If the tag is not present, the code will be added at the end of the message.

codeLength
integer <int32>
Default: 6

the length of the code in characters. Maximum is 20 characters. Default is 6 characters.

codeValidity
integer <int32>
Default: 600

the period of time the code is valid after the message has been sent, in seconds. Defaults to 600 seconds (10 min). Maximum validity is 3600 seconds (1 hour).

codeType
string
Default: "numeric"
Enum: "numeric" "alpha" "alphanumeric" "hex"

the format of the code. can be:

Format Description RegEx
numeric numbers [0-9]
alpha letters [A-Z]
alphanumeric numbers and letters [0-9A-Z]
hex numbers and letters up to F [0-9A-F]
mergeTags
Array of strings

Responses

Request samples

Content type
application/json
{
  • "email": "<email@address>",
  • "subject": "<subject_of_email>",
  • "senderId": "0",
  • "senderHash": "<your sender hash>",
  • "group": "Login",
  • "message": "To authorize the operation please introduce the following code code: {{ code }}",
  • "codeLength": 6,
  • "codeValidity": 600,
  • "codeType": "numeric",
  • "mergeTags": [
    ]
}

Response samples

Content type
application/json
{
  • "requestId": "1234"
}

Request Token (Push)

This method will generate a code and send a message with it to a recipient, via push notification

Authorizations:
ApiKey
Request Body schema: application/json
apikey
required
string

The user's apikey

appId
required
integer <int32>

Push Application Identifier

title
string

Push Application Message Title

device
string

Push Application Device Token

message
string

the message that the user is going to receive. location of the code should be given by using the tag {{ code }}. All instances of {{ code }} will be replaced with a code that is in accordance with the settings. If the tag is not present, the code will be added at the end of the message.

codeLength
integer <int32>
Default: 6

the length of the code in characters. Maximum is 20 characters. Default is 6 characters.

codeValidity
integer <int32>
Default: 600

the period of time the code is valid after the message has been sent, in seconds. Defaults to 600 seconds (10 min). Maximum validity is 3600 seconds (1 hour).

codeType
string
Default: "numeric"
Enum: "numeric" "alpha" "alphanumeric" "hex"

the format of the code. can be:

Format Description RegEx
numeric numbers [0-9]
alpha letters [A-Z]
alphanumeric numbers and letters [0-9A-Z]
hex numbers and letters up to F [0-9A-F]

Responses

Request samples

Content type
application/json
{
  • "apikey": "<your hash api key>",
  • "appId": 1,
  • "title": "<your_title_here>",
  • "device": "<your_device_token_here>",
  • "message": "To authorize the operation please introduce the following code code: {{ code }}",
  • "codeLength": 6,
  • "codeValidity": 600,
  • "codeType": "numeric"
}

Response samples

Content type
application/json
{
  • "requestId": "1234"
}

Get Verify Request

This method gets a verify request, including status of it

Authorizations:
ApiKey
path Parameters
id
required
string
Example: 1234

The id of the Verify Request

Responses

Request samples

curl --location --max-time 30 --request GET 'slingshot.egoiapp.com/api/v2/verify/<string>' \
--header 'ApiKey: '

Response samples

Content type
application/json
{
  • "id": "1234",
  • "messageId": "1234",
  • "senderId": "1234",
  • "recipientNumber": "351-987654321",
  • "code": "1234",
  • "codeTTL": 600,
  • "status": "pending",
  • "createDate": "2020-03-06T11:57:34Z",
  • "message": "Here is your code: {CODE}"
}

Validate Verify Code

This method validates the code submitted by the recipient. This request should be made by the sender of the Verify request

Authorizations:
ApiKey
path Parameters
id
required
string
Example: 1234

The id of the Verify Request

Request Body schema: application/json
code
string

The Code to validate.

Responses

Request samples

Content type
application/json
{
  • "code": "123456"
}

Response samples

Content type
application/json
[
  • {
    }
]

Cancel Verify Request

This method will cancel the requested verify. No codes will be further generated or confirmed within the context of the id of the message

Authorizations:
ApiKey
path Parameters
id
required
string
Example: 1234

The id of the Verify Request

Responses

Request samples

curl --location --max-time 30 --request POST 'slingshot.egoiapp.com/api/v2/verify/<string>/cancel' \
--header 'ApiKey: '

Response samples

Content type
application/json
[
  • {
    }
]

Resend Verify Code

This method will resend the requested verify. A new code will be generated and sent to the recipient

Authorizations:
ApiKey
path Parameters
id
required
string
Example: 1234

The id of the Verify Request

Responses

Request samples

curl --location --max-time 30 --request POST 'slingshot.egoiapp.com/api/v2/verify/<string>/resend' \
--header 'ApiKey: '

Response samples

Content type
application/json
[
  • {
    }
]

Email

Emails can be send using the API, or using the SMTP Server.
The API should be the preferred method, as it is better documented, and have much more functionalities. However, for simple emails, SMTP use is fine. See below for its configuration.

Emails are composed using different sets of information:

Parameter Description Examples
Contacts All contact information. Includes main recipients well as other interested recipients. To, Cc, Bcc, From, Reply-to
Content The content of the message. Includes text (plain text or HTML) and attachments. Subject, Body (HTML or Text), Template, Attachments
Options The configuration of the email to the sender. Tracking, Registered, Header, Group/Tag
Status The information about the message after it has been sent. Status

The Sender can not interact with the status and events.
He can only follow and check the state of the message.

The following is a diagram of all the states an email can be in.

states

Status Description Is Final?
created The message is created No
queued The message is awayting processing No
processing The message is beeing processed No
spool The message is beeing stored and prepared for sending No
sending The email is beeing sent No
finished The message finishes sending No
send_failed The message failed to be sent Yes
broken The API could not connect to the SMTP Server Yes
delivered The message was delivered Yes
rejected The message was rejected based on its content (rejected recipient) Yes
bounce_hard The message could not reach the recipient. Though not "permanent", retries should not be attempted. Yes
bounce_soft The message could not be delivered to the recipient, but may be attempted later. Yes

Attachments

Emails can have file attachments, whether inline with the email text, or as an attachment. The maximum size for an attachment is 5Mb.

Attachments are a special feature, available to those who request it. If you wish to send attachments,
please contact support using the help menu on your E-Goi Backoffice.

inline attachments should be
Emails can have file attachments, whether inline with the email text, or as an attachment. The maximum size for an attachment is 5Mb. Attachments are a special feature, available to those who request it. If you wish to send attachments, please contact support using the help menu on your E-Goi Backoffice

If you want to send an image as an inline attachment, you should include the attachment as followed by the documentation, with the disposition \inline. Then, simply add the following tag to your message:

<img src=\cid:{{index}}\/>

Please beware of escaping the quotation marks in the payload. The index is the position of the image in the array of attachments, so if the attachment to include is in position 0, then the tag should be:

<img src=\cid:0\/>

Files can be sent using the Mime Type x- namespace. However, they are considered experimental, and mostly are used to support older software.

Documents
File Type
Possible Mime Types
.pdf application/pdf
.doc
.docx
application/msword
.ppt
.pptx
application/powerpoint
application/mspowerpoint
.xls
.xlsx
application/excel
.txt text/plain
.html text/html
Images
File Type
Possible Mime Types
.jpeg
.jpg
image/jpeg
.png image/png
.gif image/gif
.svg image/svg+xml
.bmp application/bmp
.psd application/octet-stream
.ico image/x-icon
Audio
File Type
Possible Mime Types
.mp3 audio/mpeg
.wav audio/wav
.midi audio/midi
Video
File Type
Possible Mime Types
.mp4 video/mpeg
.avi video/avi
Compression
File Type
Possible Mime Types
.exe application/octet-stream
.jar application/java-archive
.tar application/x-tar
.zip application/x-zip-compressed
application/zip
.rar application/octet-stream
application/x-rar-compressed

Please note that some email inboxes block certain file extensions, mostly related to code files ( .vb, .js, .py), shell commands (.bat, .ps1, .ksh, .msh) or executable files (.exe, .jar, .apk). We do not advise any attempts to send files of these nature.

Registered Messages

Slingshot allows its users to send emails and Sms through its API, and to keep detailed logs from all steps of a message's lifecycle.
This feature is called Registered Message.

Our records detail dates and times, sender and recipient information, subject and content of the message and its attachments,
in addition to all other events related:
sent, delivery, failed reception, opening and clicks recorded - for emails.

To enable Registered Message in your account, please get in touch with our Customer Services team,
through the HELP separator in your e-goi interface, or simply call us.


Custom Data

If you supply custom data when sending (via API or SMTP),
every event returned via webhooks will contain the message related custom data.
The custom data in the webhook will be returned as it was supplied at the time of sending. An example follows.

For instance - if you send an Sms message (via API) using the arguments:

{ 
    "phone": "321-987654321", 
    "senderId": "2", 
    "message": "An Sms message (with full utf8 support 👍")", 
    "customData": "{\"meta-data\", \"my relevant metadata\"}" 
} 

You will receive events with the following data (example for the processed event):

[ 
    { 
        "data" : { 
            "recipientMobile" : "321-987654321", 
            "groupId" : 1, 
            "recipientId" : 4, 
            "senderMobile" : "321-987654321", 
            "messageId" : 1160, 
            "customData": "{\"meta-data\", \"my relevant metadata\"}" 
            "createDate" : 1453430810084 
        }, 
        "action" : "processed", 
        "actionDate" : 1453430810150 
    } 
] 

Get Email Message Log

Retrieve the message life cycle and all information of the that message using a message ID

Authorizations:
ApiKey
path Parameters
messageId
required
integer <int32>
Example: 1

Id of the message sent

Responses

Request samples

curl --location --max-time 30 --request GET 'slingshot.egoiapp.com/api/v2/email/log/<integer>' \
--header 'ApiKey: '

Response samples

Content type
application/json
[
  • {
    }
]

Resubscribe Email

Resubscribe a client's email

Authorizations:
ApiKey
Request Body schema: application/json
emailAddress
required
string

Email Address of the contact to resubscribe

Responses

Request samples

Content type
application/json
{
  • "emailAddress": "<insert_email_address>"
}

Response samples

Content type
application/json
[
  • "string"
]

Send a single email message

Send a single email message to a single recipient

Authorizations:
ApiKey
Request Body schema: application/json

default response

One of
domain
string

the Domain to de used in the sender email.

senderId
required
string

The code identification of the sender profile to be used.

senderName
string

The name to be associated with the Domain to form the email.

to
required
string

The email to send the message to.

cc
Array of strings

The Cc field in the email.

bcc
Array of strings

The Bcc field in the email.

subject
required
string

The subject of the message.

htmlBody
string

The html version of the body of the message.

textBody
string

The text version of the body of the message.

openTracking
boolean
Default: false

The option to track if the message is opened.

clickTracking
boolean
Default: false

The option to track if the message is clicked.

Array of DataAttachmentRequest (object) or UrlAttachmentRequest (object) (AttachmentRequest)

Attachment Data

mergeTags
Array of strings

A list of the merge tags to replace information gaps in the email. The format of each tag should be tagName:tagValue

customData
string

Extra Data related to the campaign to be re-sent via WebHook.

priority
string
Default: "non-urgent"
Enum: "urgent" "non-urgent"

The priority of the message.

registered
boolean
Default: false

option to register the message. Its an exclusive feature for senders that require it.

object (HeaderOptionsRequest)

The header options of the message.

group
string
Default: "default"

The group of the message.

scheduleTo
string

Schedule Date to send message

object (ReplyToArgs)

Name and Email Address of Reply to

snippet
string

HTML snippet for html message, replaces the first characters that when when message arrives in inbox

Responses

Request samples

Content type
application/json
Example
{
  • "domain": "e-goi.com",
  • "senderId": "1234",
  • "senderName": "Customer Support",
  • "to": "john-doe@email.com",
  • "cc": [
    ],
  • "bcc": [
    ],
  • "subject": "Welcome to the Club",
  • "htmlBody": "Hello %name%! <b>Welcome!</b> ",
  • "textBody": "Hello %name%! Welcome! ",
  • "openTracking": false,
  • "clickTracking": false,
  • "attachment": [
    ],
  • "mergeTags": [
    ],
  • "customData": "meta-data, my relevant metadata",
  • "priority": "urgent",
  • "registered": false,
  • "header": {
    },
  • "group": "welcome",
  • "scheduleTo": "yyyy-MM-dd HH:mm:ss",
  • "replyTo": {
    },
  • "snippet": "string"
}

Response samples

Content type
application/json
{
  • "messageId": "1234"
}

Send various email messages

Send various email messages to various recipient, up to 100

Authorizations:
ApiKey
Request Body schema: application/json

default response

Array
One of
domain
string

the Domain to de used in the sender email.

senderId
required
string

The code identification of the sender profile to be used.

senderName
string

The name to be associated with the Domain to form the email.

to
required
Array of strings non-empty

The To field in the email.

cc
Array of strings

The Cc field in the email.

bcc
Array of strings

The Bcc field in the email.

subject
required
string

The subject of the message.

htmlBody
string

The html version of the body of the message.

textBody
string

The text version of the body of the message.

openTracking
boolean
Default: false

The option to track if the message is opened.

clickTracking
boolean
Default: false

The option to track if the message is clicked.

mergeTags
Array of strings

A list of the merge tags to replace information gaps in the email. The format of each tag should be tagName:tagValue

customData
string

Extra Data related to the campaign to be re-sent via WebHook.

priority
string
Default: "non-urgent"
Enum: "urgent" "non-urgent"

The priority of the message.

registered
boolean
Default: false

option to register the message. Its an exclusive feature for senders that require it.

object (HeaderOptionsRequest)

The header options of the message.

group
string
Default: "default"

The group of the message.

scheduleTo
string

Schedule Date to send message

object (ReplyToArgs)

Name and Email Address of Reply to

snippet
string

HTML snippet for html message, replaces the first characters that when when message arrives in inbox

Responses

Request samples

Content type
application/json
[
  • {
    }
]

Response samples

Content type
application/json
"string"

Templates Email

Templates are pre-defined messages that are used to ease message building and maintain coherence between topics and groups.
They are shared between multiple endpoint definitions and services (such as Multi-Channel or Alert)

Despite some differences in structure between channels, they have the subject and body already set, along with some options.

Advanced Templates

The Slingshot API enables the user to , should he choose to, create and execute advanced templates.These templates use the template engine JTWIG , both in template structure and code language. When creating a template , either for email or sms channels, you can use templates (for email you can use full html templates with CSS in them, in sms , standard sms message templates). When sending either an email or an sms, you can pass a JSON data structure within the parameter advancedTemplatingData.

Notes

See the section How To in order to see how to use the Slingshot API advanced template feature.

This section of Slingshot API advanced templating will demonstrate on how to use advanced templates in both email and sms. The aspects and code snippets below will demonstrate mostly common features and basic usage of advanced template.

The topics we will approach here will be the following:

  • Basic Replacement
  • Logic integration (If/else)
  • Dynamic Replacement with Objects
  • Iteration through objects
Basic Replacement

When creating a template (either for email or sms), for example, should you choose to use html or text, The following example represents an example where we want to replace the name value:

 
        "html" : "This is {{name.value}}"  
    

OR

 
        "text" : "This is {{name.value}}"  
    

When creating a payload to send a campaign (either via sms or email) the advancedTemplatingData payload attribute should contain:

 
        "advancedTemplatingData": { 
            "name": "Slingshot API" 
        } 
    

The result should be:

 
        This is Slingshot API 
    
Logic integration (if/else)

When creating a template (either for email or sms), for example, should you choose to use html or text, The following example illustrates the usage of logic operators in advanced templates(if/else):

 
        "html" : "{% if flag == true %} True Value {% else %} False Value {% endif %}"  
    

OR

 
        "text" : "{% if flag == true %} True Value {% else %} False Value {% endif %}"   
    

When creating a payload to send a campaign (either via sms or email) the advancedTemplatingData payload attribute should contain:

 
        "advancedTemplatingData": { 
            "flag": false 
        } 
    

The result should be:

 
        False Value 
    
Dynamic Replacement with Objects

When creating a template (either for email or sms), for example, should you choose to use html or text, The following example uses a data structure in order to render it inside a template (if/else):

 
        "html" : "Item:{{item.text.value}} Description:{{item.description.value}} Price:{{item.price.value}}"  
    

OR

 
        "text" : "Item:{{item.text.value}} Description:{{item.description.value}} Price:{{item.price.value}}"   
    

When creating a payload to send a campaign (either via sms or email) the advancedTemplatingData payload attribute should contain:

 
       "advancedTemplatingData": { 
       "item": 
            { 
                "text": "Slingshot Cap", 
                "price": "4.95 euros", 
                "description" : "The new line of items from slingshot"  
            } 
    } 
    

The result should be:

 
        Item:Slingshot Cap 
        Description:The new line of items from slingshot 
        Price:4.95 euros 
    
Iteration through objects

When creating a template (either for email or sms), for example, should you choose to use html or text, The following example uses a data structure in order to render it inside a template (if/else):

 
        "html" : "{% for item in items %} Item:{{item.text.value}} Description:{{item.description.value}} Price:{{item.price.value}} {%endfor%}"   
    

OR

 
        "text": "{% for item in items %} Item:{{item.text.value}} Description:{{item.description.value}} Price:{{item.price.value}} {%endfor%}"   
    

When creating a payload to send a campaign (either via sms or email) the advancedTemplatingData payload attribute should contain:

 
       "advancedTemplatingData": { 
       "items": [ 
            { 
                "text": "Slingshot Cap", 
                "price": "4.95 euros", 
                "description" : "The new line of items from slingshot"  
            }, 
            { 
                "text": "Slingshot Shirt", 
                "price": "25.00 euros", 
                "description" : "The new line of items from slingshot"   
            }, 
            { 
                "text": "Slingshot Pin", 
                "price": "10.00 euros", 
                "description" : "The new line of items from slingshot"   
            } 
        ] 
    } 
    

The result should be:

 
        Item:Slingshot Cap
        Description:The new line of items from slingshot 
        Price:4.95 euros 
        Item:Slingshot Shirt 
        Description:The new line of items from slingshot 
        Price:25.00 euros 
        Item:Slingshot Pin 
        Description:The new line of items from slingshot 
        Price:10.00 euros 
    
Note

For more information regarding on how to use JTWIG templating language, please see this guide.

Code Snippets

Code Snippets enable the use to use other templates inside a template. This joins the functionality of the JTWIG advanced templating language with the versatility of Slingshots template creation , management and usage.

For example, if you want to create an Email template that will be the fusion of a template with customer data and another with product information, first we create the personal information template.

 
        { 
            "templateName" : "CodeSnippet - Personal", 
            "subject" : "CodeSnippets", 
            "htmlBody" :  "{{ firstname.value }} {{ lastname.value }} {{ age.value }}  {{ height.value }} {{ address.value }}" , 
            "openTracking": false, 
            "clickTracking": false, 
        } 
    

Next we create the product information template.

 
        { 
            "templateName" : "CodeSnippet - Product", 
            "subject" : "CodeSnippets", 
            "htmlBody" :  "{{ quantity.value }} {{ description.value }} {{ price.value }}", 
            "openTracking": false, 
            "clickTracking": false, 
        } 
    

Finally we create the macro template , with the position of both the previous templates plus additional information

 
        { 
            "templateName" : "CodeSnippet - All",  
            "subject" : "CodeSnippets", 
            "htmlBody" :  "{{ order.value }} {{ firstTemplate }} {{ secondTemplate }}", 
            "openTracking": false, 
            "clickTracking": false, 
        } 
    

After all templates have been created, when sending an email, the following attributes must be present in the payload in order to use code snippets.

 
 [{   
    "senderId": "sender id",
    "senderName": "sender name",
    "to": [
      "email here"
    ],
    "templateId" : "template id",   
     "advancedTemplatingData": {   
         "codeSnippets" : [{   
             "firstTemplate" : 	"Template_Identifier_CodeSnippet_Personal",   
             "firstname" : "SlingShot",   
             "lastname" : "User",   
             "age" : 30,   
             "height" : "1.77m2,   
             "address" : "E-goi Street"   
         },{   
             "secondTemplate" : "Template_Identifier_CodeSnippet_Product",   
             "quantity" : 3,   
             "description" : "E-goi Cap",   
             "price" : "4.15euros"   
         }   
         ],   
         order : 123456   
     }   
 }]   
    

The final result , the sent email will have the following:

 
123456 SlingShot User 30 1.77m E-goi Street 3 E-goi Cap 4.15euros 
    
Notes

The previous examples dont have HTML code in them, put you can use it in order to create powerful templates.

The attribute codeSnippets must be present in order to render code snippets.

When creating a codeSnippets, any word that contains either Template or template is reserved to be processed to get the templateId.

Get All Email Templates

Obtains all the Email templates

Authorizations:
ApiKey

Responses

Request samples

curl --location --max-time 30 --request GET 'slingshot.egoiapp.com/api/v2/email/templates' \
--header 'ApiKey: '

Response samples

Content type
application/json
[
  • {
    }
]

Create Single Email Template

Creates a new template record for Email

Authorizations:
ApiKey
Request Body schema: application/json
subject
required
string

The subject of the message.

textBody
string

The text version of the email body.

htmlBody
string

The html version of the email body.

openTracking
boolean
Default: false

Option to track if email message is opened.

clickTracking
boolean
Default: false

Option to track if email message is clicked.

templateName
required
string

The name to help set the template apart.

Responses

Request samples

Content type
application/json
{
  • "subject": "Hello World",
  • "textBody": "This is the text version of the email body.",
  • "htmlBody": "<b>This</b> is the <u>html</u> version of the <i>email</i> body.",
  • "openTracking": false,
  • "clickTracking": false,
  • "templateName": "Hello World"
}

Response samples

Content type
application/json
{
  • "templateId": "1234"
}

Get Single Email Template

Gets an Email Template

Authorizations:
ApiKey
path Parameters
id
required
string

Id of the Email Template. Cannot be empty.

Responses

Request samples

curl --location --max-time 30 --request GET 'slingshot.egoiapp.com/api/v2/email/templates/<string>' \
--header 'ApiKey: '

Response samples

Content type
application/json
{
  • "id": "1234",
  • "subject": "Hello World",
  • "textBody": "This is the text version of the email body.",
  • "htmlBody": "<b>This</b> is the <u>html</u> version of the <i>email</i> body.",
  • "openTracking": false,
  • "clickTracking": false,
  • "templateName": "Hello World",
  • "thumbnail": "https://image.co"
}

Remove Single Email Template

Removes a single xEmail Template

Authorizations:
ApiKey
path Parameters
id
required
string

Id of the Email Template. Cannot be empty.

Responses

Request samples

curl --location --max-time 30 --request DELETE 'slingshot.egoiapp.com/api/v2/email/templates/<string>' \
--header 'ApiKey: '

Response samples

Content type
application/json
{}

Update Single Email Template

Updates an Email template, given a template id

Authorizations:
ApiKey
path Parameters
id
required
string

Id of the Email Template. Cannot be empty.

Request Body schema: */*
subject
required
string

The subject of the message.

textBody
string

The text version of the email body.

htmlBody
string

The html version of the email body.

openTracking
boolean
Default: false

Option to track if email message is opened.

clickTracking
boolean
Default: false

Option to track if email message is clicked.

templateName
required
string

The name to help set the template apart.

Responses

Request samples

curl --location --max-time 30 --request PATCH 'slingshot.egoiapp.com/api/v2/email/templates/<string>' \
--header 'ApiKey: ' \
--header 'Content-Type: */*' \
--data-raw '{"subject":"<string>","templateName":"<string>","textBody":"<string>","htmlBody":"<string>","openTracking":false,"clickTracking":false}'

Domains

Set up and Manage Domains

Validate Single Domain

Clears the validation cache and validates the supplied configured Domain.

Authorizations:
ApiKey
path Parameters
id
required
string
Example: 1234

The id of the Domain

Responses

Request samples

curl --location --max-time 30 --request GET 'slingshot.egoiapp.com/api/v2/domain/<string>/validate' \
--header 'ApiKey: '

Response samples

Content type
application/json
{
  • "isValid": true
}

Get All Domains

Retrieve the list of all Domains available for the sender to the recipients.

Authorizations:
ApiKey

Responses

Request samples

curl --location --max-time 30 --request GET 'slingshot.egoiapp.com/api/v2/domain' \
--header 'ApiKey: '

Response samples

Content type
application/json
[]

Create New Domain

Add a new Domain to the list of available Domains for the sender to the recipient.

Authorizations:
ApiKey
Request Body schema: application/json
default
boolean
Default: false

Option to set the domain as default.

domain
required
string

The Domain to add.

fallbackUrl
string

The url to associate the domain.

Responses

Request samples

Content type
application/json
{}

Response samples

Content type
application/json
{}

Get Single Domain

Retrieve the Domain with the id in the path.

Authorizations:
ApiKey
path Parameters
id
required
string
Example: 1234

The id of the Verify Request

Responses

Request samples

curl --location --max-time 30 --request GET 'slingshot.egoiapp.com/api/v2/domain/<string>' \
--header 'ApiKey: '

Response samples

Content type
application/json
{}

Get Default Domain

Retrieve the currently configured default Domain. If no default domain is set, the list will be empty.

Authorizations:
ApiKey

Responses

Request samples

curl --location --max-time 30 --request GET 'slingshot.egoiapp.com/api/v2/domain/default' \
--header 'ApiKey: '

Response samples

Content type
application/json
{}

Change Default Domain

Change the currently configured default Domain

Authorizations:
ApiKey
Request Body schema: application/json
domainId
string

The Domain id to default.

Responses

Request samples

Content type
application/json
{
  • "domainId": "1234"
}

Response samples

Content type
application/json
{}

Reports Email

Get Email Report

Retrieve Mail Reports and Statistics. Entries can be customizable

Authorizations:
ApiKey
query Parameters
group
string
Example: group=12

The name of the group to search

groupBy
string
Example: groupBy=month

The option to group the results. Can be either day or month. Defaults to day if none are present

dateStart
string
Example: dateStart=2019-07-27

The date to start the report. Date must be in format yyyy-MM-dd

dateEnd
string
Example: dateEnd=2019-07-28

The date to end the report. Date should be in format yyyy-MM-dd

Responses

Request samples

curl --location --max-time 30 --request GET 'slingshot.egoiapp.com/api/v2/email/reports?group=<string>&groupBy=<string>&dateStart=<string>&dateEnd=<string>' \
--header 'ApiKey: '

Response samples

Content type
application/json
[
  • {
    }
]

Senders Email

Get All Email Senders

Retrieve the list of available Email senders

Authorizations:
ApiKey

Responses

Request samples

curl --location --max-time 30 --request GET 'slingshot.egoiapp.com/api/v2/email/senders' \
--header 'ApiKey: '

Response samples

Content type
application/json
[
  • {
    }
]

Messages (Email)

Get Single Email Message

Retrieve the message with the id from path

Authorizations:
ApiKey
path Parameters
id
required
integer <int32>

The id of the message.

Responses

Request samples

curl --location --max-time 30 --request GET 'slingshot.egoiapp.com/api/v2/email/messages/<integer>' \
--header 'ApiKey: '

Response samples

Content type
application/json
{
  • "id": 0,
  • "groupId": 0,
  • "subject": "string",
  • "textBody": "string",
  • "htmlBody": "string",
  • "templateId": "string",
  • "senderId": 0,
  • "createDate": "2019-08-24T14:15:22Z",
  • "bcc": [
    ],
  • "cc": [
    ],
  • "status": "string",
  • "unsubscribe": true,
  • "subscriberId": 0,
  • "clickTracking": true,
  • "openTracking": true,
  • "domainId": 0,
  • "domain": "string",
  • "replyToId": 0,
  • "name": "string",
  • "register": true
}

Get All Email Messages

Retrieve the list of all sms messages. Results can be filtered by messages ids, group or channel. The result will be a combination of all parameters present

Authorizations:
ApiKey
query Parameters
group
string
Example: group=12

The name of the group to search

dateStart
string
Example: dateStart=2019-07-27

The date to start the report. Date must be in format yyyy-MM-dd

dateEnd
string
Example: dateEnd=2019-07-28

The date to end the report. Date should be in format yyyy-MM-dd

destination
string
Example: destination=johnDoe@email.com

The mobile number of a recipient.

status
string
Enum: "created" "queued" "processing" "spool" "sending" "finished" "send_failed" "broken" "delivered" "rejected" "bounce_hard" "bounce_soft" "event_view" "event_click" "scheduled" "canceled"

The status to check the message.

Responses

Request samples

curl --location --max-time 30 --request GET 'slingshot.egoiapp.com/api/v2/email/messages?group=<string>&dateStart=<string>&dateEnd=<string>&destination=<string>&status=<string>' \
--header 'ApiKey: '

Response samples

Content type
application/json
[
  • {
    }
]

Sms

Sms messages are short (on average 160 char) messages that are sent via GSM.

Parameter Description Examples
Contacts All contact information. Includes main recipientas well as other interested recipients. To, From
Content The content of the message. Includes text (plain text or HTML) and attachments. Body, Template
Options The configuration of the email to the sender. Tracking, Registered, Group/Tag
Status The information about the message after it has been sent. Status

The following is a diagram of all the states an Sms can be in.

states

Status Description Is Final?
created The message was created No
queued The message has been queued for processing No
processing The message is beeing processed No
spool The message is awayting sending No
finished The message is being sent to the phone operator No
sending The message is being sent by the phone operator No
send_failed The phone operator ran into an error, and the message could not be delivered Yes
delivered The message has been successfuly delivered to the recipient Yes
rejected The message had incongruencies and will not be sent (eg. invalid recipient) Yes

Restrictions

Depending on the country a phone number belongs to, there may be some restrictions regarding message properties.

The list only presents known restrictions. This means that everything else should be allowed. If you find any new restriction please contact us, so that we can change and update the list :)

Portugal

Portuguese carriers do not allow Shortcode Sender IDs (19200). Instead, try to use either international numeric senders (351987654321) or alphanumeric senders ('E-goi Support').

Russian senders are filtered by portuguese network providers, so it's advised to avoid using them.

Some alphanumeric sender ID's are blocked in Portugal, including variations in spelling. The list of Sender ID's are as follows:

  • Vodafone
  • Meo
  • Optimus
  • Zon
  • PTelecom
  • Pt
  • Tmn
  • CavacoSilva
  • Vodafone
  • PJ
  • MPublico
  • PSP

Brazil

Brazilian Carriers are not always guarantee to support international messages. Unicode and Binary messages are not supported. Successful delivery of concatenated messages is not guaranteed, and is not supported by Oi Network Provider,

Sender ID of a message is changed to 28908 or a local number to facilitate successful delivery of messages.

SMS containing content related to adult, alcohol, politics or religion are not allowed, and may be blocked.

Some landline numbers maybe converted to mobile numbers, with the information being updated once per month.

Spain

There are no known restrictions to Spain. However, messages with numeric Sender IDs may travel through an alternate route to their destination, potentially increasing the time to deliver.

Colombia

In order to successfully deliver a message, the Sender ID may be changed to a local number (Shortcode 85307 or 87457, or long number).

Colombian network operators do not provide delivery receipts, so we can't guarantee the message has been delivered.

India

Traffic type Content Allowed Sender ID Restrictions/Regulation
Domestic transactional Transactional traffic, OTP 6 digit alpha (not alphanumeric) with preregistration The registered Alpha Sender ID will be added with 2 letters as a prefix, depending on which carrier was used to deliver the SMS to the final operator or 2 random numbers; e.g. MD-XXXXXX (where XXXXXX is the registered Sender ID)
Domestic Promotional (none opted in) Promo/Marketing content Sender ID not supported and will be change to a random short code Promo sms will be blocked to numbers registered in ´National Do Not Call´ Registry as per TRAI regulation.
Promo sms are only delivered between 9am-9pm IST time.
SMS outside the time range will be queued and delivered next day.
International (transactional/Opted-in Promo) International originated transactional content & Opt-in Promo content. (If client registered in India,but sms originated outside India, will be identified as International traffic). Sender ID not supported and will be change to a random short/long virtual number For opted in promo sms, same Regulation apply as in for Domestic Promotional(Opted in) listed below.
International Promotional (none opted in) NA NA NA
Domestic Promotional (opted in) This traffic can only be routed via transactional bind with opted in confirmations from each subscriber MSISDN 6 digit alpha (not alphanumeric) with pre-registration Handling party (customer) of the promo content must have subscriber opted in consent per each MSISDN and should provide the information to the providers handling the traffic either upfront or on demand in an event if the termination party gets a complaint from a mobile operator (mobile subscriber complaining to operator for receiving a promo content) as proof the subscriber has given consent to receive promo content. Failing to do so (not defined the actual time period) provider will be liable for penalty charges depend on the number of violations. Need to have contractual provisions in order to accept the penalty charges in case of violation.

Any unregistered sender ID is overwritten with a local short code as required by Indian regulations, whether the destination number is registered on the NDNC list or not.

Messages towards Jammu and Kashmir networks will be blocked by the government due to political sensitivity.

SMS containing content related to politics during election periods are not allowed.


Registered Messages

Slingshot allows its users to send emails and Sms through its API, and to keep detailed logs from all steps of a message's lifecycle.
This feature is called Registered Message.

Our records detail dates and times, sender and recipient information, subject and content of the message and its attachments,
in addition to all other events related:
sent, delivery, failed reception, opening and clicks recorded - for emails.

To enable Registered Message in your account, please get in touch with our Customer Services team,
through the HELP separator in your e-goi interface, or simply call us.


Custom Data

If you supply custom data when sending (via API or SMTP),
every event returned via webhooks will contain the message related custom data.
The custom data in the webhook will be returned as it was supplied at the time of sending. An example follows.

For instance - if you send an Sms message (via API) using the arguments:

{ 
    "phone": "321-987654321", 
    "senderId": "2", 
    "message": "An Sms message (with full utf8 support 👍")", 
    "customData": "{\"meta-data\", \"my relevant metadata\"}" 
} 

You will receive events with the following data (example for the processed event):

[ 
    { 
        "data" : { 
            "recipientMobile" : "321-987654321", 
            "groupId" : 1, 
            "recipientId" : 4, 
            "senderMobile" : "321-987654321", 
            "messageId" : 1160, 
            "customData": "{\"meta-data\", \"my relevant metadata\"}" 
            "createDate" : 1453430810084 
        }, 
        "action" : "processed", 
        "actionDate" : 1453430810150 
    } 
] 

Get Sms Message Log

Retrieve the message life cycle and all information of the that message using a message ID

Authorizations:
ApiKey
path Parameters
messageId
required
integer <int32>
Example: 1

Id of the message sent

Responses

Request samples

curl --location --max-time 30 --request GET 'slingshot.egoiapp.com/api/v2/sms/log/<integer>' \
--header 'ApiKey: '

Response samples

Content type
application/json
[
  • {
    }
]

Resubscribe Mobile

Resubscribe a client's mobile number

Authorizations:
ApiKey
Request Body schema: application/json
mobileNumber
required
string

Mobile Number of the contact to resubscribe

Responses

Request samples

Content type
application/json
{
  • "mobileNumber": "<insert_mobile_number>"
}

Response samples

Content type
application/json
[
  • "string"
]

Send a Single Sms Message

Send a single sms message to a single recipient

Authorizations:
ApiKey
Request Body schema: application/json

default response

One of
to
required
string

The contact of the recipient. format should be countryCode-phoneNumber.

from
required
string

The id of the sender.

textBody
required
string

The content of the message.

encoding
required
string
Enum: "unicode" "gsm0338"

The encoding of the message. [About encodings]

maxCount
required
integer <int32> >= 1

the maximum amount of messages to be sent (if the textBody is too big for a single message).

mergeTags
Array of strings

A list of the merge tags to replace information gaps in the email. The format of each tag should be tagName:tagValue

priority
string
Default: "non-urgent"
Enum: "urgent" "non-urgent"

The priority of the message.

customData
string

Extra Data related to the campaign to be re-sent via WebHook.

registered
boolean
Default: false

option to register the message. Its an exclusive feature for senders that require it.

group
string
Default: "default"

The group of the message.

scheduleTo
string

Schedule Date to send message

Responses

Request samples

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

Response samples

Content type
application/json
{
  • "messageId": "1234"
}

Send Multiple Sms Messages

Send multiple sms messages to various recipients, up to 100 messages

Authorizations:
ApiKey
Request Body schema: application/json

default response

Array
One of
to
required
string

The contact of the recipient. format should be countryCode-phoneNumber.

from
required
string

The id of the sender.

textBody
required
string

The content of the message.

encoding
required
string
Enum: "unicode" "gsm0338"

The encoding of the message. [About encodings]

maxCount
required
integer <int32> >= 1

the maximum amount of messages to be sent (if the textBody is too big for a single message).

mergeTags
Array of strings

A list of the merge tags to replace information gaps in the email. The format of each tag should be tagName:tagValue

priority
string
Default: "non-urgent"
Enum: "urgent" "non-urgent"

The priority of the message.

customData
string

Extra Data related to the campaign to be re-sent via WebHook.

registered
boolean
Default: false

option to register the message. Its an exclusive feature for senders that require it.

group
string
Default: "default"

The group of the message.

scheduleTo
string

Schedule Date to send message

Responses

Request samples

Content type
application/json
[
  • {
    }
]

Response samples

Content type
application/json
"string"

Templates Sms

Templates are pre-defined messages that are used to ease message building and maintain coherence between topics and groups.
They are shared between multiple endpoint definitions and services (such as Multi-Channel or Alert)

Despite some differences in structure between channels, they have the subject and body already set, along with some options.

Advanced Templates

The Slingshot API enables the user to , should he choose to, create and execute advanced templates.These templates use the template engine JTWIG , both in template structure and code language. When creating a template , either for email or sms channels, you can use templates (for email you can use full html templates with CSS in them, in sms , standard sms message templates). When sending either an email or an sms, you can pass a JSON data structure within the parameter advancedTemplatingData.

Notes

See the section How To in order to see how to use the Slingshot API advanced template feature.

This section of Slingshot API advanced templating will demonstrate on how to use advanced templates in both email and sms. The aspects and code snippets below will demonstrate mostly common features and basic usage of advanced template.

The topics we will approach here will be the following:

  • Basic Replacement
  • Logic integration (If/else)
  • Dynamic Replacement with Objects
  • Iteration through objects
Basic Replacement

When creating a template (either for email or sms), for example, should you choose to use html or text, The following example represents an example where we want to replace the name value:

 
        "html" : "This is {{name.value}}"  
    

OR

 
        "text" : "This is {{name.value}}"  
    

When creating a payload to send a campaign (either via sms or email) the advancedTemplatingData payload attribute should contain:

 
        "advancedTemplatingData": { 
            "name": "Slingshot API" 
        } 
    

The result should be:

 
        This is Slingshot API 
    
Logic integration (if/else)

When creating a template (either for email or sms), for example, should you choose to use html or text, The following example illustrates the usage of logic operators in advanced templates(if/else):

 
        "html" : "{% if flag == true %} True Value {% else %} False Value {% endif %}"  
    

OR

 
        "text" : "{% if flag == true %} True Value {% else %} False Value {% endif %}"   
    

When creating a payload to send a campaign (either via sms or email) the advancedTemplatingData payload attribute should contain:

 
        "advancedTemplatingData": { 
            "flag": false 
        } 
    

The result should be:

 
        False Value 
    
Dynamic Replacement with Objects

When creating a template (either for email or sms), for example, should you choose to use html or text, The following example uses a data structure in order to render it inside a template (if/else):

 
        "html" : "Item:{{item.text.value}} Description:{{item.description.value}} Price:{{item.price.value}}"  
    

OR

 
        "text" : "Item:{{item.text.value}} Description:{{item.description.value}} Price:{{item.price.value}}"   
    

When creating a payload to send a campaign (either via sms or email) the advancedTemplatingData payload attribute should contain:

 
       "advancedTemplatingData": { 
       "item": 
            { 
                "text": "Slingshot Cap", 
                "price": "4.95 euros", 
                "description" : "The new line of items from slingshot"  
            } 
    } 
    

The result should be:

 
        Item:Slingshot Cap 
        Description:The new line of items from slingshot 
        Price:4.95 euros 
    
Iteration through objects

When creating a template (either for email or sms), for example, should you choose to use html or text, The following example uses a data structure in order to render it inside a template (if/else):

 
        "html" : "{% for item in items %} Item:{{item.text.value}} Description:{{item.description.value}} Price:{{item.price.value}} {%endfor%}"   
    

OR

 
        "text": "{% for item in items %} Item:{{item.text.value}} Description:{{item.description.value}} Price:{{item.price.value}} {%endfor%}"   
    

When creating a payload to send a campaign (either via sms or email) the advancedTemplatingData payload attribute should contain:

 
       "advancedTemplatingData": { 
       "items": [ 
            { 
                "text": "Slingshot Cap", 
                "price": "4.95 euros", 
                "description" : "The new line of items from slingshot"  
            }, 
            { 
                "text": "Slingshot Shirt", 
                "price": "25.00 euros", 
                "description" : "The new line of items from slingshot"   
            }, 
            { 
                "text": "Slingshot Pin", 
                "price": "10.00 euros", 
                "description" : "The new line of items from slingshot"   
            } 
        ] 
    } 
    

The result should be:

 
        Item:Slingshot Cap
        Description:The new line of items from slingshot 
        Price:4.95 euros 
        Item:Slingshot Shirt 
        Description:The new line of items from slingshot 
        Price:25.00 euros 
        Item:Slingshot Pin 
        Description:The new line of items from slingshot 
        Price:10.00 euros 
    
Note

For more information regarding on how to use JTWIG templating language, please see this guide.

Code Snippets

Code Snippets enable the use to use other templates inside a template. This joins the functionality of the JTWIG advanced templating language with the versatility of Slingshots template creation , management and usage.

For example, if you want to create an Email template that will be the fusion of a template with customer data and another with product information, first we create the personal information template.

 
        { 
            "templateName" : "CodeSnippet - Personal", 
            "subject" : "CodeSnippets", 
            "htmlBody" :  "{{ firstname.value }} {{ lastname.value }} {{ age.value }}  {{ height.value }} {{ address.value }}" , 
            "openTracking": false, 
            "clickTracking": false, 
        } 
    

Next we create the product information template.

 
        { 
            "templateName" : "CodeSnippet - Product", 
            "subject" : "CodeSnippets", 
            "htmlBody" :  "{{ quantity.value }} {{ description.value }} {{ price.value }}", 
            "openTracking": false, 
            "clickTracking": false, 
        } 
    

Finally we create the macro template , with the position of both the previous templates plus additional information

 
        { 
            "templateName" : "CodeSnippet - All",  
            "subject" : "CodeSnippets", 
            "htmlBody" :  "{{ order.value }} {{ firstTemplate }} {{ secondTemplate }}", 
            "openTracking": false, 
            "clickTracking": false, 
        } 
    

After all templates have been created, when sending an email, the following attributes must be present in the payload in order to use code snippets.

 
 [{   
    "senderId": "sender id",
    "senderName": "sender name",
    "to": [
      "email here"
    ],
    "templateId" : "template id",   
     "advancedTemplatingData": {   
         "codeSnippets" : [{   
             "firstTemplate" : 	"Template_Identifier_CodeSnippet_Personal",   
             "firstname" : "SlingShot",   
             "lastname" : "User",   
             "age" : 30,   
             "height" : "1.77m2,   
             "address" : "E-goi Street"   
         },{   
             "secondTemplate" : "Template_Identifier_CodeSnippet_Product",   
             "quantity" : 3,   
             "description" : "E-goi Cap",   
             "price" : "4.15euros"   
         }   
         ],   
         order : 123456   
     }   
 }]   
    

The final result , the sent email will have the following:

 
123456 SlingShot User 30 1.77m E-goi Street 3 E-goi Cap 4.15euros 
    
Notes

The previous examples dont have HTML code in them, put you can use it in order to create powerful templates.

The attribute codeSnippets must be present in order to render code snippets.

When creating a codeSnippets, any word that contains either Template or template is reserved to be processed to get the templateId.

Get Single Sms Template

Gets an Sms Template

Authorizations:
ApiKey
path Parameters
id
required
string

Id of the Sms Template. Cannot be empty.

Responses

Request samples

curl --location --max-time 30 --request GET 'slingshot.egoiapp.com/api/v2/sms/templates/<string>' \
--header 'ApiKey: '

Response samples

Content type
application/json;charset=UTF-8
{
  • "id": 1234,
  • "textBody": "Hello World",
  • "encoding": "unicode",
  • "maxCount": 1,
  • "templateName": "Hello World",
  • "thumbnail": "https://image.co"
}

Remove Single Sms Template

Remove Sms Template

Authorizations:
ApiKey
path Parameters
id
required
string

Id of the Sms Template. Cannot be empty.

Responses

Request samples

curl --location --max-time 30 --request DELETE 'slingshot.egoiapp.com/api/v2/sms/templates/<string>' \
--header 'ApiKey: '

Response samples

Content type
application/json;charset=UTF-8
{}

Update Single Sms Template

Updates an Sms template, given a template id

Authorizations:
ApiKey
path Parameters
id
required
string

Id of the Sms Template. Cannot be empty.

Request Body schema: */*
textBody
required
string

The text body of the message.

encoding
required
string
Default: "unicode"
Enum: "unicode" "gsm0338"

The encoding of the message. [About encodings]

maxCount
required
integer <int32> >= 1

The maximum amount of messages to be sent (if the textBody is too big for a single message).

templateName
required
string

The name of the template.

Responses

Request samples

curl --location --max-time 30 --request PATCH 'slingshot.egoiapp.com/api/v2/sms/templates/<string>' \
--header 'ApiKey: ' \
--header 'Content-Type: */*' \
--data-raw '{"encoding":"unicode","maxCount":"<integer>","templateName":"<string>","textBody":"<string>"}'

Get All Sms Templates

Obtains all the Sms templates

Authorizations:
ApiKey

Responses

Request samples

curl --location --max-time 30 --request GET 'slingshot.egoiapp.com/api/v2/sms/templates' \
--header 'ApiKey: '

Response samples

Content type
application/json;charset=UTF-8
[
  • {
    }
]

Create Single Sms Template

Creates a new template record for Sms

Authorizations:
ApiKey
Request Body schema: application/json;charset=UTF-8
textBody
required
string

The text body of the message.

encoding
required
string
Default: "unicode"
Enum: "unicode" "gsm0338"

The encoding of the message. [About encodings]

maxCount
required
integer <int32> >= 1

The maximum amount of messages to be sent (if the textBody is too big for a single message).

templateName
required
string

The name of the template.

Responses

Request samples

Content type
application/json;charset=UTF-8
{
  • "textBody": "Hello World",
  • "encoding": "unicode",
  • "maxCount": 1,
  • "templateName": "Hello World"
}

Response samples

Content type
application/json;charset=UTF-8
{
  • "templateId": "1234"
}

Reports Sms

Get Sms Report

Retrieve Sms Reports and Statistics. Entries can be customizable

Authorizations:
ApiKey
query Parameters
group
string
Example: group=12

The id of the group to search

groupBy
string
Example: groupBy=month

The option to group the results. Can be either day or month. Defaults to day if none are present

dateStart
string
Example: dateStart=2019-07-27

The date to start the report. Date must be in format yyyy-MM-dd

dateEnd
string
Example: dateEnd=2019-07-28

The date to end the report. Date should be in format yyyy-MM-dd

Responses

Request samples

curl --location --max-time 30 --request GET 'slingshot.egoiapp.com/api/v2/sms/reports?group=<string>&groupBy=<string>&dateStart=<string>&dateEnd=<string>' \
--header 'ApiKey: '

Response samples

Content type
application/json
[
  • {
    }
]

Senders Sms

Get All Sms Senders

Return all Sms Senders defined by the user

Authorizations:
ApiKey

Responses

Request samples

curl --location --max-time 30 --request GET 'slingshot.egoiapp.com/api/v2/sms/senders' \
--header 'ApiKey: '

Response samples

Content type
application/json
[
  • {
    }
]

Messages (Sms)

Get Single Sms Messages

Retrieve the message with the id from path

Authorizations:
ApiKey
path Parameters
id
required
integer <int32>

The id of the message.

Responses

Request samples

curl --location --max-time 30 --request GET 'slingshot.egoiapp.com/api/v2/sms/messages/<integer>' \
--header 'ApiKey: '

Response samples

Content type
application/json
{
  • "id": 0,
  • "groupId": 0,
  • "senderId": 0,
  • "subscriberId": 0,
  • "textBody": "string",
  • "templateId": "string",
  • "createDate": "2019-08-24T14:15:22Z",
  • "status": "string",
  • "register": true
}

Get All Sms Messages

Retrieve the list of all sms messages. Results can be filtered by messages ids, group or channel. The result will be a combination of all parameters present

Authorizations:
ApiKey
query Parameters
group
string
Example: group=12

The name of the group to search

dateStart
string
Example: dateStart=2019-07-27

The date to start the report. Date must be in format yyyy-MM-dd

dateEnd
string
Example: dateEnd=2019-07-28

The date to end the report. Date should be in format yyyy-MM-dd

destination
string
Example: destination=351-999999999

The mobile number of a recipient.

status
string
Enum: "created" "queued" "processing" "spool" "sending" "finished" "send_failed" "broken" "delivered" "rejected" "scheduled" "canceled"

The status to check the message.

Responses

Request samples

curl --location --max-time 30 --request GET 'slingshot.egoiapp.com/api/v2/sms/messages?group=<string>&dateStart=<string>&dateEnd=<string>&destination=<string>&status=<string>' \
--header 'ApiKey: '

Response samples

Content type
application/json
[
  • {
    }
]

Push

The push channel enables you to send messages to your mobile apps , that include the ability to receive push notifications.

The flow on how to use the push channel messaging capabilities is pretty simple. First , you create an app in our database and then , you are ready to send messages to that app, and to a specific user of that same app.

Template usage and scheduling is also available to this channel.This means that you can have pre-configured templates of messages to send to all your clients, as well as timed push messages for your needs, raging from timed campaigns or flash promotions.

Get Single App

Retrieve a Mobile Push App

Authorizations:
ApiKey
path Parameters
id
required
string

Id of the App. Cannot be empty.

Responses

Request samples

curl --location --max-time 30 --request GET 'slingshot.egoiapp.com/api/v2/apps/<string>' \
--header 'ApiKey: '

Response samples

Content type
application/json
{
  • "mobileAppId": "1234"
}

Remove Single Mobile App

Remove App

Authorizations:
ApiKey
path Parameters
id
required
string

Id of the app. Cannot be empty.

Responses

Request samples

curl --location --max-time 30 --request DELETE 'slingshot.egoiapp.com/api/v2/apps/<string>' \
--header 'ApiKey: '

Response samples

Content type
application/json
{}

Update Single App

Updates an App, given a Mobile App Id

Authorizations:
ApiKey
path Parameters
id
required
string

Id of the Mobile App. Cannot be empty.

Request Body schema: */*
name
required
string

The name of the App

sandbox
required
boolean

Option to send the notification in a Sandbox Environment in iOS devices.

certificate
string

The certificate of the app

password
string

The password of the certificate.

authKey
string

The authentication key to send push messages to android.

Responses

Request samples

curl --location --max-time 30 --request PATCH 'slingshot.egoiapp.com/api/v2/apps/<string>' \
--header 'ApiKey: ' \
--header 'Content-Type: */*' \
--data-raw '{"name":"<string>","sandbox":"<boolean>","certificate":"<string>","password":"<string>","authKey":"<string>"}'

Get All Apps

Obtains all the Apps

Authorizations:
ApiKey

Responses

Request samples

curl --location --max-time 30 --request GET 'slingshot.egoiapp.com/api/v2/apps' \
--header 'ApiKey: '

Response samples

Content type
application/json
[]

Create Single App

Creates a new App

Authorizations:
ApiKey
Request Body schema: application/json
name
required
string

The name of the App

sandbox
required
boolean

Option to send the notification in a Sandbox Environment in iOS devices.

certificate
string

The certificate of the app

password
string

The password of the certificate.

authKey
string

The authentication key to send push messages to android.

Responses

Request samples

Content type
application/json
{}

Response samples

Content type
application/json
{
  • "templateId": "1234"
}

Send Single Push Message

Send a single push message to a recipient

Authorizations:
ApiKey
Request Body schema: application/json

default response

Array
One of
to
required
string

The contact of the recipient. format should be countryCode-phoneNumber.

subject
required
string

The subject of the message.

textBody
required
string

The body of the message.

appId
required
integer <int32>

The id of the application. Should be previously configured in the system.

custom
string

Any custom information to associate the message with.

scheduleTo
string

Schedule Date to send message

Responses

Request samples

Content type
application/json
[
  • {
    }
]

Response samples

Content type
application/json
[
  • {
    }
]

Templates Push

Templates are pre-defined messages that are used to ease message building and maintain coherence between topics and groups.
They are shared between multiple endpoint definitions and services (such as Multi-Channel or Alert)

Despite some differences in structure between channels, they have the subject and body already set, along with some options.

Advanced Templates

The Slingshot API enables the user to , should he choose to, create and execute advanced templates.These templates use the template engine JTWIG , both in template structure and code language. When creating a template , either for email or sms channels, you can use templates (for email you can use full html templates with CSS in them, in sms , standard sms message templates). When sending either an email or an sms, you can pass a JSON data structure within the parameter advancedTemplatingData.

Notes

See the section How To in order to see how to use the Slingshot API advanced template feature.

This section of Slingshot API advanced templating will demonstrate on how to use advanced templates in both email and sms. The aspects and code snippets below will demonstrate mostly common features and basic usage of advanced template.

The topics we will approach here will be the following:

  • Basic Replacement
  • Logic integration (If/else)
  • Dynamic Replacement with Objects
  • Iteration through objects
Basic Replacement

When creating a template (either for email or sms), for example, should you choose to use html or text, The following example represents an example where we want to replace the name value:

 
        "html" : "This is {{name.value}}"  
    

OR

 
        "text" : "This is {{name.value}}"  
    

When creating a payload to send a campaign (either via sms or email) the advancedTemplatingData payload attribute should contain:

 
        "advancedTemplatingData": { 
            "name": "Slingshot API" 
        } 
    

The result should be:

 
        This is Slingshot API 
    
Logic integration (if/else)

When creating a template (either for email or sms), for example, should you choose to use html or text, The following example illustrates the usage of logic operators in advanced templates(if/else):

 
        "html" : "{% if flag == true %} True Value {% else %} False Value {% endif %}"  
    

OR

 
        "text" : "{% if flag == true %} True Value {% else %} False Value {% endif %}"   
    

When creating a payload to send a campaign (either via sms or email) the advancedTemplatingData payload attribute should contain:

 
        "advancedTemplatingData": { 
            "flag": false 
        } 
    

The result should be:

 
        False Value 
    
Dynamic Replacement with Objects

When creating a template (either for email or sms), for example, should you choose to use html or text, The following example uses a data structure in order to render it inside a template (if/else):

 
        "html" : "Item:{{item.text.value}} Description:{{item.description.value}} Price:{{item.price.value}}"  
    

OR

 
        "text" : "Item:{{item.text.value}} Description:{{item.description.value}} Price:{{item.price.value}}"   
    

When creating a payload to send a campaign (either via sms or email) the advancedTemplatingData payload attribute should contain:

 
       "advancedTemplatingData": { 
       "item": 
            { 
                "text": "Slingshot Cap", 
                "price": "4.95 euros", 
                "description" : "The new line of items from slingshot"  
            } 
    } 
    

The result should be:

 
        Item:Slingshot Cap 
        Description:The new line of items from slingshot 
        Price:4.95 euros 
    
Iteration through objects

When creating a template (either for email or sms), for example, should you choose to use html or text, The following example uses a data structure in order to render it inside a template (if/else):

 
        "html" : "{% for item in items %} Item:{{item.text.value}} Description:{{item.description.value}} Price:{{item.price.value}} {%endfor%}"   
    

OR

 
        "text": "{% for item in items %} Item:{{item.text.value}} Description:{{item.description.value}} Price:{{item.price.value}} {%endfor%}"   
    

When creating a payload to send a campaign (either via sms or email) the advancedTemplatingData payload attribute should contain:

 
       "advancedTemplatingData": { 
       "items": [ 
            { 
                "text": "Slingshot Cap", 
                "price": "4.95 euros", 
                "description" : "The new line of items from slingshot"  
            }, 
            { 
                "text": "Slingshot Shirt", 
                "price": "25.00 euros", 
                "description" : "The new line of items from slingshot"   
            }, 
            { 
                "text": "Slingshot Pin", 
                "price": "10.00 euros", 
                "description" : "The new line of items from slingshot"   
            } 
        ] 
    } 
    

The result should be:

 
        Item:Slingshot Cap
        Description:The new line of items from slingshot 
        Price:4.95 euros 
        Item:Slingshot Shirt 
        Description:The new line of items from slingshot 
        Price:25.00 euros 
        Item:Slingshot Pin 
        Description:The new line of items from slingshot 
        Price:10.00 euros 
    
Note

For more information regarding on how to use JTWIG templating language, please see this guide.

Code Snippets

Code Snippets enable the use to use other templates inside a template. This joins the functionality of the JTWIG advanced templating language with the versatility of Slingshots template creation , management and usage.

For example, if you want to create an Email template that will be the fusion of a template with customer data and another with product information, first we create the personal information template.

 
        { 
            "templateName" : "CodeSnippet - Personal", 
            "subject" : "CodeSnippets", 
            "htmlBody" :  "{{ firstname.value }} {{ lastname.value }} {{ age.value }}  {{ height.value }} {{ address.value }}" , 
            "openTracking": false, 
            "clickTracking": false, 
        } 
    

Next we create the product information template.

 
        { 
            "templateName" : "CodeSnippet - Product", 
            "subject" : "CodeSnippets", 
            "htmlBody" :  "{{ quantity.value }} {{ description.value }} {{ price.value }}", 
            "openTracking": false, 
            "clickTracking": false, 
        } 
    

Finally we create the macro template , with the position of both the previous templates plus additional information

 
        { 
            "templateName" : "CodeSnippet - All",  
            "subject" : "CodeSnippets", 
            "htmlBody" :  "{{ order.value }} {{ firstTemplate }} {{ secondTemplate }}", 
            "openTracking": false, 
            "clickTracking": false, 
        } 
    

After all templates have been created, when sending an email, the following attributes must be present in the payload in order to use code snippets.

 
 [{   
    "senderId": "sender id",
    "senderName": "sender name",
    "to": [
      "email here"
    ],
    "templateId" : "template id",   
     "advancedTemplatingData": {   
         "codeSnippets" : [{   
             "firstTemplate" : 	"Template_Identifier_CodeSnippet_Personal",   
             "firstname" : "SlingShot",   
             "lastname" : "User",   
             "age" : 30,   
             "height" : "1.77m2,   
             "address" : "E-goi Street"   
         },{   
             "secondTemplate" : "Template_Identifier_CodeSnippet_Product",   
             "quantity" : 3,   
             "description" : "E-goi Cap",   
             "price" : "4.15euros"   
         }   
         ],   
         order : 123456   
     }   
 }]   
    

The final result , the sent email will have the following:

 
123456 SlingShot User 30 1.77m E-goi Street 3 E-goi Cap 4.15euros 
    
Notes

The previous examples dont have HTML code in them, put you can use it in order to create powerful templates.

The attribute codeSnippets must be present in order to render code snippets.

When creating a codeSnippets, any word that contains either Template or template is reserved to be processed to get the templateId.

Get All Push Templates

Obtains all the Push templates

Authorizations:
ApiKey

Responses

Request samples

curl --location --max-time 30 --request GET 'slingshot.egoiapp.com/api/v2/push/templates' \
--header 'ApiKey: '

Response samples

Content type
application/json
[
  • {
    }
]

Create Single Push Template

Creates a new template record for Push

Authorizations:
ApiKey
Request Body schema: application/json
subject
required
string

The title of the message.

textBody
required
string

The text body of the message.

appId
required
string

The id of the app to associate the template.

customData
string
Default: "1"

The text body of the message.

templateName
required
string

The name of the template.

Responses

Request samples

Content type
application/json
{
  • "subject": "Hello World",
  • "textBody": "This is a message of Hello to the World",
  • "appId": "1234",
  • "customData": "1",
  • "templateName": "Hello World"
}

Response samples

Content type
application/json
{
  • "templateId": "1234"
}

Get Single Push Template

Gets a Push Template

Authorizations:
ApiKey
path Parameters
id
required
string

Id of the Push Template. Cannot be empty.

Responses

Request samples

curl --location --max-time 30 --request GET 'slingshot.egoiapp.com/api/v2/push/templates/<string>' \
--header 'ApiKey: '

Response samples

Content type
application/json
{
  • "id": "Hello World",
  • "subject": "Hello World",
  • "textBody": "This is a message of Hello to the World",
  • "appId": "1234",
  • "customData": "1",
  • "templateName": "Hello World"
}

Remove Single Push Template

Removes a Push template, given a template id

Authorizations:
ApiKey
path Parameters
id
required
string

Id of the Push Template. Cannot be empty.

Responses

Request samples

curl --location --max-time 30 --request DELETE 'slingshot.egoiapp.com/api/v2/push/templates/<string>' \
--header 'ApiKey: '

Response samples

Content type
application/json
{}

Update Single Push Template

Updates an Push template, given a template id

Authorizations:
ApiKey
path Parameters
id
required
string

Id of the Push Template. Cannot be empty.

Request Body schema: */*
subject
required
string

The title of the message.

textBody
required
string

The text body of the message.

appId
required
string

The id of the app to associate the template.

customData
string
Default: "1"

The text body of the message.

templateName
required
string

The name of the template.

Responses

Request samples

curl --location --max-time 30 --request PATCH 'slingshot.egoiapp.com/api/v2/push/templates/<string>' \
--header 'ApiKey: ' \
--header 'Content-Type: */*' \
--data-raw '{"appId":"<string>","subject":"<string>","templateName":"<string>","textBody":"<string>","customData":"1"}'

Reports Push

Get Push Report

Retrieve Push Reports and Statistics. Entries can be customizable

Authorizations:
ApiKey
query Parameters
group
string
Example: group=12

The name of the group to search

groupBy
string
Example: groupBy=month

The option to group the results. Can be either day or month. Defaults to day if none are present

dateStart
string
Example: dateStart=2019-07-27

The date to start the report. Date must be in format yyyy-MM-dd

dateEnd
string
Example: dateEnd=2019-07-28

The date to end the report. Date should be in format yyyy-MM-dd

destination
string
Example: destination=johnDoe@email.com

The mobile number of a recipient.

Responses

Request samples

curl --location --max-time 30 --request GET 'slingshot.egoiapp.com/api/v2/push/reports?group=<string>&groupBy=<string>&dateStart=<string>&dateEnd=<string>&destination=<string>' \
--header 'ApiKey: '

Response samples

Content type
application/json
[
  • {
    }
]

Shortener

Get Link Statistics

Get the statistics of a given link

Authorizations:
ApiKey
path Parameters
link
required
string

Link unique url

Responses

Request samples

curl --location --max-time 30 --request GET 'slingshot.egoiapp.com/api/v2/shortener/reports/<string>' \
--header 'ApiKey: '

Response samples

Content type
application/json
[
  • {
    }
]

Get Link Statistics by Day

Get clicks and opens by day

Authorizations:
ApiKey
query Parameters
dateStart
string
Example: dateStart=2019-07-27

The date to start the report. Date must be in format yyyy-MM-dd

dateEnd
string
Example: dateEnd=2019-07-28

The date to end the report. Date should be in format yyyy-MM-dd

Responses

Request samples

curl --location --max-time 30 --request GET 'slingshot.egoiapp.com/api/v2/shortener/reports?dateStart=<string>&dateEnd=<string>' \
--header 'ApiKey: '

Response samples

Content type
application/json
[
  • {
    }
]

Create Single Shortener Link

Create a short link (ex. https://egoi.me/abcdefg )

Request Body schema: application/json
name
string

Link name

originalLink
required
string

Original link

Responses

Request samples

Content type
application/json
{}

Response samples

Content type
application/json
{
  • "name": "string",
  • "link": "string",
  • "fullLink": "string"
}

Registered

Slingshot, the transactional communications service from e-goi, allows its users to send emails and SMS through its API or SMTP servers, and to keep detailed logs from all steps of a message's lifecycle. This feature is called Registered Message.

Our records detail dates and times, sender and recipient information, subject and content of the message and its attachments, in addition to all other events related: sent, delivery, failed reception, opening and clicks recorded - for emails.

To enable Registered Message in your account, please get in touch with our Customer Services team, through the HELP separator in your e-goi interface, or simply call us.

Important
By enabling Registered, parameters openTrack and clickTrack will be forced to TRUE (as this tracking is part of the service)

LADS

This API is a service provided by E-goi to evaluate requests made to your application, evaluate and return proper ratings to those.

LADS (Login Anomaly Detection System) enables you to send specific evaluation request elements such as:

ua - user agent data from where the request was initially send from (ex: chrome)
ip - ip type from where the request was initially send from (ex: 127.0.0.1)
With these previous elements , lads will evaluate the request, against previous ones made, the evaluation is made according to level and ranges that define this level:

low - the request shares the most similarities with previous requests made ,meaning the threat level is low.
medium - the request shares some similarities with previous requests made ,meaning the threat level is medium.
high - the request doesn't share similarities with previous requests made ,meaning the threat level is high.

For more information about LADS please get in touch with our Customer Services team, through the HELP separator in your e-goi interface, or simply call us.

Webhooks

The transactional WebHooks feature provides a convenient way to follow the thread of each message, by defining a callback URL to be invoked when the message reaches each of the stages in its lifecycle.

You can use the Create WebHook method
to configure what actions to listen to, and where to send the information.
A JSON payload with the event's details will be sent (using POST) to the configured URL.

The event JSON payload takes the form of an event list.
Several events of any stage can be sent in a single request to the callback in the form:

[ 
  { 
  "actionDate": 1442484210599, 
  "data": { 
    "groupId": 1, 
    "recipientId": 14, 
    "messageId": 2156, 
    "createDate": 1442484203053, 
    "recipientEmail": "john.doe@example.com" 
  }, 
  "action": "processed" 
  } 
] 

Email Hooks

The hooks available in a mail message's lifecycle are:

states

State Description Is Final?
processed The message was successfully processed and is ready to be sent No
canceled The recipient's status doesn't allow sending Yes
sent The message was successfully sent to the destination server. No
failed The message failed to send because of an internal error in the SMTP Yes
bounce The destination server rejected the message permanently or temporarily Yes
delivered The message was delivered to the recipient Yes (if the recipient doesnt open the email)
view The recipient viewed the message URLs (available only when tracking is enabled) Yes (if recipient doesnt click on the link)
click The recipient clicked in any of the message URLs (available only when tracking is enabled) Yes (if the user doesnt report the email)
abuse There was a complaint reported on the ISP Yes

Sms Hooks

The hooks available in a sms message's lifecycle are:

states

State Description Is Final?
processed The message was successfully processed and is ready to be sent No
canceled The message failed to send because of an internal error Yes
sent The message was successfully sent No
failed The message failed to send because of an internal error Yes
delivered The message was successfully delivered to it's destination Yes

Get All Webhooks

Return all Webhooks defined by the user

Authorizations:
ApiKey
query Parameters
channel
string

The channel of the groups. Can be email , sms , push or shortener , otherwise returns all groups.

Responses

Request samples

curl --location --max-time 30 --request GET 'slingshot.egoiapp.com/api/v2/webhooks?channel=<string>' \
--header 'ApiKey: '

Response samples

Content type
application/json
[]

Create new Webhook

Create a new Webhook

Authorizations:
ApiKey
Request Body schema: application/json

default response

One of
url
required
string

The url to send the Events.

channel
required
string
Value: "email"

The channel of the webhook.

actions
Array of strings
Items Enum: "processed" "failed" "sent" "canceled" "click" "view" "remove" "bounce" "abuse"

A list of the actions to capture.

Responses

Request samples

Content type
application/json
Example
{
  • "url": "www.your-server/webhook/events",
  • "channel": "email",
  • "actions": [
    ]
}

Response samples

Content type
application/json
{
  • "webhookId": "1234"
}

Remove Webhook

Remove a Webhook

Authorizations:
ApiKey
query Parameters
url
required
string

url to be cleaned from the webhooks.

channel
string

The channel of the Webhook. Can be email , sms , push or shortener, otherwise removes all the requested webhooks.

Responses

Request samples

curl --location --max-time 30 --request DELETE 'slingshot.egoiapp.com/api/v2/webhooks?url=<string>&channel=<string>' \
--header 'ApiKey: '

Response samples

Content type
application/json
{}

Utilities

API state and other technical operations

Get All Groups

Retrieve all groups to sort messages

Authorizations:
ApiKey
query Parameters
channel
string

The channel of the groups. Can be email or sms, otherwise returns all groups.

Responses

Request samples

curl --location --max-time 30 --request GET 'slingshot.egoiapp.com/api/v2/groups?channel=<string>' \
--header 'ApiKey: '

Response samples

Content type
application/json
[
  • {
    }
]

Cancel Single Scheduled Message

Cancel a Scheduled Message

Authorizations:
ApiKey
path Parameters
id
required
string

Id of the Message to cancel the send.

Responses

Request samples

curl --location --max-time 30 --request DELETE 'slingshot.egoiapp.com/api/v2/messages/<string>/action/cancel' \
--header 'ApiKey: '

Response samples

Content type
application/json
{}

Get Subscriber Information

Retrieve Subscriber Information

Authorizations:
ApiKey
query Parameters
email
string
Example: email=12

Subscriber Email

mobile
string
Example: mobile=month

Subscriber mobile number

Responses

Request samples

curl --location --max-time 30 --request GET 'slingshot.egoiapp.com/api/v2/subscribers?email=<string>&mobile=<string>' \
--header 'ApiKey: '

Response samples

Content type
application/json
[
  • {
    }
]

Mobile Validator

Checks if a phone number is valid. Can be either land line or mobile

Request Body schema: application/json
number
required
string

Mobile Number

Responses

Request samples

Content type
application/json
{
  • "number": "351-987654321"
}

Response samples

Content type
application/json
{
  • "prefix": "351",
  • "number": "987654321",
  • "valid": false,
  • "message": "The number is not valid."
}

Ping API

Send an innocuous request to the API, in order to confirm its working as intended

Responses

Request samples

curl --location --max-time 30 --request GET 'slingshot.egoiapp.com/api/v2/utilities/ping'

Response samples

Content type
application/json
{
  • "apiStatus": "Up",
  • "date": "Fri Jan 17 11:20:07 WET 2020"
}

HTML to PDF converter

Converts an HTML input (either via html string or url) to a PDF returned at base 64. Before using, please validate if your HTML content isdone accordingly to the best standards HERE

Request Body schema: application/json
html
string

Html String

url
string

Url to the html file

Responses

Request samples

Content type
application/json
{
  • "html": "<html_here>",
  • "url": "your_url_here"
}

Response samples

Content type
application/json
{
  • "pdfData": "<base64_string>"
}

Sms Length Calculator

Calculates the sizes of an Sms text

Request Body schema: application/json
message
required
string

SMS Text String

gsm0338
required
boolean

Enable/Disable GSM0338

Responses

Request samples

Content type
application/json
{
  • "message": "message",
  • "gsm0338": false
}

Response samples

Content type
application/json
{
  • "gsm0338": true,
  • "charCount": 10,
  • "parts": 1,
  • "charPerMessage": 30,
  • "message": "sms text message"
}

Email Validator

Validates status and heath of the email address

Request Body schema: application/json
email
required
string

Email Address

isMx
boolean

Enable, disable MX validation

isTemporaryEmail
boolean

Enable, disable MX validation

Responses

Request samples

Content type
application/json
{
  • "email": "example@example.com",
  • "isMx": false,
  • "isTemporaryEmail": false
}

Response samples

Content type
application/json
{
  • "emailValid": "true",
  • "emailTemporary": "true",
  • "mx": "true"
}