Using our API allows you to activate, from a third application, an event on your Nabaztag. For example: controlling the movement of the ears, commanding the LEDs, sending messages in TTS (text to speach) or with a Nabcast. Here are some of the things you can do with the Nabaztag API :
Send text messages to a rabbit Send choregraphies to a rabbit Send any nabcast to a rabbit Get the ear position of a rabbit Stream MP3 to your Nabaztag/tag (webradio, podcast or personal music) Retrieve information about the status of the rabbit and the account
Contents
Audience Activate reception of event on your Nabaztag How to send an event to a Nabaztag Choregraphy Language
r
1. Tempo command 2. Ear commands 3. LED commands 4. Combination of ear and LED commands 5. Choosing the voice for the TTS
Sending an URL to a Nabaztag/tag to get streaming audio Retrieving info from your Nabaztag Understanding return messages from the Nabaztag API Feedback
Audience
This document is intended for programmers who want to write client applications with Nabaztag.
Top
Top
Nabaztag API
2. Check 'Authorize the reception of external events', then OK. 3. The token is displayed
Please write down and save your token and serial number, as you must use it to send messages from your application. Note : If you deactivate and reactivate events, a new token will be sent to you.
Top
The token is a series of digits given when you activate the Nabaztag receiver. This extra identification limits the risks of spam, since, in order to send a message, you need to know both the serial number and the token The number of the message to send. This number can refer to a message in the Library or a personal MP3 file that you have downloaded. You find this identification number under the title of the track you are listening to Id of your nabcast (if you want to publish a content in your nabcast) Title of the post in your nabcast Position of the right ear between 0 and 16 (0 = ear vertical) Position of the left ear between 0 and 16 (0 = ear vertical) Send the position of the ears to your Nabaztag This is your application ID. It will allow you to authenticate the event's transmitter. This parameter is not yet in service. Allows you to choose the voice that will read the message Allows you to send a text configured for speech synthesis Sending a choreography to your Nabaztag The name of the choreography Allows you to define the length of time you want a message to remain on the site (in seconds). By default, the message will be stored for a period of two months See below for information on this parameter
idmessage
action
For example :
http://api.nabaztag.com/vl/FR/api. jsp?sn=00039D4022DE&token=112231049046144&posleft=0&posright=0&idmessage=10333&idapp=10
How do you send a message in text-to-speech (TTS) within a Nabcast that has the ID 52 with the title : myttsinmynabcast ?
http://api.nabaztag.com/vl/FR/api.jsp?.......nabcast=52&nabcasttitle=myttsinmynabcast&tts=the+nabcast
Nabaztag API
How do you send the message 10333 within the Nabcast with the ID 52 and a sound title of : mymp3inmynabcast ?
http://api.nabaztag.com/vl/FR/api.jsp? ....nabcast=52&nabcasttitle=mymp3inmynabcast&idmessage=10333
Please note that messages sent through the API have a lifetime of one day. Meaning they will be visible in your Nabaztag account and you will be able to replay them during one day.
Choregraphy Language
A choreography is a series of actions that you command the LEDs and ears to perform. The choreography's main parameter is an adjustable tempo. Once the tempo is set, actions will be sequenced to that rhythm. Each action is run at a precise moment, called "l'heure" (time) of the action : This time is expressed by the number of beats that have elapsed from the beginning of the choreography to the desired event. For example, with a tenth of a second tempo, the action associated with "l'heure" (time) '10' will happen a second after the beginning of the choreography. The action associated with "l'heure" '25' will happen 2.5 seconds after the beginning of the choreography... The choreography's syntax is a series of words or numbers, separated by commas. The numbers are always positive integers, expressed on a basis of 1 to 10. Words are one of two keywords : "motor" or "led". This series begins with the tempo value, and then continues on with a succession of motor or led actions. Each action (motor or led) begins with "l'heure" (time) (expressed by the number of beats that have elapsed from the beginning of the choreography to the desired event), followed by the command (motor or led), and a set of variables which describe the action. If two actions are commanded at the same time they will be carried out at the same time.
Top
1. Tempo command
The tempo is expressed in Hz."10" represents a tempo of a tenth of a second.
Top
2. Ears commands
This is a series of values separated by commas. The command is as follows : 1. First value : Action time (l'heure) "0" if it is the first command. 2. Second value : 'motor', to move an ear 3. Third value : Ears command 1 to command left ear 0 to command right ear 4. Fourth value : Angle of ear Possible value from 0 to 180 5. Fifth value : Unused, set at "0" 6. Sixth value : Rotation of the ears directions 1 : high->back->low->front->high... 0 : high->front->low->back->high... Example of a command that makes the left ear turn counter clockwise with a 20 angle, at l'heure (time) "0"
0,motor,1,20,0,0
Top
3. LED commands
It is a series of values separated by commas. 1. First value : action time (' l'heure ')
http://doc.nabaztag.com/api/home.html (3 de 9) [08/01/2009 19:52:25]
Top
Nabaztag API
("0" if it is the first command). 2. Second value : 'led' , which gives a color to the LED. 3. Third value : To define which LED you want to illuminate. 0 : bottom LED 1 : rabbit's left LED 2 : middle LED 3 : rabbit's right LED 4 : high LED 4. Fourth, Fifth, Sixth value : the color in RGB. Value from 0 to 255 Example : to make the middle LED go green, then the left one go red then the middle one turn off
0,led,2,0,238,0,2,led,1,250,0,0,3,led,2,0,0,0
Top
Top
English voices :
To get a complete list of the voices available, call the action #9 (see this section for more details)
Top
with the following settings : token : The token is a series of digits given when you activate Nabaztag's reception of external events. This identification limits the risk of spam since you must know the serial number and the token to send a message. sn : Serial number of the Nabaztag/tag that's going to receive the URLs urlList : URL address of the MP3 file that you want your Nabaztag/tag to read. If you wish to play several MP3 files in a row, you can can seperate them with this character | .
http://doc.nabaztag.com/api/home.html (4 de 9) [08/01/2009 19:52:25]
Nabaztag API
If the MP3 feed is available, your tag/tag will play it. To play several mp3 streams, you must separate each URL with the character | .
http://api.nabaztag.com/vl/FR/api_stream.jsp?token=1267440739&sn= 0013D380FD3C &urlList=http://my.server.org/ music.mp3|http://m.server.org/music2.mp3
To understand the return messages from the api_stream.jsp, please refer to this section.
Top
action=2
action=3
Get a count and the list of the messages in your inbox Sample :
<?xml version="1.0" encoding="UTF-8"?> <rsp> <listreceivedmsg nb="1"/> <msg from="toto" title="my message" date="today 11:59" url="broad/001/948.mp3"/> </rsp>
action=4
action=5
Nabaztag API
action=6
action=7
action=8
action=9
Get a list of all supported languages/voices for TTS (text to speach) engine Sample :
<?xml version="1.0" encoding="UTF-8"?> <rsp> <voiceListTTS nb="2"/> <voice lang="fr" command="FR-Anastasie"/> <voice lang="de" command="DE-Otto"/> </rsp>
action=10
action=11
Nabaztag API
action=12
Get a preview of a message. This works only with the urlPlay parameter and URLs like broad/001/076/801/262.mp3 Sample :
<?xml version="1.0" encoding="UTF-8"?> <rsp> <message>LINKPREVIEW</message> <comment>XXXX</comment> </rsp>
action=13
action=14
Top
Wrong music id (either not in your personal MP3s list or not existing)
<?xml version="1.0" encoding="UTF-8"?> <rsp> <message>MESSAGENOTSENT</message> <comment>Your message id is not correct or is private</comment> </rsp>
Nabcast not posted because music id is not part of your personal MP3s or the nabcast does not exist
<?xml version="1.0" encoding="UTF-8"?> <rsp> <message>NABCASTNOTSENT</message> <comment>Your nabcast id is not correct or is private</comment> </rsp>
Nabaztag API
Nabcast posted
<?xml version="1.0" encoding="UTF-8"?> <rsp> <message>NABCASTSENT</message> <comment>Your nabcast has been sent</comment> </rsp>
Message sent
<?xml version="1.0" encoding="UTF-8"?> <rsp> <message>MESSAGESENT</message> <comment>Your message has been sent</comment> </rsp>
Choregraphy message not sent because the "chor" command was incorrect
<?xml version="1.0" encoding="UTF-8"?> <rsp> <message>CHORNOTSENT</message> <comment>Your chor could not be sent (bad chor)</comment> </rsp>
Nabaztag API
Feedback
If you have questions, remarks, suggestions regarding the Nabaztag API or if you developped a nice application and want to submit it to us (so that we can promote you on our website), contact us at api [at] violet.net Navigation
Contents Activate reception of events How do I send an event? Choregraphy language - Stream a URL to Nabaztag/tag - Retrieving info from your Nabaztag - Understanding answers from the API
Top
Learn more
www.nabaztag.com my.nabaztag.com help.nabaztag.com