Spark-Cloud-API

De MCHobby - Wiki
Sauter à la navigation Sauter à la recherche


MCHobby investit du temps et de l'argent dans la réalisation de traduction et/ou documentation. C'est un travail long et fastidieux réalisé dans l'esprit Open-Source... donc gratuit et librement accessible.
SI vous aimez nos traductions et documentations ALORS aidez nous à en produire plus en achetant vos produits chez MCHobby.

introduction

The Spark Cloud API is a [REST API] (dite "http://fr.wikipedia.org/wiki/Representational_State_Transfer REST API]", wikipedia.fr) . REST means a lot of things, but first and foremost it means that we use the URL in the way that it's intended: as a "Uniform Resource Locator".

In this case, the unique "resource" in question is your Spark Core. Every Spark Core has a URL, which can be used to GET variables, POST a function call, or PUT new firmware. The variables and functions that you have written in your firmware are exposed as subresources within the Spark Core.

All requests to the Spark Core come through our API server using TLS security.

 PROTOCOLE ET HOTE HOST
https://api.spark.io

There are a number of API calls available, which are summarized here, and described in more detail below.

List devices the currently authenticated user has access to.

GET /v1/devices

Get basic information about the given Core, including the custom variables and functions it has exposed.

GET /v1/devices/{DEVICE_ID}

Update the Core, including the display name or the firmware (either binary or source).

PUT /v1/devices/{DEVICE_ID}

Request the current value of a variable exposed by the core, e.g., GET /v1/devices/0123456789abcdef01234567/temperature

GET /v1/devices/{DEVICE_ID}/{VARIABLE}

Call a function exposed by the core, with arguments passed in request body, e.g., POST /v1/devices/0123456789abcdef01234567/brew

POST /v1/devices/{DEVICE_ID}/{FUNCTION}

Open a stream of Server-Sent Events (www.w3.org)

 GET /v1/events[/:event_name]
GET /v1/devices/events[/:event_name]
GET /v1/devices/{DEVICE_ID}/events[/:event_name]

Source: Cloud CODE (API) créé par Spark.IO.

Traduction réalisée par Meurisse D pour MCHobby.be - Translated by Meurisse D. for MCHobby.be

Traduit avec l'autorisation de Spark.IO - Translated with the permission from Spark.IO - Spark.IO

Toute référence, mention ou extrait de cette traduction doit être explicitement accompagné du texte suivant : «  Traduction par MCHobby (www.MCHobby.be) - Vente de kit et composants » avec un lien vers la source (donc cette page) et ce quelque soit le média utilisé.

L'utilisation commercial de la traduction (texte) et/ou réalisation, même partielle, pourrait être soumis à redevance. Dans tous les cas de figures, vous devez également obtenir l'accord du(des) détenteur initial des droits. Celui de MC Hobby s'arrêtant au travail de traduction proprement dit.