Modifications

Sauter à la navigation Sauter à la recherche
786 octets ajoutés ,  7 janvier 2015 à 07:11
Ligne 58 : Ligne 58 :     
=== 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.
 +
 +
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. In the POST body, you need three parameters:
 +
* grant_type=password
 +
* username=YOUR_EMAIL@ADDRE.SS
 +
* password=YOUR_PASSWORD
 +
 +
<nowiki># Using curl in your terminal
 +
curl https://api.spark.io/oauth/token -u spark:spark \
 +
    -d grant_type=password -d username=joe@example.com -d password=SuperSecret
 +
 +
# A typical JSON response will look like this
 +
{
 +
    "access_token": "254406f79c1999af65a7df4388971354f85cfee9",
 +
    "token_type": "bearer",
 +
    "expires_in": 7776000
 +
}</nowiki>
 +
For now, Spark Build will list the single most recently created token.
 +
    
{{traduction}}
 
{{traduction}}
    
{{Spark.IO-Could-API-TRAILER}}
 
{{Spark.IO-Could-API-TRAILER}}
29 917

modifications

Menu de navigation