I'm new to cumulocity application development. Now I'm learning to use Smart App Toolkit to develop HTML5 application.
I could create device in my Tenant, and could run some operations with servces provided in the SDK. However, I failed to create operation with c8yDeviceControl.create()
. I got 400 (bad request) error code
after the operation, and if I look deeper with chrome develop tool, it shows
{error: "Failed to parse JSON string"},
Here is my code, which I pick up from the Smart SDK sample code, with modifition to reference my deviceId
:
var operation = {
deviceId: 12111,
com_cumulocity_model_WebCamDevice: {
name: 'take picture',
parameters: {
duration: '5s',
quality: 'HD'
}
}
};
c8yDeviceControl.create(operation);
Could anyone provide me a help to fix this problem?
Thanks.