Hi all,
Battling with automation here and not sure where I’m going wrong. I’ve created the input, created the feed and now coming to linking the two with a process to LOG the data and I just cannot get the api to do this.
Following the docs it should be:
Set input process list GET https://myweb.net/emoncms/input/process/set?inputid=0&processlist=0:0
However this fails with
{“success”:false,“message”:“Input processlist was not updated”}
I’ve tried crafting this is various ways, used post, get, json format, parameters (all including my apikey) and all return with this problem.
My alternative method:
$jsonData = array(
'processlist' => 'process__log_to_feed:100'
);
$jsonDataEncoded = json_encode($jsonData);
$dothis = file_get_contents('https://myweb.net/emoncms/input/process/set.json?inputid=10',null,stream_context_create(array(
'http' => array(
'protocol_version' => 1.1,
'method' => 'POST',
'header' => "Content-type: application/json\r\n".
"Connection: close\r\n" .
"Authorization: Bearer myapikey\r\n" .
"Content-length: " . strlen($jsonDataEncoded) . "\r\n",
'content' => $jsonDataEncoded,
),
)));
But same problem persists. I’ve also tried to capture the browser data, as when I do this with the GUI it works, it seems to post the same but there must be a magic key element I’m missing. Please help!
Thank you.
Andy
[Edited to format code snippet - RW]