SparkJS - When will publishEvent() be available?

I’ve been playing around with SparkJS and I get the error “Permission Denied” when I try to use publishEvent(). I know I’m actually logged in because the function listDevices() works.

I noticed that the documentation (found at http://docs.spark.io/javascript/) states the following for publishEvent(): This feature is in a limited beta, and is not yet generally available.

Is/when will this function be available? Is there another way to publish an event (without using a core)?

Ultimately, I’d like to write an app that subscribes to events published by cores, and can publish events that the cores can subscribe to. I’m just missing the later part.

I tried going straight to the REST API and I get the same results. Here is the cURL command I used:

curl https://api.spark.io/v1/devices/events -d name=brett-test-event -d access_token=1234567...

The response is as follows:

{
  "error": "Permission Denied"
}

At least now I know I’m not using SparkJS incorrectly.

Any help from the guys at Spark when this feature will be accessible? @Dave @zachary

Thanks!

Sorry @brett13! Publishing events into the cloud is still in private beta, we don’t yet have a timeline for release

Hi @zach, I’m building a WebApp to configure and test a product based on the Photon. Do you have any updates on when will ```publishEvent()`` be available?

Thanks!

https://docs.particle.io/reference/javascript/#publishing-event

Should work already :smile:

1 Like

@Moors7 you are absolutely right!! I was getting some errors when calling publishEvent from my Meteor app. After restarting thee server it worked!

Thanks a ton!

1 Like