Voice Broadcast API

Voice API
Quick Start Guides
Methods
Types
FAQ

GetSoundFileInUlaw

This method retrieves a sound file encoded in μ-law (u-law) format.

Syntax

GetSoundFileInUlaw(SoundFileID, LicenseKey)

Request Parameters

Parameter NameDescriptionData TypeRequiredSample Value
SoundFileIDThe sound file’s ID.StringTruegreeting
LicenseKeyYour license key.StringTrue00000000-0000-0000-0000-000000000000

Response

Returns: GetSoundFileInUlawResponse

Description: The sound file.

Code Samples

You can use any programming language you want with our API, as long as it can make a REST or SOAP call. Here are examples for some of the most common platforms.

C#

/* https://ws.esendex.us/notifyws/phonenotify.asmx?wsdl was added as a Service Reference and given the name WSDL */

using WSDL;

var client = new PhoneNotifySoapClient(PhoneNotifySoapClient.EndpointConfiguration.PhoneNotifySoap);
var soundFileId = "greeting";
var soundFile = await client.GetSoundFileInUlawAsync(soundFileId, YOUR_LICENSE_KEY);

try
{
    var fs = new FileStream(@"C:\Users\Public\greeting.ulaw", FileMode.Create, FileAccess.Write);
    fs.Write(soundFile.GetSoundFileInUlawResult, 0, soundFile.GetSoundFileInUlawResult.Length);
    fs.Close();
    Console.WriteLine("Sound file saved.");
}
catch (Exception ex)
{
    Console.WriteLine(ex);
}

Python

import zeep

client = zeep.Client(wsdl="https://ws.esendex.us/notifyws/phonenotify.asmx?wsdl")
sound_file_id = "greeting"
license_key = "00000000-0000-0000-0000-000000000000"

sound_file = client.service.GetSoundFileInUlaw(sound_file_id, license_key)

with open(r"C:\Users\Public\greeting.ulaw", "wb") as io:
    io.write(sound_file)

GET Request

GET /NotifyWS/PhoneNotify.asmx/GetSoundFileInUlaw?SoundFileID=string&LicenseKey=string HTTP/1.1
Host: ws.esendex.us

POST Request

POST /NotifyWS/PhoneNotify.asmx/GetSoundFileInUlaw HTTP/1.1
Host: ws.esendex.us
Content-Type: application/x-www-form-urlencoded
Content-Length: length

SoundFileID=string&LicenseKey=string

SOAP 1.1 Request

POST /NotifyWS/PhoneNotify.asmx HTTP/1.1
Host: ws.esendex.us
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "https://ws.esendex.us/NotifyWS/GetSoundFileInUlaw"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <GetSoundFileInUlaw xmlns="https://ws.esendex.us/NotifyWS/">
      <SoundFileID>string</SoundFileID>
      <LicenseKey>string</LicenseKey>
    </GetSoundFileInUlaw>
  </soap:Body>
</soap:Envelope>

SOAP 1.1 Response

HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <GetSoundFileInUlawResponse xmlns="https://ws.esendex.us/NotifyWS/">
      <GetSoundFileInUlawResult>base64Binary</GetSoundFileInUlawResult>
    </GetSoundFileInUlawResponse>
  </soap:Body>
</soap:Envelope>

SOAP 1.2 Request

POST /NotifyWS/PhoneNotify.asmx HTTP/1.1
Host: ws.esendex.us
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <GetSoundFileInUlaw xmlns="https://ws.esendex.us/NotifyWS/">
      <SoundFileID>string</SoundFileID>
      <LicenseKey>string</LicenseKey>
    </GetSoundFileInUlaw>
  </soap12:Body>
</soap12:Envelope>

SOAP 1.2 Response

HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <GetSoundFileInUlawResponse xmlns="https://ws.esendex.us/NotifyWS/">
      <GetSoundFileInUlawResult>base64Binary</GetSoundFileInUlawResult>
    </GetSoundFileInUlawResponse>
  </soap12:Body>
</soap12:Envelope>

XML Response

HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<base64Binary xmlns="https://ws.esendex.us/NotifyWS/">base64Binary</base64Binary>
HTTP POSTHTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<base64Binary xmlns="https://ws.esendex.us/NotifyWS/">base64Binary</base64Binary>
HTTP POSTHTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<base64Binary xmlns="https://ws.esendex.us/NotifyWS/">base64Binary</base64Binary>
HTTP POSTHTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<base64Binary xmlns="https://ws.esendex.us/NotifyWS/">base64Binary</base64Binary>
HTTP POSTHTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<base64Binary xmlns="https://ws.esendex.us/NotifyWS/">base64Binary</base64Binary>
HTTP POST

Let’s start sending, together.