Downlink messages stopped working

Hi,

I have previously used this “https://eu1.cloud.thethings.network/api/v3/as/applications/{0}/devices/{1}/down/replace
endpoint to send a downlink message but it doesn’t seem to work anymore since I last tested it (at least a year ago).

Should the endpoint now be like so?:
https://eu1.cloud.thethings.network/api/v3/as/applications/{0}/webhooks/{1}/devices/{2}/down/replace

I’m using this:

string wh = "https://webhook.site/58fab4a8-d4f9-49d4-8a77-e31bf9c0603e";


command = Convert.ToBase64String(Encoding.UTF8.GetBytes(command));

string urls = "https://eu1.cloud.thethings.network/api/v3/as/applications/{0}/webhooks/{1}/devices/{2}/down/replace";

  
var url = String.Format(urls, app, wh, device);
var httpRequest = (HttpWebRequest)WebRequest.Create(url);
httpRequest.Method = "POST";


httpRequest.Headers["Authorization"] = key;
httpRequest.ContentType = "application/json";
//httpRequest.Headers["User-Agent"] = "my-integration/my-integration-version";

var data = @"{
    ""downlinks"": [{
        ""frm_payload"": """ + command + @""",
        ""f_port"": 1
    }]
}";

I have tried creating a webhook but I am not really sure how to configure it.
image

I am using OTAA for this instance if that makes any difference.

thanks

Has it changed in the documentation?

The web hook is fully documented as well but is for sending outgoing messages from TTS, so the downlink sent checkbox will be a message say that a downlink has been sent. The ONLY part of a web hook that refers to queuing a downlink is the inclusion of a downlink API key for you to use.

A lot of effort has been put in to creating the docs so please do read them, hacking on TTS as a substitute rarely works.

1 Like

Ok, so webhook is not needed; got it…

This hack(?) code used to work but has now stopped working so something must have changed which prompted me looking through the docs again, hence the webhook mistake on my part where the curl operation is mentioned.

Couldn’t find anything in the docs about the non-webhook downlink curl.

Please don’t be mean to me, I am really sensitive.

thanks

I don’t have capacity to sugar coat things at present - let me know when you are feeling brave.

The search for “downlink” provides a whole page on how to do downlinks with curl. The technique I use is to look at all the hits on a search until I see information that may help.

https://www.thethingsindustries.com/docs/integrations/webhooks/scheduling-downlinks/

I’m only giving you a free pass on this because confusingly, it’s in the web hooks section without differentiating it from the outgoing only web hook docs and one of the cats has just purred at me so I’m feeling more empathetic. That and I spent a lot of time reading StackOverflow Meta over the weekend on how to deal with these sorts of issues.

1 Like

Ok, now it makes sense, you frequent StackOverflow.

Sugar coating is different than not being snarky but thanks anyway

But the issue was with this line:
httpRequest.Headers[“Authorization”] = "Bearer " + key;

I had to add the bearer part so my code really was a hack (or sth changed) :cry:

I don’t, because its reason for existence (quality answers to quality questions to provide a silo of information) was broken a long long time ago.

If you get the answer for free when you’ve not dug in to the materials, does it matter if the answer has some colour to it?

Most of the discussions on SO Meta are around either figuring out how to get people to help themselves, how to ask questions with the right level of detail or how to cope with questions that have tiny bit of merit despite the delivery / presentation.

I purposely left your question for a day to see if anyone else would answer and/or you’d resolve your made up URL by reviewing the documentation - something that would have your question thrown out on SO.

I’m genuinely interested in how to help people to get the best out of technical forums as it seems many people are held back by the lack of depth & breadth of knowledge & skills when they could be creating really useful stuff, for the want of a little finessing.