Update data via Web API

I install thèse code from
https://flowerpowerdev.parrot.com/boards/1/topics/52
There are two nodeJS project that can help you achieve what you want to do :
The first one is working…( to take the data from flower-plant).
To the second one to upload the to Web it is not working…
I have thèse error:

"sudo node /home/pi/node_modules/flower-power-cloud/test.js
/sensor_data/v2/sample/location/JeCraIuXHB2799401794?from_datetime_utc=undefined
{ event: 'json',
  diagnostic: 'Unexpected token <',
  body: '<!DOCTYPE html>\n<html>\n<head>\n  <title>We\'re sorry, but something went wrong (500)</title>\n  <style type="text/css">\n    body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }\n    div.dialog {\n      width: 25em;\n      padding: 0 4em;\n      margin: 4em auto 0 auto;\n      border: 1px solid #ccc;\n      border-right-color: #999;\n      border-bottom-color: #999;\n    }\n    h1 { font-size: 100%; color: #f00; line-height: 1.5em; }\n  </style>\n</head>\n\n<body>\n  <!-- This file lives in public/500.html -->\n  <div class="dialog">\n    <h1>We\'re sorry, but something went wrong.</h1>\n  </div>\n</body>\n</html>\n' }
invoke
{ event: 'sync', diagnostic: 'Unexpected token <' }
/sensor_data/v2/sample/location/OIbnDpYmVz1411304863?from_datetime_utc=undefined
{ event: 'json',
  diagnostic: 'Unexpected token <',
  body: '<!DOCTYPE html>\n<html>\n<head>\n  <title>We\'re sorry, but something went wrong (500)</title>\n  <style type="text/css">\n    body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }\n    div.dialog {\n      width: 25em;\n      padding: 0 4em;\n      margin: 4em auto 0 auto;\n      border: 1px solid #ccc;\n      border-right-color: #999;\n      border-bottom-color: #999;\n    }\n    h1 { font-size: 100%; color: #f00; line-height: 1.5em; }\n  </style>\n</head>\n\n<body>\n  <!-- This file lives in public/500.html -->\n  <div class="dialog">\n    <h1>We\'re sorry, but something went wrong.</h1>\n  </div>\n</body>\n</html>\n' }
invoke
{ event: 'sync', diagnostic: 'Unexpected token <' }
/sensor_data/v2/sample/location/1eyGRFfUkH1410718171?from_datetime_utc=undefined
{ event: 'json',
  diagnostic: 'Unexpected token <',
  body: '<!DOCTYPE html>\n<html>\n<head>\n  <title>We\'re sorry, but something went wrong (500)</title>\n  <style type="text/css">\n    body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }\n    div.dialog {\n      width: 25em;\n      padding: 0 4em;\n      margin: 4em auto 0 auto;\n      border: 1px solid #ccc;\n      border-right-color: #999;\n      border-bottom-color: #999;\n    }\n    h1 { font-size: 100%; color: #f00; line-height: 1.5em; }\n  </style>\n</head>\n\n<body>\n  <!-- This file lives in public/500.html -->\n  <div class="dialog">\n    <h1>We\'re sorry, but something went wrong.</h1>\n  </div>\n</body>\n</html>\n' }
invoke
{ event: 'sync', diagnostic: 'Unexpected token <' }
/sensor_data/v2/sample/location/voAcCkFdNU1432834700824?from_datetime_utc=undefined
{ event: 'json',
  diagnostic: 'Unexpected token <',
  body: '<!DOCTYPE html>\n<html>\n<head>\n  <title>We\'re sorry, but something went wrong (500)</title>\n  <style type="text/css">\n    body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }\n    div.dialog {\n      width: 25em;\n      padding: 0 4em;\n      margin: 4em auto 0 auto;\n      border: 1px solid #ccc;\n      border-right-color: #999;\n      border-bottom-color: #999;\n    }\n    h1 { font-size: 100%; color: #f00; line-height: 1.5em; }\n  </style>\n</head>\n\n<body>\n  <!-- This file lives in public/500.html -->\n  <div class="dialog">\n    <h1>We\'re sorry, but something went wrong.</h1>\n  </div>\n</body>\n</html>\n' }
invoke
{ event: 'sync', diagnostic: 'Unexpected token <' }
/home/pi/node_modules/flower-power-cloud/flower-power-cloud.js:158
          locations[id].status = location;
                               ^
TypeError: Cannot set property 'status' of undefined
    at /home/pi/node_modules/flower-power-cloud/flower-power-cloud.js:158:32
    at /home/pi/node_modules/flower-power-cloud/flower-power-cloud.js:243:5
    at IncomingMessage.<anonymous> (/home/pi/node_modules/flower-power-cloud/flower-power-cloud.js:300:7)
    at IncomingMessage.emit (events.js:129:20)
    at _stream_readable.js:908:16
    at process._tickCallback (node.js:355:11)"

you might miss some module .
Try npm install sync

Same…

pi@raspberrypi ~/node_modules/flower-power-cloud $ sudo node test.js
/sensor_data/v2/sample/location/JeCraIuXHB2799401794?from_datetime_utc=undefined
{ event: 'json',
  diagnostic: 'Unexpected token <',
  body: '<!DOCTYPE html>\n<html>\n<head>\n  <title>We\'re sorry, but something went wrong (500)</title>\n  <style type="text/css">\n    body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }\n    div.dialog {\n      width: 25em;\n      padding: 0 4em;\n      margin: 4em auto 0 auto;\n      border: 1px solid #ccc;\n      border-right-color: #999;\n      border-bottom-color: #999;\n    }\n    h1 { font-size: 100%; color: #f00; line-height: 1.5em; }\n  </style>\n</head>\n\n<body>\n  <!-- This file lives in public/500.html -->\n  <div class="dialog">\n    <h1>We\'re sorry, but something went wrong.</h1>\n  </div>\n</body>\n</html>\n' }
invoke
{ event: 'sync', diagnostic: 'Unexpected token <' }
/sensor_data/v2/sample/location/1eyGRFfUkH1410718171?from_datetime_utc=undefined
{ event: 'json',
  diagnostic: 'Unexpected token <',
  body: '<!DOCTYPE html>\n<html>\n<head>\n  <title>We\'re sorry, but something went wrong (500)</title>\n  <style type="text/css">\n    body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }\n    div.dialog {\n      width: 25em;\n      padding: 0 4em;\n      margin: 4em auto 0 auto;\n      border: 1px solid #ccc;\n      border-right-color: #999;\n      border-bottom-color: #999;\n    }\n    h1 { font-size: 100%; color: #f00; line-height: 1.5em; }\n  </style>\n</head>\n\n<body>\n  <!-- This file lives in public/500.html -->\n  <div class="dialog">\n    <h1>We\'re sorry, but something went wrong.</h1>\n  </div>\n</body>\n</html>\n' }
invoke
{ event: 'sync', diagnostic: 'Unexpected token <' }
/sensor_data/v2/sample/location/OIbnDpYmVz1411304863?from_datetime_utc=undefined
{ event: 'json',
  diagnostic: 'Unexpected token <',
  body: '<!DOCTYPE html>\n<html>\n<head>\n  <title>We\'re sorry, but something went wrong (500)</title>\n  <style type="text/css">\n    body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }\n    div.dialog {\n      width: 25em;\n      padding: 0 4em;\n      margin: 4em auto 0 auto;\n      border: 1px solid #ccc;\n      border-right-color: #999;\n      border-bottom-color: #999;\n    }\n    h1 { font-size: 100%; color: #f00; line-height: 1.5em; }\n  </style>\n</head>\n\n<body>\n  <!-- This file lives in public/500.html -->\n  <div class="dialog">\n    <h1>We\'re sorry, but something went wrong.</h1>\n  </div>\n</body>\n</html>\n' }
invoke
{ event: 'sync', diagnostic: 'Unexpected token <' }
/home/pi/node_modules/flower-power-cloud/flower-power-cloud.js:158
          locations[id].status = location;
                               ^
TypeError: Cannot set property 'status' of undefined
    at /home/pi/node_modules/flower-power-cloud/flower-power-cloud.js:158:32
    at /home/pi/node_modules/flower-power-cloud/flower-power-cloud.js:243:5
    at IncomingMessage.<anonymous> (/home/pi/node_modules/flower-power-cloud/flower-power-cloud.js:300:7)
    at IncomingMessage.emit (events.js:129:20)
    at _stream_readable.js:908:16
    at process._tickCallback (node.js:355:11)

Ok it seems that there is a server issue somewhere, as we were able to run the code 2 weeks ago … We will investigate this, thanks for pointing this out !
Jerome