Toggle pins using REST API on Local Cloud?(solved)

Hi,i am currently running the local spark server on my mac book and have the spark core connected to local spark server.

now i want to know is it possible to use the spark restful api to make pin on and off, just like using the spark mobile application to click the button and make one IO pin on the spark core on / off.

Yes, this is possible, but - as far as I know - not with the official Spark mobile app.

I’ve extended the Android Spark Tinker app to support local server, tho’

But as there was no call for my version and now with the Spark Mobile SDK, I’ve stopped pursuing this.
On the other hand, there are other ways to do what you asked in other threads on this forum.

Have a search :wink:


Thanks,ScruffR. All I need is just the rest API how to control the pin on and off not the Mobile App.

Are you using this API ?
-d access_token=123412341234
-d params=l1,HIGH

I wonder is -d a parameter or a query?

You can obviously no longer use the address once you’re using the Local :cloud:, and will have to replace that by the address of your server. There are some guides available on the forum which you should be able to find by using search (it works surprisingly well :slight_smile: )


@Moors7 i tested that you cannot have 2 device of the same name in an account :wink:

1 Like

Hi, @kennethlimcp, my local server is working,


here is the response of the server about my core condition:

  "id": "51ff70065082554910410887",
  "name": null,
  "connected": true,
  "variables": {},
  "functions": [

so I tried to give the PIN 7 a digitalwrite on HIGH, this is my http call:

curl -d params=L7,HIGH

It returns me a response:

  "id": "51ff70065082554910410887",
  "name": null,
  "last_app": null,
  "connected": true,
  "return_value": -3

but the LED connected to PIN 7 is not on, is it something wrong with my rest call ?

It should be D7

@kennethlimcpken thanks, it works