REST API: Sending Telegrams

Don't wait for your horse messenger to not deliver your message. Instantly send telegraph communiques, hand-delivered by TaskRabbit.

HTTP POST to Telegrams

To dispatch one of our horses with your telegram, make an HTTP POST request to the Telegrams list resource URI:

/1838-01-11/Accounts/{AccountSid}/Telegrams

POST Parameters

Required Parameters

The following parameters are required in your POST to dispatch a telegram:

ParameterDescription
ToThe name to which you want your telegram delivered.
AddressThe address to which you want your telegram delivered.
FromThe name of the sender of the telegram.
BodyThe communique you'd like to be relayed.
Optional Parameters

You may include the following parameters:

ParameterDescription
HorseTypeValid values are pony and stallion. Delivery time for a telegram delivered by a Twilio Pony is generally 5-6 days, and 3-4 days for a Twilio Stallion. The default is pony.
FeedBeforeDeployThe FeedBeforeDeploy attribute takes the values true and false. If you would like Twilio to feed the horse and rider before deployment to ensure that they are happy and thus more likely to deliver your message, set this attribute's value to true. The default is false.
SingingThe Singing attribute takes a value of 'true' or 'false'. If you would like your courier to vocally harmonize your communique, set this attribute's value to true. Defaults to false.
ArmMessengerThe ArmMessenger attribute takes the values rifle, pistol, hatchet and false. Arming your telegram's messenger can help prevent 504 errors. The default is false.
FillFlaskThe FillFlask attribute takes the values whiskey, xxx, and false. If you fill your messenger's flask, you may increase the chance of a 504 error, but you will reduce the chance of delayed message delivery due to unexpected saloon stops. The default is whiskey.
Resonse Codes
CodeDescription
201Your message has been queued for transcription & dispatch.
304This request is a duplicate. Surely this must be a quip.
400You crazy fool, horses cannot swim.
403You have used language unbecoming of mixed company. You have besmirched the honor of the API.
410Your horse has already been dispatched.
429Hold on to your pantaloons! Our ponies are delivering as fast as they can.
500Your horse rider has contracted typhoid and/or dysentery. Message delivery improbable.
501We are very sorry, but our riders have dignity and are unable to fulfill your request.
502Messengers will not fulfill requests to territories currently engaged in rebellion against this Great Union.
504Bandits or Rustlers have intercepted your messenger, please retry at a later date.

Example

Send a telegram to Watson telling him you'd like to meet:

  • POST /1838-01-11/Accounts/AC5ef87.../Telegrams

    Address=501 Folsom St, San Francisco CA&To=Watson&From=Alex Bell&Body=Come here. I want to see you.

    <TwilioResponse>
        <Telegram>
            <Sid>TM4ea074a2e4b14a10aea42d2e9f8e81a7</Sid>
            <AccountSid>AC5ef87...</AccountSid>
            <Body>Come here STOP I want to see you STOP</Body>
            <Status>sending</Status>
            <Singing>false</Singing>
            <HorseType>pony</HorseType>
            <FeedBeforeDeploy>false</FeedBeforeDeploy>
            <ArmMessenger>false</ArmMessenger>
            <FillFlask>whiskey</FillFlask>
            <Address>
                <City>San Francisco</City>
                <Zip>94105-3101</Zip>
                <House>501</House>
                <State>CA</State>
                <Street>Folsom St</Street>
                <Country>United States</Country>
            </Address>
            <From>Alex Bell</From>
            <To>Watson</To>
            <ApiVersion>1838-01-11</ApiVersion>
            <Price>-2 bits</Price>
            <DateCreated>Thu, 29 Mar 2012 23:45:14 +0000</DateCreated>
            <DateUpdated>Fri, 30 Mar 2012 17:49:19 +0000</DateUpdated>
            <Uri>/1838-01-11/Accounts/AC5ef87.../Telegrams/TM4ea074a2e4b14a10aea42d2e9f8e81a7</Uri>
        </Telegram>
    </TwilioResponse>    
fonts-loaded