Sign inGet started

Sinch Exit API

If you already have an integration using the Sinch SMS API to send and receive SMS messages (basic send and receive only), you can use this guide to start sending your SMS messages through Bird without having to rewrite your API integration.
The Bird Sinch Exit API allows you to send SMS messages through the Bird Engagement Platform, using your existing Sinch Integration. It acts as an adapter that translates the requests and responses from the Sinch format to Bird format and vice versa.

How does it work?

Your Sinch integration will send the request using the Sinch API format to the Bird Sinch Exit API. Our API will accept the Sinch formatted request, translate it to Bird's format, process the message, and then translate our response to the Sinch API response format you're expecting, ta-da! You don't have to rewrite all of your integration to start sending messages via Bird.

Setup the integration

  1. Setup your Bird Engagement Platform account
  2. Install an SMS channel
  3. Copy your main keys
  4. Update your Sinch integration URL and keys
  5. Setup your Webhook to receive events and incoming messages

Setup your Bird account

Login to your Bird Engagement Platform account or Sign up for a new account if you don't have one.

Install an SMS channel

You will need to install an SMS channel on a working phone number. Follow this guide on how to install an SMS channel.

Copy your main keys

You will need:

  • Your workspace ID (click Edit workspace to see your ID)
  • Access key
  • The phone number of the SMS channel you're sending messages from

Update your Sinch Integration

Now that you have all the keys you need, you will need to do minimal change to your existing Sinch integration.
  1. Update the domain name from https://[us|eu|au|br|ca].sms.api.sinch.com to one of the following domains:
    • EU (for Europe region): https://eu-west-1.sinch.to.api.bird.com
    • US (for US region): https://us-west-1.sinch.to.api.bird.com
  2. Update your service_plan_id to use your Bird WorkspaceID
  3. Update your Token to use your Bird AccessKey
  4. Update the โ€œFromโ€ number to the phone number you used to setup the SMS channel on our end
That's it! You're ready to start sending SMS messages via Bird.

Setup a Webhook subscription

Setting up a webhook subscription can currently be done via the API using the following endpoint:
Here is an example of such a request
Przykล‚ad kodu
{
    "service": "channels",
    "event": "sms.inbound",
    "eventFilters": [{
        "key": "channelId",
        "value": "{{channel_id}}"
    }],
    "template": "sinch",
    "url": "https://your.site/webhook/url",
    "signingKey": "your-secret-signing-key"
}
Bird webhooks are signed using the SigningKey specified when creating your webhook subscription.
Make sure you keep your SigningKey safe, as it's used to verify the authenticity of the webhook requests.
Full webhooks API documentation can be found here.

Setup a Webhook subscription to receive incoming messages

Setting up a webhook subscription is an optional step and is only needed if you need to receive inbound messages (2-way messaging use case). Much like Sinch, Bird's webhooks are set up by channel instance. So, for SMS, webhooks are set up by number.
To receive webhooks for incoming SMS messages on your SMS channel, you need to set up a webhook subscription by using the above request. For incoming messages, set the event to sms.inbound. You can choose to receive this webhook in the Sinch format by setting the template parameter to sinch.

Setup webhook subscription for status reports for outbound messages

You can also set up webhooks for status reports for outbound messages by using the sms.outbound event. This is required to make webhooks work for outbound messages since we need a signing key to sign the request.
When you use callback_url to subscribe to webhooks for outgoing messages, this URL overwrites the default URL set in the above request and sets the template to use the sinch template, regardless of the subscription settings.
Bird also employs a secure way of signing requests. When using the sinch template, we will sign our requests the Bird way, with the Bird header.

Sinch Exit API Explained

Our Sinch Exit API translates requests using the Sinch format to the Bird format, before sending it to the Bird API. And on receiving a response from our API, it translates it back into the Sinch format. This section explains which endpoints are supported and how we translate and map fields between both APIs.

Endpoints

Currently, the Sinch Exit API is limited to sending SMS messages exclusively through your Sinch Integration. The supported endpoints are:
OperationEndpoint
Send messagePOST /xms/v1/{{workspaceID}}/batches
Fetch messageGET /xms/v1/{{workspaceID}}/batches/{{messageID}}
List messagesGET /xms/v1/{{workspaceID}}/batches

Message response

The message object's response resembles Sinch's, though some fields may be empty. Below is an example of our responses:
JSON fieldStatusBird fieldExample
id๐ŸŸข Supportedid"id":""
to๐ŸŸข Supportedreceiver.contacts[].identifierValue"to":["+31623456789"]
from๐ŸŸข Supportedsender.connector.identifierValue"from": "+1234567890"
body๐ŸŸข Supportedbody.text.text"body": "Hello World!"
type๐ŸŸก Always mt_text-"type": "mt_text"
canceled๐ŸŸก Always false-"canceled": false
delivery_report๐ŸŸก Always none-"delivery_report": "none"
client_reference๐ŸŸข Supportedreference"client_reference": "abcdef"
created_at๐ŸŸข SupportedcreatedAt"created_at": "YYYY-MM-DDThh:mm:ss.SSSZ"
modified_at๐ŸŸข SupportedupdatedAt"modified_at": "YYYY-MM-DDThh:mm:ss.SSSZ"
expire_at๐ŸŸข Supported-"expired_at":""

Create message

Form fieldStatus
service_plan_id (Path)๐ŸŸข Use your Bird WorkspaceID
to[] (Required)๐ŸŸ  Supported, only the first item will be used to send to
from (Required)๐ŸŸข Supported. Must be the number of an active SMS channel in MessageBird.
body (Optional)๐ŸŸข Supported
delivery_report (Optional)๐ŸŸ  Always per_recipient if used
callback_url (Optional)๐ŸŸข Supported
client_reference (Optional)๐ŸŸข Supported
parameters (Optional)๐ŸŸ  Ignored if used
type (Optional)๐ŸŸ  Always mt_text
sent_at (Optional)๐ŸŸ  Ignored if used, scheduling not supported
expire_at (Optional)๐ŸŸ  Ignored if used, validity not supported
feedback_enabled (Optional)๐ŸŸ  Ignored if used
flash_message (Optional)๐ŸŸ  Ignored if used
truncate_concat (Optional)๐ŸŸ  Ignored if used
max_number_of_message_parts (Optional)๐ŸŸ  Ignored if used
from_ton (Optional)๐ŸŸ  Ignored if used
from_npi (Optional)๐ŸŸ  Ignored if used

Response

List messages

Request

Filtering messages can be done using the following query string parameters:
Query parameterStatus
service_plan_id (Path)๐ŸŸข Use your Bird WorkspaceID
page (Optional)๐Ÿ”ด Not Supported
page_size (Optional)๐ŸŸก Supported, but with a maximum of 100
from (Optional)๐ŸŸข Supported
start_date (Optional)๐ŸŸข Supported
end_date (Optional)๐ŸŸข Supported

Response

JSON responseChannels field
page๐ŸŸข Supported
page_size๐ŸŸข Supported
count๐ŸŸข Supported
batches๐ŸŸข Supported: See message response