MENU
CallFire - Your Message Delivered
CLOSE
  • Products
  • Pricing
  • Developers
  • Help
  • Log In
  • Sign Up

CreateSound

CallFire has a new API!

We are proud to announce the launch of our API 2.0! Learn more about our streamlined, transactional and broadcast APIs. This version of the API documentation will remain available for reference only. There will be no new development, only bug fixes. We highly recommend upgrading to our newer and more sophisticated documentation.

CallFire-API-Documentation

  • ▶/BroadcastService
    • CreateBroadcast
    • QueryBroadcasts
    • GetBroadcast
    • UpdateBroadcast
    • GetBroadcastStats
    • ControlBroadcast
    • CreateContactBatch
    • QueryContactBatches
    • GetContactBatch
    • ControlContactBatch
    • CreateBroadcastSchedule
    • QueryBroadcastSchedule
    • GetBroadcastSchedule
    • DeleteBroadcastSchedule
  • ▶/SubscriptionService
    • CreateSubscription
    • QuerySubscriptions
    • GetSubscription
    • UpdateSubscription
    • DeleteSubscription
  • ▶/TextService
    • SendText
    • QueryTexts
    • GetText
    • CreateAutoReply
    • QueryAutoReplies
    • GetAutoReply
    • DeleteAutoReply
  • ▶/CallService
    • SendCall
    • QueryCalls
    • GetCall
    • CreateSound
    • QuerySoundMeta
    • GetSoundMeta
    • GetSoundData
    • GetRecordingData
    • SendVerificationCodeToCallerId
    • VerifyCallerId
    • GetCallerIds
  • ▶/CccService
    • GetCccCampaign
    • GetCccCampaignStats
    • CreateCccCampaign
    • QueryCccCampaigns
    • UpdateCccCampaign
    • DeleteCccCampaignTransferNumbers
    • DeleteCccCampaignQuestions
    • ControlCccCampaign
    • DeleteCccCampaign
    • GetAgent
    • QueryAgents
    • AddAgents
    • GetAgents
    • RemoveAgent
    • GetAgentGroup
    • QueryAgentGroups
    • CreateAgentGroup
    • UpdateAgentGroup
    • AddAgentGroups
    • GetAgentGroups
    • DeleteAgentGroup
    • RemoveAgentGroup
    • GetAgentSession
    • QueryAgentSessions
    • SendAgentInvites
    • GetAgentInviteUri
  • ▶/ContactService
    • QueryContacts
    • UpdateContacts
    • RemoveContacts
    • GetContact
    • GetContactHistory
    • CreateContactList
    • QueryContactLists
    • DeleteContactList
    • AddContactsToList
    • GetContactList
    • RemoveContactsFromList
    • QueryDncNumbers
    • UpdateDncNumber
    • QueryDncLists
    • CreateDncList
    • GetDncList
    • DeleteDncList
    • AddNumbersToDncList
    • RemoveNumbersFromDncList
  • ▶/NumberService
    • QueryRegions
    • QueryNumbers
    • GetNumber
    • ConfigureNumber
    • SearchAvailableNumbers
    • QueryKeywords
    • SearchAvailableKeywords
    • CreateNumberOrder
    • GetNumberOrder
    • Release
  • ▶/LabelService
    • DeleteLabel
    • QueryLabels
    • LabelBroadcast
    • UnlabelBroadcast
    • LabelNumber
    • UnlabelNumber
  • API    >  
  • CallService  >  
  • CreateSound

CreateSound

Creates a new CallFire-hosted sound for use in calls.

There are two ways to create a sound: (1) uploading a pre-recorded WAV or MP3, or (2) initiating a call to record a sound over the phone.

Duplicate uploads are not allowed. If a duplicate sound data are provided, a new sound is not created. Instead, the ID of the previous sound is returned.

Recording a sound over the phone works by first creating a sound asset using the RecordingCall option, then call the ToNumber to record live voice as sound. If sound is created using RecordingCall then need to wait for sound to be active by calling GetSoundMeta until Status = 'ACTIVE'.

Use the returned soundId in a subsequent SendCall request.

Request Parameters

Parameter Demo Value Description Data Type
CreateSound Create Sound using attached info object
Name The name of your sound. This name is included in SoundMeta and shown in the web interface. string
Data * MP3 or WAV bytes. Base64 encoded bytes can be provided inline. Capable clients can avoid the 33% encoding overhead by sending the data as an MTOM attachement base64Binary
RecordingCall * Initiates a call to record a new sound over the phone. object
ToNumber E.164 11 digit number to call to record a new sound. List[PhoneNumber]
SoundText * string
SoundTextVoice Voice

* indicates choice value, bolded parameters are required

Response Parameters

Parameter Description Data Type
CreatedId Unique ID of resource long

 

Example Code

	<?php
/**
 * You'll need your login/password pair when you create the SOAP client.
 * Don't use the fake login/password provided here; it's just for show and
 * won't work.
 */
$wsdl = "http://callfire.com/api/1.1/wsdl/callfire-service-http-soap12.wsdl";
$client = new SoapClient($wsdl, array(
    'soap_version' => SOAP_1_2,
    'login'        => 'YourLoginId',    
    'password'     => 'YourPassword'));


/**
 * CreateSound. Two ways to create sound; 1.) Upload a mp3 soundfile for later use 
 * in ivr campaign or call, 2.) Call number specified in RecordingCall option
 * to record live voice.
 */
//
// Create sound using mp3 file.
//
$request = new stdclass();
$request->Name = 'My API Test Sound'; // string
$request->Data = file_get_contents('test-sound.mp3'); // base64Binary required

$soundId = $client->CreateSound($request);
echo "Sound ID: $soundId\n";

// Sample response: 9

//
// Create sound by calling phone number specified in RecordingCall option.
//
$request = new stdClass();
$request->Name = 'My API Test Sound by Recording Call'; // string
$request->RecordingCall = new stdClass(); // object
$request->RecordingCall->ToNumber = '13105551212'; // object

$soundId = $client->CreateSound($request);
echo "Sound ID: $soundId\n";

// Sample response: 10

?>

Company

  • Careers
  • Blog
  • Press

Products

  • Text Messaging
  • Call Tracking
  • Voice Broadcast
  • CallFire IVR
  • Developer API

Resources

  • Case Studies
  • Industries
  • Communications Glossary
  • Marketing Glossary
  • Area Codes
  • Labs

Help

  • FAQs
  • CallFire XML
  • Contact Support
  • Reviews
  • System Status

© Copyright 2023 CallFire Inc. All Rights Reserved

Privacy Policy / Terms / Service Policy / FTC/FCC/DNC Compliance / Sitemap

Contact Support

Msg&data rates may apply in the US. Standard message and data rates apply in Canada. To unsubscribe from any CallFire ® list simply send 'STOP' to the originating short code or contact Support.