|
|
||||
| A A A | ||||
Le coin des développeurs
SparkAngels publie ses APIs pour une meilleure intégration de son service au sein des applications Web.
L'API SparkAngels offre la possibilité d'intégrer la mise en relation SparkAngels au sein même d'une application web en exploitant l'identification existante sur cette application web pour éviter l'échange d'un code d'autorisation de session nécessaire à l'identification des deux parties.
Ainsi, le télé-accompagnement pourra simplement être activé par les boutons "Clic-for-help" et "Clic-to-help".
Pour obtenir un code d'authentification pour déployer l'API SparkAngels vous devez créer un compte et faire la demande dans la page de votre profil.
Les boutons de droite donnent accès aux spécifications, à un démonstrateur de fonctionnement et à une aide qui vous génère le script HTML pour votre implémentation de l'API.
Document Revision: 4 - Diffusion: External
The SparkAngels API is a Web-invocation API that allows to start a SparkAngels session from third-party Web applications.
The overall principle is that the Web application will generate two URLs, one for the Helper, the other for the Helpee. When these URLs are opened by the client browsers, SparkAngels will be installed and started, and will initiate a SparkAngels session between the Helper (the one who views the Helpee's screen) and the Helpee (after he accepts a confirmation dialog).
The current version of SAPI is: Version 2.
The SAPI messages are encoded in the URL that invokes the SparkAngels service.
The URL structure is as follows :
http://dnld0.sparkom.com/sparkangels/sangels/sparkangels.jnlp?sapi2=SAPI2_VALUE
where :
SAPI2_VALUE=(UrlEncoded SAPI-2 parameters)where :
SAPI-2 parameters is a sequence of prmXvalueX attributes, separated by the ',' character.
The resulting sequence is UrlEncoded (encoded in application/x-www-form-urlencoded format, using the recommended encoding UTF-8 - In Javascript, the encodeURIComponent method should be used, rather than escape). This ensures that the resulting SAPI2_VALUE can be used as an URL component. Some parameter values are UrlEncoded before inserting them in the sequence.
The "x" (XRef) parameter should only contain '0'-'9', 'A'-'Z', 'a'-'z', '-', '_'.
Recognized Parameters :
a : Authentication - Value is the Authentication Code provided by Sparkom to enable the use of SAPI-2 for a specific Web Application; Mandatory
v : Version - Value must be "2" (user of SparkAngels API Version 2); Mandatory
c : Command - Value must be: 'S'; Mandatory
r : Role - Must be 'r' for Helper or 'e' for Helpee; Mandatory
x : Cross-Reference - Allows the association between the Helper and the Helpee and must be the same in the Helper and Helpee URLs; Mandatory
u : User Name - Allows to convey the UrlEncoded "name" of the helper party. It is the name that will be displayed to the Helpee, in the Confirmation Dialog presented at session startup; Mandatory
s : Startup Service Type - Must be 'l', followed by one or several services (ex. slcp for both Chat and PMAD Control services launched): 'c' for chat or 'p' for pmadctrl or 'v' for pmadview; At least one service must be present, and the 'p' and 'v' services are incompatible.
Sample URLs :
- For the Helper named "John -,Doe" :
http://dnld0.sparkom.com/sparkangels/sangels/sparkangels.jnlp?sapi2=aMyAuthCode%2Cv2%2CcS%2Crr%2CxeZRX8_t43s%2CuJohn%2B-%252CDoe%2Csv
- For the Helpee :
http://dnld0.sparkom.com/sparkangels/sangels/sparkangels.jnlp?sapi2=aMyAuthCode%2Cv2%2CcS%2Cre%2CxeZRX8_t43s%2CuJohn%2B-%252CDoe%2Csv
Sample JavaScript code to create it :
var auth = MyAuthCode;
var role = "r"; // 'r' for Helper, 'e' for Helpee
var xref = ....; // Some random value, containing only '0'-'9', 'A'-'Z', 'a'-'z', '-', '_'
var helperName = encodeURIComponent("John -,Doe");
var serviceType = "v"; // 'c' for Chat, 'v' for Screen Sharing (view), 'p' for Computer Sharing (control)
var sapiValue = "a" + auth + ",v2,cS,r" + role + ",x" + xref + ",u" + helperName + ",s" + serviceType;
var sapiUrl = "http://dnld0.sparkom.com/sparkangels/sangels/sparkangels.jnlp?sapi2=" + encodeURIComponent(sapiValue);
SparkAngels will start on both sides.
The Helpee will get a Confirmation dialog asking if he accept to have his screen viewed by "Helper Name". Following acceptation, the Helper and the Helpee will be in a SparkAngels session, as if they had manually started SparkAngels and exchanged the session confidential code.
The Cross-Reference parameter is what allows the association between the Helper and the Helpee. It is allocated by the Web Application and must be unique within the Web Application, as identified by the AUTHCODE. It needs not be unique in time, but the same xref should not be reallocated within some time interval (at least 1 hour) after the session ends.
To start a new session between two clients, even if they had been in session before, a SAPI URL must be loaded again by their browsers. Starting SparkAngels from the Desktop or Startup Menu shortcuts will not re-establish the session.
If the MyAuthCode is not recognized, or the SAPI2_VALUE has an invalid structure, an HTTP 404 (file not found) exception is returned.
If there are unrecognized parameters, SparkAngels will start but not setup the session. An error indication may be presented to the user.
The SparkAngels application is a "Java Web Start" application, thus the client browser must be able to start a WebStart application automatically. This implies the following requirements :
To ensure these requirements, the Web Application may provide detection code similar to SparkAngel's web code, to help the user install Java.
| Ouvrez cette page sur deux ordinateurs différents et entrez le même code dans le champs suivant : |
Puis, sur l'un d'entre eux, cliquez sur le bouton "Accompagnateur SparkAngels" et sur l'autre cliquez sur le bouton "Accompagné(e) SparkAngels", vous observerez alors l'ouverture d'une session SparkAngels entre les deux ordinateurs.
![]() | ![]() |
Attention : Pour déployer l'API SparkAngels dans votre application Web il est impératif d'obtenir votre code d'authentification de l'application Web afin de garantir l'unicité de la mise en relation. Pour obtenir ce code, vous devez créer un compte et cliquer sur la demande de code API dans la page de votre profil.
| Pour un test limité vous pouvez utiliser ce code : |
Pour déployer, obtenez votre code d'authentification.
| Pour un test limité vous pouvez introduire votre propre code en respectant les spécifications de l'API : |
Pour déployer, ce code doit être généré par votre application Web forum.
| Pour un test limité vous pouvez introduire votre pseudo en respectant les spécifications de l'API : |
Pour déployer, ce code doit être généré par votre application Web forum.
| URL du bouton "Accompagnateur" : | |
| URL du bouton "Accompagné(e)" : |
Vous allez intégrer le service SparkAngels au sein de votre application Web et vous souhaitez offrir un bouton sans équivoque à l'accompagnateur pour ouvrir une session de télé-accompagnement par simple clic. Vous pouvez utiliser le bouton suivant pour votre service "Click-to-help".
Insérez un des 2 codes ci-dessous dans la page de l'accompagnateur en y introduisant l'URL décrite dans l'API SparkAngels :


Vous allez intégrer le service SparkAngels au sein de votre application Web et vous souhaitez offrir un bouton sans équivoque à l'accompagné(e) pour ouvrir une session de télé-accompagnement par simple clic. Vous pouvez utiliser le bouton suivant pour votre service "Click-to-help".
Insérez un des 2 codes ci-dessous dans la page de l'accompagné(e) en y introduisant l'URL décrite dans l'API SparkAngels :


| Home | Start | Account | What use it for? | Offers | Partners | Legal information | Forum | Contact |