Nabaztag:tag API

From XinCheJian
Jump to navigation Jump to search

The XCJ Nabaztag:tag

For those who don't know anything about the Nabaztag, Nabaztag:tag (also called V2) and the newest model, Karotz, you can find more information here (fr) . To sum up, Nabaztag is a WiFi connected rabbit, with speakers, microphone, RFID reader, and a bunch of RGB leds, plus the ability to move his ears.

Freshly unboxed, he don't really have a loud voice, and being heard in an Hackerspace was a problem. So using a mini jack plug (3,5mm), we plug him to a 2.1 speakers system. He might now be the loudest rabbit of Asia (for the biggest happiness of our neighbours).

And he have a name: Mr Dieu Lapin.

(To make it work, you will need the Serial Number and the Token. For now on, they stay secret between the Staff members of Xinchejian ;) )

API

The original post in french come from here. All credits to those guys and to the French community of rabbits addict ;) :

The unified API Wizz.cc, based on the old Violet model, is made available for Nabaztag & Karotz developpers. It allows Rabbits to communicate freely with each others, regardless the original server of the rabbit.

This API also allows to integrate easily the instant messenging functions, for the Karotz, inside applications and websites.

Example :


Url : http://api.wizz.cc/ Feedback : a text message displaying the result obtained by the API.

Parameters :

Most used Parameters

  • sn : the name of the rabbit. For the Nabz, it's the "serial_number" s/n with 12 characters. 0-9 A-F (counterpart to the MAC address). Ex: 0012345678AE. For the Karotz, it's the name indicated during the configuration of the Live Chat application !


  • token : a confidential code to limit the unwanted sending. For the Nabz, activated or not depending on the selected server... (Please refer to the administration panel of your rabbit on OJN). For the Karotz, it's the token indicated during the configuration of the Live Chat application!


  • server : Only for the Nabz. Since the opening of alternate Nabz servers, it's required to know, despite the s/n, the server's name where the Nabz is hosted. Currently : violet | pixel | alexjd (or nappey) | alfinium | carsso | datagutt | don | htristra | lgnap | lolodu78 | mine | nag | poupou | ticed. However, a central listing exists for Nabaztags, which the API can interrogate to get automatically the name of the rabbit's hosting server (except for Violet server). If this parameter is omitted, then ensure that the Nabaztaf is part of the central directory of OJN servers.


  • Check: For Karotz only. Checks if Karotz is online and available!
     http://api.wizz.cc/?sn=Bunny&token=&check


  • Tts: 'Text-to-speach' The message to read. Do not forget the dot '.' at the end of sentences.
     http://api.wizz.cc/?sn=001234567899&token=&server=pixel&tts=Pizza+del+arte.&voice=it


  • Voice: the voice to use. For Nabaztag, the synthesizing Google service (limited to 100 characters) is used with voices: fr | es | de | it. For the Karotz, the "Karotz" service is used ( without apparent limitation) with the voices: fr | en | de.


  • Ws_kajedo (or voicemp3 for compatibility): Additional voice synthesis to French (limited to 1024 characters). In this case, does not indicate the previous voice parameter.

Voices: bicool | Whisper | darkvadoor | electra | guy_vieux | guy_voix_basse | guy_fort | guy_grave | helium | juliexp | julieEnfant | Loic | granny | matteo | nono | papanoel | philippe | ramboo | Sidoo.

     http://api.wizz.cc/?sn=Bunny&token=12345&tts=Bonjour+bunny.&ws_kajedo=electra


  • Ws_acapela: 50 additionales voices for synthesis for 25 additionals languages​​(limited to 1024 characters). In this case, does not specify the precious voice and ws_kajedo parameters.

Voice: Arabic: Leila - Leila (Female) | Mehdi - Mehdi (Male) | Nizar - Nizar (Male) | Nizareng - Nizar - English (Male) | Salma - Salma (Female) | Yousef - Yousef (Male). Catalan: Laia - Laia (Female). Czech: Eliska - Eliska (Female). Danish: Mette - Mette (Female) | Rasmus - Rasmus (Male). Dutch (B): Jeroen - Jeroen (Male) | Sofie - Sofie (Female) | Zoe - Zoe (Female). Dutch (NL) Daan - Daan (Male) | Femke - Femke (Female) | Jasmijn - Jasmijn (Female) | Max - Max (Male). English (India): Deepa - Deepa (Female). English (UK): Graham - Graham (Male) | Lucy - Lucy (Female) | Peter - Peter (Male) | Rachel - Rachel (Female). English (U.S.): Heather - Heather (Female) | Kenny - Kenny - Child (Male) | Laura - Laura (Female) | Nelly - Nelly - Child (Female) | Ryan - Ryan (Male) | Tracy - Tracy (Female) . Faeroese: Sjurdur - Sjurdur (Male). Finnish: Sanna - Sanna (Female). French: Alice - Alice (Female) | Anthony - Anthony (Male) | Bruno - Bruno (Male) | Claire - Claire (Female) | Julie - Julie (Female) | Margaux - Margaux (Female). French (Canadian): Louise - Louise (Female). German Andreas - Andreas (Male) | Julia - Julia (Female) | Klaus - Klaus (Male) | Sarah - Sarah (Female). Greek: Dimitris - Dimitris (Male). Icelandic: Snorri - Snorri (Male). Italian: Chiara - Chiara (Female) | Fabiana - Fabiana (Female) | Vittorio - Vittorio (Male). Japanese (Q42011): Sakura - Sakura (Female). Norwegian: Bente - Bente (Female) | Kari - Kari (Female) | Olav - Olav (Male). Polish: Ania - Ania (Female). Portuguese: Celia - Celia (Female). Portuguese (Brazil): Marcia - Marcia (Female). Russian: Alyona - Alyona (Female). Spanish: Antonio - Antonio (Male) | Ines - Ines (Female) | Maria - Maria (Female). Spanish (North America): Rosa - Rosa (Female). Swedish Elin - Elin (Female) | Emil - Emil (Male) | Emma - Emma (Female) | Erik - Erik (Male). Swedish (Finland): Samuel - Samuel (Male). Turkish: Ipek - Ipek (Female).

     http://api.wizz.cc/?sn=001234567899&token=&server=pixel&tts=Hello+bunny.&ws_acapela=ryan


  • Noforge (or novoice): Do not forge the synthesis but transfer it directly to the OJN server.
     http://api.wizz.cc/?sn=001234567899&token=&server=pixel&tts=Bonjour+mon+lapin.&noforge


  • Posleft: move the left ear to position 0 to 16. Not applicable for Karotz because his ears are readjusted at the end of each session.
   http://api.wizz.cc/?sn=001234567899&token=&server=pixel&posleft=5&posright=0


  • Posright: move the right rear to position from 0 to 16.


  • UrlList: IPoint to a mp3 file to play. For Nabaztag, ability to specify multiple files mp3, separated by a pipe "|."
    http://api.wizz.cc/?sn=001234567899&token=&server=pixel&urlList=xxx.mp3


  • Chor: Sending a choreography.


  • Action: Send an action.
     http://api.wizz.cc/?sn=001234567899&token=&server=pixel&action=10&strip
     Action = 4 (Timezone) | 7 (Sleep? Yes / no) | 8 (V2) | 10 (Bunny Name) | 13 (Wake-up) | 14 (Go to Bed)


Advanced Parameters

  • Utf8: By default, the API expects raw text and not utf-8. If you encode in utf-8 (utf8_encode ()) then add the parameter &utf8=1 at the end of the url.


  • apiz: If you overload (with a utf8_encode ()) a text apparently already encoded (often from a browser) and that the rendering is not that expected, try adding the parameter &apiz=1 to the end of the url. Otherwise, treat the text input before returning it to the API.




  • Short: Returns only the first part, in text mode, rsp->message replied xml returned by the API:
     Code:
     <rsp> <message> EARPOSITIONSENT </message> Your ears <comment> command has-beens feel </comment> </rsp>


  • Noxml: Transform the xml response returned by the API in text mode. Different from strip, because it's only focused here on rsp->message and rsp->comment.

Notes

Many foreign voices are tested regularly as well as new (web) synthetizing services ... They appears little by little. Other services can also be disabled ... These synthesizing services are not fully guaranteed in the (very) long term, the licenses being "trial" for now on. They are however replaced following developments, needs ... and means.

Generally, it's the API that forge the synthesis, not the OJN server. Which allows to add many voices or variations without affecting the configuration of each server in place ...

If no voice is switched to parameter OR a voice does not exist OR the synthesis is not carried out correctly, then the text is transferred directly to the OJN server as with the parameter noforge.


Additional functions:


About

I haven't found any translation of the API for our dear english-speaking friends, so I thought it would be a good idea to publish my translation of the API on the wiki. Fellow english speaking people, please feel free to correct my mistakes, they might be numerous :) Valentin.