ytelapi v3.1.3
Getting started
Ytel API version 3.1.2
How to Build
The generated SDK relies on Node Package Manager (NPM) being available to resolve dependencies. If you don't already have NPM installed, please go ahead and follow instructions to install NPM from here. The SDK also requires Node to be installed. If Node isn't already installed, please install it from here
NPM is installed by default when Node is installed
To check if node and npm have been successfully installed, write the following commands in command prompt:
node --version
npm -version
Now use npm to resolve all dependencies by running the following command in the root directory (of the SDK folder):
npm install
This will install all dependencies in the node_modules
folder.
Once dependencies are resolved, you will need to move the folder YtelAPILib
in to your node_modules
folder.
How to Use
The following section explains how to use the library in a new project.
1. Open Project Folder
Open an IDE/Text Editor for JavaScript like Sublime Text. The basic workflow presented here is also applicable if you prefer using a different editor or IDE.
Click on File
and select Open Folder
.
Select the folder of your SDK and click on Select Folder
to open it up in Sublime Text. The folder will become visible in the bar on the left.
2. Creating a Test File
Now right click on the folder name and select the New File
option to create a new test file. Save it as index.js
Now import the generated NodeJS library using the following lines of code:
var lib = require('lib');
Save changes.
3. Running The Test File
To run the index.js
file, open up the command prompt and navigate to the Path where the SDK folder resides. Type the following command to run the file:
node index.js
How to Test
These tests use Mocha framework for testing, coupled with Chai for assertions. These dependencies need to be installed for tests to run. Tests can be run in a number of ways:
Method 1 (Run all tests)
- Navigate to the root directory of the SDK folder from command prompt.
- Type
mocha --recursive
to run all the tests.
Method 2 (Run all tests)
- Navigate to the
../test/Controllers/
directory from command prompt. - Type
mocha *
to run all the tests.
Method 3 (Run specific controller's tests)
- Navigate to the
../test/Controllers/
directory from command prompt. - Type
mocha Ytel APIController
to run all the tests in that controller file.
To increase mocha's default timeout, you can change the
TEST_TIMEOUT
parameter's value inTestBootstrap.js
.
Initialization
Authentication
In order to setup authentication in the API client, you need the following information.
Parameter | Description |
---|---|
basicAuthUserName | The username to use with basic authentication |
basicAuthPassword | The password to use with basic authentication |
API client can be initialized as following:
const lib = require('lib');
// Configuration parameters and credentials
lib.Configuration.basicAuthUserName = "basicAuthUserName"; // The username to use with basic authentication
lib.Configuration.basicAuthPassword = "basicAuthPassword"; // The password to use with basic authentication
Class Reference
List of Controllers
- UsageController
- SubAccountController
- AccountController
- EmailController
- RecordingController
- TranscriptionController
- ConferenceController
- PhoneNumberController
- CarrierController
- DedicatedShortCodeController
- SharedShortCodeController
- SMSController
- VoiceController
UsageController
Get singleton instance
The singleton instance of the UsageController
class can be accessed from the API Client.
var controller = lib.UsageController;
createListUsage
Retrieve usage metrics regarding your Ytel account. The results includes inbound/outbound voice calls and inbound/outbound SMS messages as well as carrier lookup requests.
function createListUsage(productCode, startDate, endDate, includeSubAccounts, callback)
Parameters
Parameter | Tags | Description |
---|---|---|
productCode | Optional | Filter usage results by product type. |
startDate | Optional | Filter usage objects by start date. |
endDate | Optional | Filter usage objects by end date. |
includeSubAccounts | Optional | Will include all subaccount usage data |
Example Usage
var productCode = Object.keys(ProductCode)[0];
var startDate = 'startDate';
var endDate = 'endDate';
var includeSubAccounts = 'IncludeSubAccounts';
controller.createListUsage(productCode, startDate, endDate, includeSubAccounts, function(error, response, context) {
});
SubAccountController
Get singleton instance
The singleton instance of the SubAccountController
class can be accessed from the API Client.
var controller = lib.SubAccountController;
createSubaccount
Create a sub user account under the parent account
function createSubaccount(firstName, lastName, email, friendlyName, password, callback)
Parameters
Parameter | Tags | Description |
---|---|---|
firstName | Required | Sub account user first name |
lastName | Required | sub account user last name |
Required | Sub account email address | |
friendlyName | Required | Descriptive name of the sub account |
password | Required | The password of the sub account. Please make sure to make as password that is at least 8 characters long, contain a symbol, uppercase and a number. |
Example Usage
var firstName = 'FirstName';
var lastName = 'LastName';
var email = 'Email';
var friendlyName = 'FriendlyName';
var password = 'Password';
controller.createSubaccount(firstName, lastName, email, friendlyName, password, function(error, response, context) {
});
createDeleteSubaccount
Delete sub account or merge numbers into parent
function createDeleteSubaccount(subAccountSID, mergeNumber, callback)
Parameters
Parameter | Tags | Description |
---|---|---|
subAccountSID | Required | The SubaccountSid to be deleted |
mergeNumber | Required | 0 to delete or 1 to merge numbers to parent account. |
Example Usage
var subAccountSID = 'SubAccountSID';
var mergeNumber = Object.keys(MergeNumber)[0];
controller.createDeleteSubaccount(subAccountSID, mergeNumber, function(error, response, context) {
});
createToggleSubaccountStatus
Suspend or unsuspend
function createToggleSubaccountStatus(subAccountSID, activate, callback)
Parameters
Parameter | Tags | Description |
---|---|---|
subAccountSID | Required | The SubaccountSid to be activated or suspended |
activate | Required | 0 to suspend or 1 to activate |
Example Usage
var subAccountSID = 'SubAccountSID';
var activate = Object.keys(Activate)[0];
controller.createToggleSubaccountStatus(subAccountSID, activate, function(error, response, context) {
});
AccountController
Get singleton instance
The singleton instance of the AccountController
class can be accessed from the API Client.
var controller = lib.AccountController;
createViewAccount
Retrieve information regarding your Ytel account by a specific date. The response object will contain data such as account status, balance, and account usage totals.
function createViewAccount(date, callback)
Parameters
Parameter | Tags | Description |
---|---|---|
date | Required | Filter account information based on date. |
Example Usage
var date = 'Date';
controller.createViewAccount(date, function(error, response, context) {
});
EmailController
Get singleton instance
The singleton instance of the EmailController
class can be accessed from the API Client.
var controller = lib.EmailController;
createBlockedEmails
Retrieve a list of emails that have been blocked.
function createBlockedEmails(offset, limit, callback)
Parameters
Parameter | Tags | Description |
---|---|---|
offset | Optional | The starting point of the list of blocked emails that should be returned. |
limit | Optional | The count of results that should be returned. |
Example Usage
var offset = 'Offset';
var limit = 'Limit';
controller.createBlockedEmails(offset, limit, function(error, response, context) {
});
createRemoveInvalidEmail
Remove an email from the invalid email list.
function createRemoveInvalidEmail(email, callback)
Parameters
Parameter | Tags | Description |
---|---|---|
Required | A valid email address that is to be remove from the invalid email list. |
Example Usage
var email = 'Email';
controller.createRemoveInvalidEmail(email, function(error, response, context) {
});
createInvalidEmails
Retrieve a list of invalid email addresses.
function createInvalidEmails(offset, limit, callback)
Parameters
Parameter | Tags | Description |
---|---|---|
offset | Optional | The starting point of the list of invalid emails that should be returned. |
limit | Optional | The count of results that should be returned. |
Example Usage
var offset = 'Offset';
var limit = 'Limit';
controller.createInvalidEmails(offset, limit, function(error, response, context) {
});
createRemoveBouncedEmail
Remove an email address from the bounced list.
function createRemoveBouncedEmail(email, callback)
Parameters
Parameter | Tags | Description |
---|---|---|
Required | The email address to be remove from the bounced email list. |
Example Usage
var email = 'Email';
controller.createRemoveBouncedEmail(email, function(error, response, context) {
});
createBouncedEmails
Retrieve a list of emails that have bounced.
function createBouncedEmails(offset, limit, callback)
Parameters
Parameter | Tags | Description |
---|---|---|
offset | Optional | The starting point of the list of bounced emails that should be returned. |
limit | Optional | The count of results that should be returned. |
Example Usage
var offset = 'Offset';
var limit = 'Limit';
controller.createBouncedEmails(offset, limit, function(error, response, context) {
});
createSpamEmails
Retrieve a list of emails that are on the spam list.
function createSpamEmails(offset, limit, callback)
Parameters
Parameter | Tags | Description |
---|---|---|
offset | Optional | The starting point of the list of spam emails that should be returned. |
limit | Optional | The count of results that should be returned. |
Example Usage
var offset = 'Offset';
var limit = 'Limit';
controller.createSpamEmails(offset, limit, function(error, response, context) {
});
createSendEmail
Create and submit an email message to one or more email addresses.
function createSendEmail(to, type, subject, message, from, cc, bcc, attachment, callback)
Parameters
Parameter | Tags | Description |
---|---|---|
to | Required | A valid address that will receive the email. Multiple addresses can be separated by using commas. |
type | Required | Specifies the type of email to be sent |
subject | Required | The subject of the mail. Must be a valid string. |
message | Required | The email message that is to be sent in the text. |
from | Optional | A valid address that will send the email. |
cc | Optional | Carbon copy. A valid address that will receive the email. Multiple addresses can be separated by using commas. |
bcc | Optional | Blind carbon copy. A valid address that will receive the email. Multiple addresses can be separated by using commas. |
attachment | Optional | A file that is attached to the email. Must be less than 7 MB in size. |
Example Usage
var to = 'To';
var type = Object.keys(Type)[0];
var subject = 'Subject';
var message = 'Message';
var from = 'From';
var cc = 'Cc';
var bcc = 'Bcc';
var attachment = 'Attachment';
controller.createSendEmail(to, type, subject, message, from, cc, bcc, attachment, function(error, response, context) {
});
createRemoveBlockedAddress
Remove an email from blocked emails list.
function createRemoveBlockedAddress(email, callback)
Parameters
Parameter | Tags | Description |
---|---|---|
Required | The email address to be remove from the blocked list. |
Example Usage
var email = 'Email';
controller.createRemoveBlockedAddress(email, function(error, response, context) {
});
addEmailUnsubscribe
Add an email to the unsubscribe list
function addEmailUnsubscribe(email, callback)
Parameters
Parameter | Tags | Description |
---|---|---|
Required | A valid email address that is to be added to the unsubscribe list |
Example Usage
var email = 'email';
controller.addEmailUnsubscribe(email, function(error, response, context) {
});
createRemoveUnsubscribedEmail
Remove an email address from the list of unsubscribed emails.
function createRemoveUnsubscribedEmail(email, callback)
Parameters
Parameter | Tags | Description |
---|---|---|
Required | A valid email address that is to be remove from the unsubscribe list. |
Example Usage
var email = 'email';
controller.createRemoveUnsubscribedEmail(email, function(error, response, context) {
});
createListUnsubscribedEmails
Retrieve a list of email addresses from the unsubscribe list.
function createListUnsubscribedEmails(offset, limit, callback)
Parameters
Parameter | Tags | Description |
---|---|---|
offset | Optional | The starting point of the list of unsubscribed emails that should be returned. |
limit | Optional | The count of results that should be returned. |
Example Usage
var offset = 'Offset';
var limit = 'Limit';
controller.createListUnsubscribedEmails(offset, limit, function(error, response, context) {
});
createRemoveSpamAddress
Remove an email from the spam email list.
function createRemoveSpamAddress(email, callback)
Parameters
Parameter | Tags | Description |
---|---|---|
Required | A valid email address that is to be remove from the spam list. |
Example Usage
var email = 'Email';
controller.createRemoveSpamAddress(email, function(error, response, context) {
});
RecordingController
Get singleton instance
The singleton instance of the RecordingController
class can be accessed from the API Client.
var controller = lib.RecordingController;
createDeleteRecording
Remove a recording from your Ytel account.
function createDeleteRecording(recordingsid, callback)
Parameters
Parameter | Tags | Description |
---|---|---|
recordingsid | Required | The unique identifier for a recording. |
Example Usage
var recordingsid = 'recordingsid';
controller.createDeleteRecording(recordingsid, function(error, response, context) {
});
createListRecordings
Retrieve a list of recording objects.
function createListRecordings(page, pagesize, datecreated, callsid, callback)
Parameters
Parameter | Tags | Description |
---|---|---|
page | Optional | The page count to retrieve from the total results in the collection. Page indexing starts at 1. |
pagesize | Optional | The count of objects to return per page. |
datecreated | Optional | Filter results by creation date |
callsid | Optional | The unique identifier for a call. |
Example Usage
var page = 39;
var pagesize = 39;
var datecreated = 'Datecreated';
var callsid = 'callsid';
controller.createListRecordings(page, pagesize, datecreated, callsid, function(error, response, context) {
});
createViewRecording
Retrieve the recording of a call by its RecordingSid. This resource will return information regarding the call such as start time, end time, duration, and so forth.
function createViewRecording(recordingsid, callback)
Parameters
Parameter | Tags | Description |
---|---|---|
recordingsid | Required | The unique identifier for the recording. |
Example Usage
var recordingsid = 'recordingsid';
controller.createViewRecording(recordingsid, function(error, response, context) {
});
TranscriptionController
Get singleton instance
The singleton instance of the TranscriptionController
class can be accessed from the API Client.
var controller = lib.TranscriptionController;
createTranscribeAudioURL
Transcribe an audio recording from a file.
function createTranscribeAudioURL(audiourl, callback)
Parameters
Parameter | Tags | Description |
---|---|---|
audiourl | Required | URL pointing to the location of the audio file that is to be transcribed. |
Example Usage
var audiourl = 'audiourl';
controller.createTranscribeAudioURL(audiourl, function(error, response, context) {
});
createListTranscriptions
Retrieve a list of transcription objects for your Ytel account.
function createListTranscriptions(page, pagesize, status, dateTranscribed, callback)
Parameters
Parameter | Tags | Description |
---|---|---|
page | Optional | The page count to retrieve from the total results in the collection. Page indexing starts at 1. |
pagesize | Optional | The count of objects to return per page. |
status | Optional | The state of the transcription. |
dateTranscribed | Optional | The date the transcription took place. |
Example Usage
var page = 39;
var pagesize = 39;
var status = Object.keys(Status)[0];
var dateTranscribed = 'dateTranscribed';
controller.createListTranscriptions(page, pagesize, status, dateTranscribed, function(error, response, context) {
});
createViewTranscription
Retrieve information about a transaction by its TranscriptionSid.
function createViewTranscription(transcriptionsid, callback)
Parameters
Parameter | Tags | Description |
---|---|---|
transcriptionsid | Required | The unique identifier for a transcription object. |
Example Usage
var transcriptionsid = 'transcriptionsid';
controller.createViewTranscription(transcriptionsid, function(error, response, context) {
});
createTranscribeRecording
Transcribe a recording by its RecordingSid.
function createTranscribeRecording(recordingSid, callback)
Parameters
Parameter | Tags | Description |
---|---|---|
recordingSid | Required | The unique identifier for a recording object. |
Example Usage
var recordingSid = 'recordingSid';
controller.createTranscribeRecording(recordingSid, function(error, response, context) {
});
ConferenceController
Get singleton instance
The singleton instance of the ConferenceController
class can be accessed from the API Client.
var controller = lib.ConferenceController;
createListConferences
Retrieve a list of conference objects.
function createListConferences(page, pagesize, friendlyName, dateCreated, callback)
Parameters
Parameter | Tags | Description |
---|---|---|
page | Optional | The page count to retrieve from the total results in the collection. Page indexing starts at 1. |
pagesize | Optional | Number of individual resources listed in the response per page |
friendlyName | Optional | Only return conferences with the specified FriendlyName |
dateCreated | Optional | Conference created date |
Example Usage
var page = 39;
var pagesize = 39;
var friendlyName = 'FriendlyName';
var dateCreated = 'DateCreated';
controller.createListConferences(page, pagesize, friendlyName, dateCreated, function(error, response, context) {
});
createHangupParticipant
Remove a participant from a conference.
function createHangupParticipant(participantSid, conferenceSid, callback)
Parameters
Parameter | Tags | Description |
---|---|---|
participantSid | Required | The unique identifier for a participant object. |
conferenceSid | Required | The unique identifier for a conference object. |
Example Usage
var participantSid = 'ParticipantSid';
var conferenceSid = 'ConferenceSid';
controller.createHangupParticipant(participantSid, conferenceSid, function(error, response, context) {
});
createPlayAudio
Play an audio file during a conference.
function createPlayAudio(conferenceSid, participantSid, audioUrl, callback)
Parameters
Parameter | Tags | Description |
---|---|---|
conferenceSid | Required | The unique identifier for a conference object. |
participantSid | Required | The unique identifier for a participant object. |
audioUrl | Required | The URL for the audio file that is to be played during the conference. Multiple audio files can be chained by using a semicolon. |
Example Usage
var conferenceSid = 'ConferenceSid';
var participantSid = 'ParticipantSid';
var audioUrl = Object.keys(AudioUrl)[0];
controller.createPlayAudio(conferenceSid, participantSid, audioUrl, function(error, response, context) {
});
createListParticipants
Retrieve a list of participants for an in-progress conference.
function createListParticipants(conferenceSid, page, pagesize, muted, deaf, callback)
Parameters
Parameter | Tags | Description |
---|---|---|
conferenceSid | Required | The unique identifier for a conference. |
page | Optional | The page count to retrieve from the total results in the collection. Page indexing starts at 1. |
pagesize | Optional | The count of objects to return per page. |
muted | Optional | Specifies if participant should be muted. |
deaf | Optional | Specifies if the participant should hear audio in the conference. |
Example Usage
var conferenceSid = 'ConferenceSid';
var page = 39;
var pagesize = 39;
var muted = false;
var deaf = false;
controller.createListParticipants(conferenceSid, page, pagesize, muted, deaf, function(error, response, context) {
});
createConference
Here you can experiment with initiating a conference call through Ytel and view the request response generated when doing so.
function createConference(url, from, to, method, statusCallBackUrl, statusCallBackMethod, fallbackUrl, fallbackMethod, record, recordCallBackUrl, recordCallBackMethod, scheduleTime, timeout, callback)
Parameters
Parameter | Tags | Description |
---|---|---|
url | Required | URL requested once the conference connects |
from | Required | A valid 10-digit number (E.164 format) that will be initiating the conference call. |
to | Required | A valid 10-digit number (E.164 format) that is to receive the conference call. |
method | Optional | Specifies the HTTP method used to request the required URL once call connects. |
statusCallBackUrl | Optional | URL that can be requested to receive notification when call has ended. A set of default parameters will be sent here once the conference is finished. |
statusCallBackMethod | Optional | Specifies the HTTP methodlinkclass used to request StatusCallbackUrl. |
fallbackUrl | Optional | URL requested if the initial Url parameter fails or encounters an error |
fallbackMethod | Optional | Specifies the HTTP method used to request the required FallbackUrl once call connects. |
record | Optional | Specifies if the conference should be recorded. |
recordCallBackUrl | Optional | Recording parameters will be sent here upon completion. |
recordCallBackMethod | Optional | Specifies the HTTP method used to request the required URL once conference connects. |
scheduleTime | Optional | Schedule conference in future. Schedule time must be greater than current time |
timeout | Optional | The number of seconds the call stays on the line while waiting for an answer. The max time limit is 999 and the default limit is 60 seconds but lower times can be set. |
Example Usage
var url = 'Url';
var from = 'From';
var to = 'To';
var method = 'Method';
var statusCallBackUrl = 'StatusCallBackUrl';
var statusCallBackMethod = 'StatusCallBackMethod';
var fallbackUrl = 'FallbackUrl';
var fallbackMethod = 'FallbackMethod';
var record = false;
var recordCallBackUrl = 'RecordCallBackUrl';
var recordCallBackMethod = 'RecordCallBackMethod';
var scheduleTime = 'ScheduleTime';
var timeout = 39;
controller.createConference(url, from, to, method, statusCallBackUrl, statusCallBackMethod, fallbackUrl, fallbackMethod, record, recordCallBackUrl, recordCallBackMethod, scheduleTime, timeout, function(error, response, context) {
});
createViewParticipant
Retrieve information about a participant by its ParticipantSid.
function createViewParticipant(conferenceSid, participantSid, callback)
Parameters
Parameter | Tags | Description |
---|---|---|
conferenceSid | Required | The unique identifier for a conference object. |
participantSid | Required | The unique identifier for a participant object. |
Example Usage
var conferenceSid = 'ConferenceSid';
var participantSid = 'ParticipantSid';
controller.createViewParticipant(conferenceSid, participantSid, function(error, response, context) {
});
createViewConference
Retrieve information about a conference by its ConferenceSid.
function createViewConference(conferenceSid, callback)
Parameters
Parameter | Tags | Description |
---|---|---|
conferenceSid | Required | The unique identifier of each conference resource |
Example Usage
var conferenceSid = 'ConferenceSid';
controller.createViewConference(conferenceSid, function(error, response, context) {
});
addParticipant
Add Participant in conference
function addParticipant(conferenceSid, participantNumber, muted, deaf, callback)
Parameters
Parameter | Tags | Description |
---|---|---|
conferenceSid | Required | The unique identifier for a conference object. |
participantNumber | Required | The phone number of the participant to be added. |
muted | Optional | Specifies if participant should be muted. |
deaf | Optional | Specifies if the participant should hear audio in the conference. |
Example Usage
var conferenceSid = 'ConferenceSid';
var participantNumber = 'ParticipantNumber';
var muted = false;
var deaf = false;
controller.addParticipant(conferenceSid, participantNumber, muted, deaf, function(error, response, context) {
});
createSilenceParticipant
Deaf Mute Participant
function createSilenceParticipant(conferenceSid, participantSid, muted, deaf, callback)
Parameters
Parameter | Tags | Description |
---|---|---|
conferenceSid | Required | ID of the active conference |
participantSid | Required | ID of an active participant |
muted | Optional | Mute a participant |
deaf | Optional | Make it so a participant cant hear |
Example Usage
var conferenceSid = 'conferenceSid';
var participantSid = 'ParticipantSid';
var muted = false;
var deaf = false;
controller.createSilenceParticipant(conferenceSid, participantSid, muted, deaf, function(error, response, context) {
});
PhoneNumberController
Get singleton instance
The singleton instance of the PhoneNumberController
class can be accessed from the API Client.
var controller = lib.PhoneNumberController;
createBulkBuyNumbers
Purchase a selected number of DID's from specific area codes to be used with your Ytel account.
function createBulkBuyNumbers(numberType, areaCode, quantity, leftover, callback)
Parameters
Parameter | Tags | Description |
---|---|---|
numberType | Required | The capability the number supports. |
areaCode | Required | Specifies the area code for the returned list of available numbers. Only available for North American numbers. |
quantity | Required | A positive integer that tells how many number you want to buy at a time. |
leftover | Optional | If desired quantity is unavailable purchase what is available . |
Example Usage
var numberType = Object.keys(NumberType2)[0];
var areaCode = 'AreaCode';
var quantity = 'Quantity';
var leftover = 'Leftover';
controller.createBulkBuyNumbers(numberType, areaCode, quantity, leftover, function(error, response, context) {
});
createBulkUpdateNumbers
Update properties for a Ytel numbers that has been purchased for your account. Refer to the parameters list for the list of properties that can be updated.
function createBulkUpdateNumbers(phoneNumber, voiceUrl, friendlyName, voiceMethod, voiceFallbackUrl, voiceFallbackMethod, hangupCallback, hangupCallbackMethod, heartbeatUrl, heartbeatMethod, smsUrl, smsMethod, smsFallbackUrl, smsFallbackMethod, callback)
Parameters
Parameter | Tags | Description |
---|---|---|
phoneNumber | Required | A valid comma(,) separated Ytel numbers. (E.164 format). |
voiceUrl | Required | The URL returning InboundXML incoming calls should execute when connected. |
friendlyName | Optional | A human-readable value for labeling the number. |
voiceMethod | Optional | Specifies the HTTP method used to request the VoiceUrl once incoming call connects. |
voiceFallbackUrl | Optional | URL used if any errors occur during execution of InboundXML on a call or at initial request of the voice url |
voiceFallbackMethod | Optional | Specifies the HTTP method used to request the VoiceFallbackUrl once incoming call connects. |
hangupCallback | Optional | URL that can be requested to receive notification when and how incoming call has ended. |
hangupCallbackMethod | Optional | The HTTP method Ytel will use when requesting the HangupCallback URL. |
heartbeatUrl | Optional | URL that can be used to monitor the phone number. |
heartbeatMethod | Optional | The HTTP method Ytel will use when requesting the HeartbeatUrl. |
smsUrl | Optional | URL requested when an SMS is received. |
smsMethod | Optional | The HTTP method Ytel will use when requesting the SmsUrl. |
smsFallbackUrl | Optional | URL used if any errors occur during execution of InboundXML from an SMS or at initial request of the SmsUrl. |
smsFallbackMethod | Optional | The HTTP method Ytel will use when URL requested if the SmsUrl is not available. |
Example Usage
var phoneNumber = 'PhoneNumber';
var voiceUrl = 'VoiceUrl';
var friendlyName = 'FriendlyName';
var voiceMethod = 'VoiceMethod';
var voiceFallbackUrl = 'VoiceFallbackUrl';
var voiceFallbackMethod = 'VoiceFallbackMethod';
var hangupCallback = 'HangupCallback';
var hangupCallbackMethod = 'HangupCallbackMethod';
var heartbeatUrl = 'HeartbeatUrl';
var heartbeatMethod = 'HeartbeatMethod';
var smsUrl = 'SmsUrl';
var smsMethod = 'SmsMethod';
var smsFallbackUrl = 'SmsFallbackUrl';
var smsFallbackMethod = 'SmsFallbackMethod';
controller.createBulkUpdateNumbers(phoneNumber, voiceUrl, friendlyName, voiceMethod, voiceFallbackUrl, voiceFallbackMethod, hangupCallback, hangupCallbackMethod, heartbeatUrl, heartbeatMethod, smsUrl, smsMethod, smsFallbackUrl, smsFallbackMethod, function(error, response, context) {
});
createMoveNumber
Transfer phone number that has been purchased for from one account to another account.
function createMoveNumber(phonenumber, fromaccountsid, toaccountsid, callback)
Parameters
Parameter | Tags | Description |
---|---|---|
phonenumber | Required | A valid 10-digit Ytel number (E.164 format). |
fromaccountsid | Required | A specific Accountsid from where Number is getting transfer. |
toaccountsid | Required | A specific Accountsid to which Number is getting transfer. |
Example Usage
var phonenumber = 'phonenumber';
var fromaccountsid = 'fromaccountsid';
var toaccountsid = 'toaccountsid';
controller.createMoveNumber(phonenumber, fromaccountsid, toaccountsid, function(error, response, context) {
});
createListNumbers
Retrieve a list of purchased phones numbers associated with your Ytel account.
function createListNumbers(page, pageSize, numberType, friendlyName, callback)
Parameters
Parameter | Tags | Description |
---|---|---|
page | Optional | Which page of the overall response will be returned. Page indexing starts at 1. |
pageSize | Optional | The page count to retrieve from the total results in the collection. Page indexing starts at 1. |
numberType | Optional | The capability supported by the number.Number type either SMS,Voice or all |
friendlyName | Optional | A human-readable label added to the number object. |
Example Usage
var page = 39;
var pageSize = 39;
var numberType = Object.keys(NumberType)[0];
var friendlyName = 'FriendlyName';
controller.createListNumbers(page, pageSize, numberType, friendlyName, function(error, response, context) {
});
updateNumber
Update properties for a Ytel number that has been purchased for your account. Refer to the parameters list for the list of properties that can be updated.
function updateNumber(phoneNumber, voiceUrl, friendlyName, voiceMethod, voiceFallbackUrl, voiceFallbackMethod, hangupCallback, hangupCallbackMethod, heartbeatUrl, heartbeatMethod, smsUrl, smsMethod, smsFallbackUrl, smsFallbackMethod, callback)
Parameters
Parameter | Tags | Description |
---|---|---|
phoneNumber | Required | A valid Ytel number (E.164 format). |
voiceUrl | Required | URL requested once the call connects |
friendlyName | Optional | Phone number friendly name description |
voiceMethod | Optional | Post or Get |
voiceFallbackUrl | Optional | URL requested if the voice URL is not available |
voiceFallbackMethod | Optional | Post or Get |
hangupCallback | Optional | callback url after a hangup occurs |
hangupCallbackMethod | Optional | Post or Get |
heartbeatUrl | Optional | URL requested once the call connects |
heartbeatMethod | Optional | URL that can be requested every 60 seconds during the call to notify of elapsed time |
smsUrl | Optional | URL requested when an SMS is received |
smsMethod | Optional | Post or Get |
smsFallbackUrl | Optional | URL used if any errors occur during execution of InboundXML from an SMS or at initial request of the SmsUrl. |
smsFallbackMethod | Optional | The HTTP method Ytel will use when URL requested if the SmsUrl is not available. |
Example Usage
var phoneNumber = 'PhoneNumber';
var voiceUrl = 'VoiceUrl';
var friendlyName = 'FriendlyName';
var voiceMethod = 'VoiceMethod';
var voiceFallbackUrl = 'VoiceFallbackUrl';
var voiceFallbackMethod = 'VoiceFallbackMethod';
var hangupCallback = 'HangupCallback';
var hangupCallbackMethod = 'HangupCallbackMethod';
var heartbeatUrl = 'HeartbeatUrl';
var heartbeatMethod = 'HeartbeatMethod';
var smsUrl = 'SmsUrl';
var smsMethod = 'SmsMethod';
var smsFallbackUrl = 'SmsFallbackUrl';
var smsFallbackMethod = 'SmsFallbackMethod';
controller.updateNumber(phoneNumber, voiceUrl, friendlyName, voiceMethod, voiceFallbackUrl, voiceFallbackMethod, hangupCallback, hangupCallbackMethod, heartbeatUrl, heartbeatMethod, smsUrl, smsMethod, smsFallbackUrl, smsFallbackMethod, function(error, response, context) {
});
createViewDetails
Retrieve the details for a phone number by its number.
function createViewDetails(phoneNumber, callback)
Parameters
Parameter | Tags | Description |
---|---|---|
phoneNumber | Required | A valid 10-digit Ytel number (E.164 format). |
Example Usage
var phoneNumber = 'PhoneNumber';
controller.createViewDetails(phoneNumber, function(error, response, context) {
});
createReleaseNumber
Remove a purchased Ytel number from your account.
function createReleaseNumber(phoneNumber, callback)
Parameters
Parameter | Tags | Description |
---|---|---|
phoneNumber | Required | A valid Ytel 10-digit phone number (E.164 format). |
Example Usage
var phoneNumber = 'PhoneNumber';
controller.createReleaseNumber(phoneNumber, function(error, response, context) {
});
createPurchaseNumber
Purchase a phone number to be used with your Ytel account
function createPurchaseNumber(phoneNumber, callback)
Parameters
Parameter | Tags | Description |
---|---|---|
phoneNumber | Required | A valid Ytel 10-digit phone number (E.164 format). |
Example Usage
var phoneNumber = 'PhoneNumber';
controller.createPurchaseNumber(phoneNumber, function(error, response, context) {
});
createGetDIDScore
Get DID Score Number
function createGetDIDScore(phonenumber, callback)
Parameters
Parameter | Tags | Description |
---|---|---|
phonenumber | Required | Specifies the multiple phone numbers for check updated spamscore . |
Example Usage
var phonenumber = 'Phonenumber';
controller.createGetDIDScore(phonenumber, function(error, response, context) {
});
createAvailableNumbers
Retrieve a list of available phone numbers that can be purchased and used for your Ytel account.
function createAvailableNumbers(numbertype, areacode, pagesize, callback)
Parameters
Parameter | Tags | Description |
---|---|---|
numbertype | Required | Number type either SMS,Voice or all |
areacode | Required | Specifies the area code for the returned list of available numbers. Only available for North American numbers. |
pagesize | Optional | The count of objects to return. |
Example Usage
var numbertype = Object.keys(Numbertype1)[0];
var areacode = 'areacode';
var pagesize = 39;
controller.createAvailableNumbers(numbertype, areacode, pagesize, function(error, response, context) {
});
createBulkRelease
Remove a purchased Ytel number from your account.
function createBulkRelease(phoneNumber, callback)
Parameters
Parameter | Tags | Description |
---|---|---|
phoneNumber | Required | A valid Ytel comma separated numbers (E.164 format). |
Example Usage
var phoneNumber = 'PhoneNumber';
controller.createBulkRelease(phoneNumber, function(error, response, context) {
});
CarrierController
Get singleton instance
The singleton instance of the CarrierController
class can be accessed from the API Client.
var controller = lib.CarrierController;
createLookupCarrier
Get the Carrier Lookup
function createLookupCarrier(phoneNumber, callback)
Parameters
Parameter | Tags | Description |
---|---|---|
phoneNumber | Required | A valid 10-digit number (E.164 format). |
Example Usage
var phoneNumber = 'PhoneNumber';
controller.createLookupCarrier(phoneNumber, function(error, response, context) {
});
createCarrierResults
Retrieve a list of carrier lookup objects.
function createCarrierResults(page, pageSize, callback)
Parameters
Parameter | Tags | Description |
---|---|---|
page | Optional | The page count to retrieve from the total results in the collection. Page indexing starts at 1. |
pageSize | Optional | The count of objects to return per page. |
Example Usage
var page = 39;
var pageSize = 39;
controller.createCarrierResults(page, pageSize, function(error, response, context) {
});
DedicatedShortCodeController
Get singleton instance
The singleton instance of the DedicatedShortCodeController
class can be accessed from the API Client.
var controller = lib.DedicatedShortCodeController;
updateShortcode
Update a dedicated shortcode.
function updateShortcode(shortcode, friendlyName, callbackMethod, callbackUrl, fallbackMethod, fallbackUrl, callback)
Parameters
Parameter | Tags | Description |
---|---|---|
shortcode | Required | List of valid dedicated shortcode to your Ytel account. |
friendlyName | Optional | User generated name of the dedicated shortcode. |
callbackMethod | Optional | Specifies the HTTP method used to request the required StatusCallBackUrl once call connects. |
callbackUrl | Optional | URL that can be requested to receive notification when call has ended. A set of default parameters will be sent here once the call is finished. |
fallbackMethod | Optional | Specifies the HTTP method used to request the required FallbackUrl once call connects. |
fallbackUrl | Optional | URL used if any errors occur during execution of InboundXML or at initial request of the required Url provided with the POST. |
Example Usage
var shortcode = 'Shortcode';
var friendlyName = 'FriendlyName';
var callbackMethod = 'CallbackMethod';
var callbackUrl = 'CallbackUrl';
var fallbackMethod = 'FallbackMethod';
var fallbackUrl = 'FallbackUrl';
controller.updateShortcode(shortcode, friendlyName, callbackMethod, callbackUrl, fallbackMethod, fallbackUrl, function(error, response, context) {
});
createListShortcodes
Retrieve a list of Short Code assignment associated with your Ytel account.
function createListShortcodes(shortcode, page, pagesize, callback)
Parameters
Parameter | Tags | Description |
---|---|---|
shortcode | Optional | Only list Short Code Assignment sent from this Short Code |
page | Optional | The page count to retrieve from the total results in the collection. Page indexing starts at 1. |
pagesize | Optional | The count of objects to return per page. |
Example Usage
var shortcode = 'Shortcode';
var page = 'page';
var pagesize = 'pagesize';
controller.createListShortcodes(shortcode, page, pagesize, function(error, response, context) {
});
createListInboundSMS
Retrive a list of inbound Sms Short Code messages associated with your Ytel account.
function createListInboundSMS(page, pagesize, from, shortcode, datecreated, callback)
Parameters
Parameter | Tags | Description |
---|---|---|
page | Optional | The page count to retrieve from the total results in the collection. Page indexing starts at 1. |
pagesize | Optional | Number of individual resources listed in the response per page |
from | Optional | Only list SMS messages sent from this number |
shortcode | Optional | Only list SMS messages sent to Shortcode |
datecreated | Optional | Only list SMS messages sent in the specified date MAKE REQUEST |
Example Usage
var page = 39;
var pagesize = 39;
var from = 'From';
var shortcode = 'Shortcode';
var datecreated = 'Datecreated';
controller.createListInboundSMS(page, pagesize, from, shortcode, datecreated, function(error, response, context) {
});
createViewSMS
Retrieve a single Short Code object by its shortcode assignment.
function createViewSMS(shortcode, callback)
Parameters
Parameter | Tags | Description |
---|---|---|
shortcode | Required | List of valid Dedicated Short Code to your Ytel account |
Example Usage
var shortcode = 'Shortcode';
controller.createViewSMS(shortcode, function(error, response, context) {
});
createListSMS
Retrieve a list of Short Code messages.
function createListSMS(shortcode, to, dateSent, page, pageSize, callback)
Parameters
Parameter | Tags | Description |
---|---|---|
shortcode | Optional | Only list messages sent from this Short Code |
to | Optional | Only list messages sent to this number |
dateSent | Optional | Only list messages sent with the specified date |
page | Optional | The page count to retrieve from the total results in the collection. Page indexing starts at 1. |
pageSize | Optional | The count of objects to return per page. |
Example Usage
var shortcode = 'Shortcode';
var to = 'To';
var dateSent = 'DateSent';
var page = 39;
var pageSize = 39;
controller.createListSMS(shortcode, to, dateSent, page, pageSize, function(error, response, context) {
});
createSendSMS
Send Dedicated Shortcode
function createSendSMS(shortcode, to, body, method, messagestatuscallback, callback)
Parameters
Parameter | Tags | Description |
---|---|---|
shortcode | Required | Your dedicated shortcode |
to | Required | The number to send your SMS to |
body | Required | The body of your message |
method | Optional | Specifies the HTTP method used to request the required URL once the Short Code message is sent.GET or POST |
messagestatuscallback | Optional | URL that can be requested to receive notification when Short Code message was sent. |
Example Usage
var shortcode = 39;
var to = 39.350779552176;
var body = 'body';
var method = 'method';
var messagestatuscallback = 'messagestatuscallback';
controller.createSendSMS(shortcode, to, body, method, messagestatuscallback, function(error, response, context) {
});
createViewSMS1
View a single Sms Short Code message.
function createViewSMS1(messageSid, callback)
Parameters
Parameter | Tags | Description |
---|---|---|
messageSid | Required | The unique identifier for the sms resource |
Example Usage
var messageSid = 'MessageSid';
controller.createViewSMS1(messageSid, function(error, response, context) {
});
SharedShortCodeController
Get singleton instance
The singleton instance of the SharedShortCodeController
class can be accessed from the API Client.
var controller = lib.SharedShortCodeController;
createListShortcodes
Retrieve a list of shortcode assignment associated with your Ytel account.
function createListShortcodes(shortcode, page, pagesize, callback)
Parameters
Parameter | Tags | Description |
---|---|---|
shortcode | Optional | Only list keywords of shortcode |
page | Optional | The page count to retrieve from the total results in the collection. Page indexing starts at 1. |
pagesize | Optional | Number of individual resources listed in the response per page |
Example Usage
var shortcode = 'Shortcode';
var page = 39;
var pagesize = 39;
controller.createListShortcodes(shortcode, page, pagesize, function(error, response, context) {
});
updateShortcode
Update Assignment
function updateShortcode(shortcode, friendlyName, callbackUrl, callbackMethod, fallbackUrl, fallbackUrlMethod, callback)
Parameters
Parameter | Tags | Description |
---|---|---|
shortcode | Required | List of valid shortcode to your Ytel account |
friendlyName | Optional | User generated name of the shortcode |
callbackUrl | Optional | URL that can be requested to receive notification when call has ended. A set of default parameters will be sent here once the call is finished. |
callbackMethod | Optional | Specifies the HTTP method used to request the required StatusCallBackUrl once call connects. |
fallbackUrl | Optional | URL used if any errors occur during execution of InboundXML or at initial request of the required Url provided with the POST. |
fallbackUrlMethod | Optional | Specifies the HTTP method used to request the required FallbackUrl once call connects. |
Example Usage
var shortcode = 'Shortcode';
var friendlyName = 'FriendlyName';
var callbackUrl = 'CallbackUrl';
var callbackMethod = 'CallbackMethod';
var fallbackUrl = 'FallbackUrl';
var fallbackUrlMethod = 'F