External backend returning error. How to debug Cloud Code?

Getting:

 [09:46:23] [Event from Cloud App] [e748fda5] [f5ea3f85ed562fcde4e2110d14c5ff1f]  {"data":{"status":"Error","message":"Device Identifier is not provided"}} 

when sending data from cloud to private server. Does this mean that device_identifier is the key in the json send or is it identifier as in the api documentation and something else is wrong?On the other side on the server I we get

[09:46:23] [Event from Cloud App] [e748fda5] [f5ea3f85ed562fcde4e2110d14c5ff1f]

.He said he changed device_identifier key to identifier and still the same.
I dont have access to the server we use yet and its in unknown language anyways(I build python server that talks to PHP server and we have common mysql DB that doesn’t really matter).

Also that s normal for the IDE cloud event log right?

[11:28:18] [Event from Cloud App] [56bf27e0] [f5ea3f85ed562fcde4e2110d14c5ff1f]

{“data”:{“status”:“Error”,“message”:“Device Identifier is not provided”}}

[11:28:18] [Event from Cloud App] [514a2799] [f5ea3f85ed562fcde4e2110d14c5ff1f]

{“data”:{“status”:“Error”,“message”:“Device Identifier is not provided”}}

[11:28:18] [Event from Cloud App] [ac800a76] [f5ea3f85ed562fcde4e2110d14c5ff1f]

{“data”:{“status”:“Error”,“message”:“Device Identifier is not provided”}}

[11:28:18] [Event from Cloud App] [6778d035] [f5ea3f85ed562fcde4e2110d14c5ff1f]

{“data”:{“status”:“Error”,“message”:“Device Identifier is not provided”}}

[11:28:18] [Event from Cloud App] [226ccb79] [f5ea3f85ed562fcde4e2110d14c5ff1f]

{“data”:{“status”:“Error”,“message”:“Device Identifier is not provided”}}

[11:28:18] [Event from Cloud App] [af028f64] [f5ea3f85ed562fcde4e2110d14c5ff1f]

{“data”:{“status”:“Error”,“message”:“Device Identifier is not provided”}}

[11:28:19] [Event from Cloud App] [005bc15f] [f5ea3f85ed562fcde4e2110d14c5ff1f]

{“data”:{“status”:“Error”,“message”:“Device Identifier is not provided”}}

[11:28:19] [Event from Cloud App] [2875e050] [f5ea3f85ed562fcde4e2110d14c5ff1f]

{“data”:{“status”:“Error”,“message”:“Device Identifier is not provided”}}

[11:28:19] [Event from Cloud App] [91e86744] [f5ea3f85ed562fcde4e2110d14c5ff1f]

{“data”:{“status”:“Error”,“message”:“Device Identifier is not provided”}}

[11:28:19] [Event from Cloud App] [9b8cadfc] [f5ea3f85ed562fcde4e2110d14c5ff1f]

{“data”:{“status”:“Error”,“message”:“Device Identifier is not provided”}}

[11:28:19] [Event from Cloud App] [04394742] [f5ea3f85ed562fcde4e2110d14c5ff1f]

{“data”:{“status”:“Error”,“message”:“Device Identifier is not provided”}}

[11:28:19] [Event from Cloud App] [9a1c26f4] [f5ea3f85ed562fcde4e2110d14c5ff1f]

{“data”:{“status”:“Error”,“message”:“Device Identifier is not provided”}}

[11:28:20] [Event from Cloud App] [7d3e2ba0] [f5ea3f85ed562fcde4e2110d14c5ff1f]

{“data”:{“status”:“Error”,“message”:“Device Identifier is not provided”}}

[11:28:20] [Event from Cloud App] [1da1c420] [f5ea3f85ed562fcde4e2110d14c5ff1f]

{“data”:{“status”:“Error”,“message”:“Device Identifier is not provided”}}

This error comes from external backed that you are using, not from Estimote Cloud. Sharing Cloud Code would be helpful.
You can check what you are sending to and receiving from this backend using simple console.log(...). Here is an simplified example:

const request = require('request-promise');
....
const dataToSend = ...;
console.log("Data to send:" + JSON.stringify(dataToSend))
const result = await request.post('https://example.com/sample_endpoint', {
  json: true,
  body: dataToSend
});
console.log("Data received:" + JSON.stringify(result))

Cloud Code uses popular Node.js modules so you can find plenty of information over the Web. More about request-promise you can find in official documentation (link to it is *Cloud Settings` tab).

1 Like