Thanks for the reply.
Yes, TTN receives uplink messages from the device.
And when I send downlink messages to the device via the TTN console, they show up in the console device data (first scheduled, then after an uplink message from the device actually sent) and they reach the device (it causes a led to be turned on).
But the message send via http (the command line message mentioned above) do not even show up in the the TTN console.
That’s impossible; the server will always return some HTTP headers even if it returns no content. But apparently curl did not print anything. For command line testing, better include -i to see the response headers: curl -i -X POST --data .... Or -v for even more verbose output: curl -v -X POST --data ...
(I am not using the integration, so have not checked right now if an URL like this would work for me. I’d assume that an unknown my-app-id or my-process-id might yield a 404 Not Found as well.)
Hi Arjan, thanks for your reply. Sorry my mistake
I changed my-app-id and my-process_id to the right values and my error is now
there is something wrong I can’t see
HTTP/1.1 400 Bad Request
Server: nginx/1.13.7
Date: Thu, 01 Feb 2018 22:48:39 GMT
Content-Type: text/plain; charset=utf-8
Content-Length: 0
Connection: keep-alive
You’ll have to check id’s and secrets, both in the URL and in the JSON message.
I’m not sure if the decimal point in 1.0 is accepted. But surely "test" is not a valid Base64 encoded string. Also, it seems all these are attributes of options? Indeed, method and contentType should be attributes of options, but whatever is to be actually POSTed should be in something like options.body instead, like dev_id, payload_raw, port and confirmed. You’ll have to show some code rather than only the logs.
Also, I noticed your edit. I doubt that the slash you added after ?key=ttn-account-v2.XXXREPLACED/ is really in the log…
thanks for that really fast answer. Your Content-Type hint finally solved my issue.
To help others running into the same mistake: Here is my Source Code for Google Script
function myResponse() {
var data = {
"dev_id": "0123456",
"port": 1,
"confirmed": false,
"payload_raw" : "1QIDBA=="
};
var options =
{
'method' : 'post',
'contentType': 'application/json',
'payload': JSON.stringify(data)
};
var response = UrlFetchApp.fetch("https://integrations.thethingsnetwork.org/ttn-eu/api/v2/down/XXXXREPLACEME/XXXXREPLACEME?key=ttn-account-v2.XXXXREPLACEME", options);
//var response = UrlFetchApp.fetch('http://www.google.com/');
Logger.log(response.getContentText());
var Test = "0"
}