Coder Social home page Coder Social logo

fydp's Introduction

fydp

Obtain Access Token:

curl https://api.spark.io/oauth/token -u spark:spark -d grant_type=password -d username=[email protected] -d password=Rasberryboat

Example Access Token:

a2f7137f16df99332448d22d8bc866eaaee150ea

Set States to LIGHT or SWITCH

curl https://api.spark.io/v1/devices/53ff6a066667574829572567/setState
-d access_token=a2f7137f16df99332448d22d8bc866eaaee150ea
-d params=LIGHT

curl https://api.spark.io/v1/devices/54ff6c066667515128301467/setState
-d access_token=a2f7137f16df99332448d22d8bc866eaaee150ea
-d params=SWITCH

Assign cores(lights) to a SWITCH core

curl https://api.spark.io/v1/devices/54ff6c066667515128301467/setCores
-d access_token=79c822b771c0432a618a480f0fc01b50842c1b52
-d params=53ff6a066667574829572567

Get the state of a core

curl https://api.spark.io/v1/devices/53ff6a066667574829572567/state?access_token=a2f7137f16df99332448d22d8bc866eaaee150ea

curl https://api.spark.io/v1/devices/54ff6c066667515128301467/state?access_token=a2f7137f16df99332448d22d8bc866eaaee150ea

Get the assigned cores

curl https://api.spark.io/v1/devices/54ff6c066667515128301467/pairedCores?access_token=a2f7137f16df99332448d22d8bc866eaaee150ea

Digital Flip a switch

curl -H "Authorization: Bearer a2f7137f16df99332448d22d8bc866eaaee150ea"
https://api.spark.io/v1/events/flip_switch

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.