Modifications

Sauter à la navigation Sauter à la recherche
162 octets ajoutés ,  8 janvier 2015 à 12:30
Ligne 70 : Ligne 70 :  
=== Générer un nouvel access_token ===
 
=== Générer un nouvel access_token ===
   −
When creating a new access token, you need to specify several additional pieces of info.
+
Lorsque vous créez un nouvel access token, vous devez spécifier plusieurs informations complémentaires.
    
  POST /oauth/token
 
  POST /oauth/token
   −
You must give a valid client ID and password in HTTP Basic Auth. Any client ID will work right now, so we suggest '''spark:spark''' (''utilisateur:mot_de_passe''). In the POST body, you need three parameters:
+
Vous devez fournir un ''client ID'' et un mot de passe valide dans l'entête d’authentification HTTP (HTTP Basic Auth). N'importe quel ''Client ID'' fonctionnera pour le moment, Spark suggère d'utiliser '''spark:spark''' (''utilisateur:mot_de_passe''). Dans le corps de la requête, vous aurez besoin de trois paramètres:
* grant_type=password
+
* grant_type=password  
* username=YOUR_EMAIL@ADDRE.SS
+
* username=VOTRE_EMAIL@ADRES.SE
* password=YOUR_PASSWORD
+
* password=VOTRE_MOT_DE_PASSE
   −
  <nowiki># Using curl in your terminal
+
  <nowiki># En utilisant Curl en ligne de commande
 
curl https://api.spark.io/oauth/token -u spark:spark \
 
curl https://api.spark.io/oauth/token -u spark:spark \
 
     -d grant_type=password -d username=joe@example.com -d password=SuperSecret
 
     -d grant_type=password -d username=joe@example.com -d password=SuperSecret
   −
# A typical JSON response will look like this
+
# Exemple typique de réponse JSON:
 
{
 
{
 
     "access_token": "254406f79c1999af65a7df4388971354f85cfee9",
 
     "access_token": "254406f79c1999af65a7df4388971354f85cfee9",
Ligne 89 : Ligne 89 :  
     "expires_in": 7776000
 
     "expires_in": 7776000
 
}</nowiki>
 
}</nowiki>
For now, Spark Build will list the single most recently created token.
+
 
 +
A partir de maintenant, Spark Build affichera le dernier token créé (le plus récent).
    
=== Lister tous vos tokens ===
 
=== Lister tous vos tokens ===
29 918

modifications

Menu de navigation