iMessage-specific API
You can use all TextLink tools, integrations and APIs for your Blububl devices. Blububl is an iMessage automation solution that allows you to utilize iMessage for personalized / automated communication with your leads. You can see how it works on this page.
Onboarding to BluBubl is custom for each customer, and you need to contact Blububl directly in order to use the service.
BluBubl is a cloud service, and you can't set it up yourself like you do with TextLink devices.
This section covers the specific APIs for iMessage, including the API for checking if number has IMessage, and the APIs for sending a media message.. You can also use the basic SMS functionalities like sending and receiving messages the same way as using normal TextLink.
Checking if phone number has iMessage
To check if phone number uses iMessage, you can send the following POST request with tool of your choice (like Postman), or use any of the programming languages that support REST API calls.
You can only do that if you have an iMessage device (that can only be set up by BluBubl team).
Using API
POST
https://textlinksms.com/api/check-imessage
Headers
Content-Type*
The value should be "application/json"
Authorization*
The value should be "Bearer API_KEY", where API_KEY is the API key that you can see in the API Console
Request Body
phone_number*
String
Phone number that you want to check. International format, with prefix, like +11234567890
sim_card_id
Number
(Optional) Id of the iMessage virtual SIM card that you want to use for the check. Can be found in the Devices Console, by clicking on the device having the SIM card you need
{
ok: true,
imessage: true
}
Sending a voice note (using audio file)
Sending media messages, including voice notes, uses multipart form data for request body encoding, instead of JSON. It needs to be that way because it allows binary content, such as media, documents and other files.
Using API
POST
https://textlinksms.com/media/send-voice
Headers
Content-Type*
The value should be "multipart/form-data"
Authorization*
The value should be "Bearer API_KEY", where API_KEY is the API key that you can see in the API Console
Request Body (As multipart form data)
phone_number*
String
Phone number that you want to check. International format, with prefix, like +11234567890
voice*
File
Audio file (MP3, WAV, etc.) to send. The form‐field name must be voice
.
sim_card_id
Number
(Optional) Id of the iMessage virtual SIM card that you want to use for the check. Can be found in the Devices Console, by clicking on the device having the SIM card you need
{
ok: true,
price: 0,
sim_card_id: 1088
}
Code snippets
// Install dependencies first:
// npm install axios form-data
const axios = require('axios');
const FormData = require('form-data');
const fs = require('fs');
const path = require('path');
async function test() {
const form = new FormData();
form.append('phone_number', PHONE_NUMBER);
form.append('voice', fs.createReadStream(path.resolve(FILE_PATH)));
form.append('sim_card_id', SIM_CARD_ID);
try {
const response = await axios.post(
'https://textlinksms.com/media/send-voice',
form,
{
headers: {
'Authorization': 'Bearer ' + API_KEY,
...form.getHeaders(),
},
maxBodyLength: Infinity,
}
);
console.log('Response data:', response.data);
} catch (err) {
console.log(err);
}
}
test()
Sending a picture
Sending media messages, including images, uses multipart form data for request body encoding, instead of JSON. It needs to be that way because it allows binary content, such as media, documents and other files.
Using API
POST
https://textlinksms.com/media/send-image
Headers
Content-Type*
The value should be "multipart/form-data"
Authorization*
The value should be "Bearer API_KEY", where API_KEY is the API key that you can see in the API Console
Request Body (As multipart form data)
phone_number*
String
Phone number that you want to check. International format, with prefix, like +11234567890
image*
File
Image file (JPG, PNG, etc.) to send. The form‐field name must be image
.
sim_card_id
Number
(Optional) Id of the iMessage virtual SIM card that you want to use for the check. Can be found in the Devices Console, by clicking on the device having the SIM card you need
{
ok: true,
price: 0,
sim_card_id: 1088
}
Code snippets
// Install dependencies first:
// npm install axios form-data
const axios = require('axios');
const FormData = require('form-data');
const fs = require('fs');
const path = require('path');
async function test() {
const form = new FormData();
form.append('phone_number', PHONE_NUMBER);
form.append('image', fs.createReadStream(path.resolve(FILE_PATH)));
form.append('sim_card_id', SIM_CARD_ID);
try {
const response = await axios.post(
'https://textlinksms.com/media/send-image',
form,
{
headers: {
'Authorization': 'Bearer ' + API_KEY,
...form.getHeaders(),
},
maxBodyLength: Infinity,
}
);
console.log('Response data:', response.data);
} catch (err) {
console.log(err);
}
}
test()
Sending a video
Sending media messages, including videos, uses multipart form data for request body encoding, instead of JSON. It needs to be that way because it allows binary content, such as media, documents and other files.
Using API
POST
https://textlinksms.com/media/send-video
Headers
Content-Type*
The value should be "multipart/form-data"
Authorization*
The value should be "Bearer API_KEY", where API_KEY is the API key that you can see in the API Console
Request Body (As multipart form data)
phone_number*
String
Phone number that you want to check. International format, with prefix, like +11234567890
video*
File
Video file (MP4, MKV, etc.) to send. The form‐field name must be video
.
sim_card_id
Number
(Optional) Id of the iMessage virtual SIM card that you want to use for the check. Can be found in the Devices Console, by clicking on the device having the SIM card you need
{
ok: true,
price: 0,
sim_card_id: 1088
}
Code snippets
// Install dependencies first:
// npm install axios form-data
const axios = require('axios');
const FormData = require('form-data');
const fs = require('fs');
const path = require('path');
async function test() {
const form = new FormData();
form.append('phone_number', PHONE_NUMBER);
form.append('video', fs.createReadStream(path.resolve(FILE_PATH)));
form.append('sim_card_id', SIM_CARD_ID);
try {
const response = await axios.post(
'https://textlinksms.com/media/send-video',
form,
{
headers: {
'Authorization': 'Bearer ' + API_KEY,
...form.getHeaders(),
},
maxBodyLength: Infinity,
}
);
console.log('Response data:', response.data);
} catch (err) {
console.log(err);
}
}
test()
Sending a file
Sending media and file messages uses multipart form data for request body encoding, instead of JSON. It needs to be that way because it allows binary content, such as media, documents and other files.
Using API
POST
https://textlinksms.com/media/send-file
Headers
Content-Type*
The value should be "multipart/form-data"
Authorization*
The value should be "Bearer API_KEY", where API_KEY is the API key that you can see in the API Console
Request Body (As multipart form data)
phone_number*
String
Phone number that you want to check. International format, with prefix, like +11234567890
file*
File
Any file (PDF, PPTX, etc.) to send. The form‐field name must be file
.
sim_card_id
Number
(Optional) Id of the iMessage virtual SIM card that you want to use for the check. Can be found in the Devices Console, by clicking on the device having the SIM card you need
{
ok: true,
price: 0,
sim_card_id: 1088
}
Code snippets
// Install dependencies first:
// npm install axios form-data
const axios = require('axios');
const FormData = require('form-data');
const fs = require('fs');
const path = require('path');
async function test() {
const form = new FormData();
form.append('phone_number', PHONE_NUMBER);
form.append('file', fs.createReadStream(path.resolve(FILE_PATH)));
form.append('sim_card_id', SIM_CARD_ID);
try {
const response = await axios.post(
'https://textlinksms.com/media/send-file',
form,
{
headers: {
'Authorization': 'Bearer ' + API_KEY,
...form.getHeaders(),
},
maxBodyLength: Infinity,
}
);
console.log('Response data:', response.data);
} catch (err) {
console.log(err);
}
}
test()
Receiving media messages
When you receive a media message, a normal receive SMS webhook is triggered, and the text of the message includes filename, and is formatted like this:
For voice messages: https://textlinksms.com/uploads/voice/e022e743-8e0e-4ea1-8a29-d6404a85eaef.mp3
Last updated