
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 :
Last update : May 08
This document is intended for programmers who want to write client applications with Nabaztag.
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.
You simply have to call the URL http://api.nabaztag.com/vl/FR/api.jsp with the following parameters :
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
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.
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.
The tempo is expressed in Hz."10" represents a tempo of a tenth of a second.
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
It is a series of values separated by commas.
1. First value : action time (' l'heure ')
("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
To combine the three actions, with the initial tempo parameters :
10,0,motor,1,20,0,0,0,led,2,0,238,0,2,led,1,250,0,0,3,led,2,0,0,0
You can choose the voice that will read your messages.
French voices :
English voices :
To get a complete list of the voices available, call the action #9 (see this section for more details)
The API has gotten a boost in functionality and may now send URLs of MP3 files or feeds to a tag/tag.
This new feature allows you to integrate your applications with MP3, podcast and webradio players. Now you can create application for your exceptionally talented rabbit with streaming audio !
How does it work ?
If you have a tag/tag, you can use the API to send him MP3 hyperlinks to make him play podcasts or webradio.
All you have to do is call or include your application in the URL
http://api.nabaztag.com/vl/FR/api_stream.jsp
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 « | ».
Example- play a webradio station :
http://api.nabaztag.com/vl/FR/api_stream.jsp?token=1267440739&sn= 0013D380FD3C&urlList=http://213.205.96.91:9915
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.
Just as you send events to your Nabaztag, you can retrieve information from your user account or your Nabaztag himself. To do so, call the basis URL (http://api.nabaztag.com/vl/FR/api.jsp?sn=YOURSERIALNUMBERHERE&token=YOURTOKENHERE) and add the "action" parameter with the following values at the end of the URL.
Preview the TTS or music (with music id) without sending it
Sample :
<?xml version="1.0" encoding="UTF-8"?>
<rsp>
<message>LINKPREVIEW</message>
<comment>XXXX</comment>
</rsp>
Get a list of your friends
Sample :
<?xml version="1.0" encoding="UTF-8"?>
<rsp>
<listfriend nb="1"/>
<friend name="toto"/>
</rsp>
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>
Get the timezone in which your Nabaztag is set
Sample :
<?xml version="1.0" encoding="UTF-8"?>
<rsp>
<timezone>(GMT) Greenwich Mean Time : Dublin, Edinburgh, Lisbon, London</timezone>
</rsp>
Get the signature defined for the Nabaztag
Sample :
<?xml version="1.0" encoding="UTF-8"?>
<rsp>
<signature>XXXXX</signature>
</rsp>
Get a count and the list of people in your blacklist
Sample :
<?xml version="1.0" encoding="UTF-8"?>
<rsp>
<blacklist nb="1"/>
<pseudo name="toto"/>
</rsp>
Get to know if the Nabaztag is sleeping (YES) or not (NO)
Sample :
<?xml version="1.0" encoding="UTF-8"?>
<rsp>
<rabbitSleep>YES</rabbitSleep>
</rsp>
Get to know if the Nabaztag is a Nabaztag (V1) or a Nabaztag/tag (V2)
Sample :
<?xml version="1.0" encoding="UTF-8"?>
<rsp>
<rabbitVersion>V1</rabbitVersion>
</rsp>
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>
Get the name of the Nabaztag
Sample :
<?xml version="1.0" encoding="UTF-8"?>
<rsp>
<rabbitName>nabmaster</rabbitName>
</rsp>
Get the languages selected for the Nabaztag
Sample :
<?xml version="1.0" encoding="UTF-8"?>
<rsp><langListUser nb="4"/>
<myLang lang="fr"/>
<myLang lang="us"/>
<myLang lang="uk"/>
<myLang lang="de"/>
</rsp>
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>
Send your Rabbit to sleep
<?xml version="1.0" encoding="UTF-8"?>
<rsp>
<message>COMMANDSENT</message>
<comment>You rabbit will change status</comment>
</rsp>
Wake up your Rabbit
<?xml version="1.0" encoding="UTF-8"?>
<rsp>
<message>COMMANDSENT</message>
<comment>You rabbit will change status</comment>
</rsp>
Too much requests sent :
<?xml version="1.0" encoding="UTF-8"?>
<rsp>
<message>ABUSESENDING</message>
<comment>Too many messages sent in the allowed time try again later please</comment>
</rsp>
Wrong token or serial number :
<?xml version="1.0" encoding="UTF-8"?>
<rsp>
<message>NOGOODTOKENORSERIAL</message>
<comment>Your token or serial number are not correct !</comment>
</rsp>
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>
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>
Message not sent
<?xml version="1.0" encoding="UTF-8"?>
<rsp>
<message>MESSAGENOTSENT</message>
<comment>Your message id is not correct or is private</comment>
</rsp>
TTS message sent
<?xml version="1.0" encoding="UTF-8"?>
<rsp>
<message>TTSSENT</message>
<comment>Your text has been sent</comment>
</rsp>
TTS creation problem
<?xml version="1.0" encoding="UTF-8"?>
<rsp>
<message>TTSNOTSENT</message>
<comment>Your text could not be sent</comment>
</rsp>
Choregraphy message sent
<?xml version="1.0" encoding="UTF-8"?>
<rsp>
<message>CHORSENT</message>
<comment>Your chor 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>
Ears position sent
<?xml version="1.0" encoding="UTF-8"?>
<rsp>
<message>EARPOSITIONSENT</message>
<comment>Your ears command has been sent</comment>
</rsp>
Ears position not sent because the given position is incorrect
<?xml version="1.0" encoding="UTF-8"?>
<rsp>
<message>EARPOSITIONNOTSENT</message>
<comment>Your ears command could not be sent</comment>
</rsp>
Getting the ears position
<?xml version="1.0" encoding="UTF-8"?>
<rsp>
<message>POSITIONEAR</message>
<leftposition>8</leftposition>
<rightposition>10</rightposition>
</rsp>
URL was sent (api_stream)
<?xml version="1.0" encoding="UTF-8"?>
<rsp>
<message>WEBRADIOSENT</message>
<comment>Your webradio has been sent</comment>
</rsp>
URL was not sent (api_stream)
<?xml version="1.0" encoding="UTF-8"?>
<rsp>
<message>WEBRADIONOTSENT</message>
<comment>Your webradio could not be sent</comment>
</rsp>
urlList parameter missing (api_stream)
<?xml version="1.0" encoding="UTF-8"?>
<rsp>
<message>NOCORRECTPARAMETERS</message>
<comment>Please check urlList parameter !</comment>
</rsp>
The rabbit is not a Nabaztag/tag
<?xml version="1.0" encoding="UTF-8"?>
<rsp>
<message>NOTV2RABBIT</message>
<comment>V2 rabbit can use this action</comment>
</rsp>
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