3

I want to create a scene using the Hue Java SDK. This is the code I am using:

mHueSDK.getSelectedBridge().saveScene(scene, ...);

It does not work, it gives an error. This is the output in onError(...):

method, PUT, not available for resource, /scenes

Why doesn't this work?

Thanks for any help.

Thomas Vos
  • 12,271
  • 5
  • 33
  • 71

1 Answers1

1

PUT is for updating an existing scene. POST is for creating a new scene.

Since saveScene(...) is used to both create new scenes AND to update existing scenes, my guess is that since you got a PUT error, the scene you created is missing some required data, so its trying to do an update PUT instead of a create POST.

Ron Reuter
  • 1,287
  • 1
  • 8
  • 14
  • I guess - he did not post source code - he missed setting an identifier. But then... see my answer below. – chksr Dec 05 '17 at 18:38