Cannot get API downlinkMsg to work
-
Hello,
I cannot get the downlinkMsg endpoint to work using these instructions:
https://docs.iotcreators.com/docs/6-send-downlink-message-to-devkitWhat ever I try, I get a status 403 with
{ "msg": "Unauthorized", "code": 1001 }
The application is set, tried with/without
IMEI:
prefix, tried both regular and HEX message.Any advice?
-
Hi @magnatron you need a callback URL in your project that actually works fine. Only after having a proper callback URL the downlink message can be sent, that’s how our backend works. Could you please test if the application server data in your project are correct, do the uplink messages reach that server?
-
@Uta, yes. I read that. It’s a running project that has been sending uplink messages for some time now.
-
Oh, and the application is receiving them and handling them returning
200
status -
Also, the downlink works via the portal. Just not via the API.
-
Hi @magnatron did you set the callback URL using the portal or the API? To use downlink messages with the API you need to set the callback URL using the API and the credentials for the API user.
Explenation: There is two different users associated with your tenant, an API user and a GUI user. If you set the callback URL with the portal it is done with the GUI user and only this user is then authorized to send downlink messages. If you send downlink messages using the API (i.e. with the API user credentials) that user also needs to have an application URL registered.
Best
Yassine -
@Yassine-Amraue thnx, I’ll check.
But devices added by API user are also displayed in GUI and vv, right?
So is there some “magic” happening linking the two together on some processes but not on others? -
Hi @magnatron, Yes the devices are shown independent of whether you create them with the API or the GUI but regarding callback URLs (or better: northbound application) the logic is that each user has it’s own northbound application. That’s how the IAM works with the platform. End each user needs to have an application registered to be Authorized to use certain API calls (like downlink messages).
Best
Yassine -
Hi @magnatron, can you tell us if this solved your issue?
Best
Yassine -
@Yassine-Amraue No, not yet. I’m doing some testing with the portal but it seems sending downlinks influences the time it takes to send an uplink. I’m trying to figure it out but I’m not getting good results yet.
Is there any instructions on reading the downlink messages on a ublox sara-n211? I only found the instructions for the BC66 kit which has different AT commands…
-
@magnatron In case you still not able to send downlink messages to your device please provide your account, project and the device imei to our support@iotcreators.com . I will take a look on it.
Regards, Roland
-
@roalnd-baldin I’m able to send downlinks with the portal but unable to receive them on the device.
Are there any examples available for the ublox AT command set?Thanks
-
@magnatron your question tells me that we might put a little effort in providing AT command guides in a more human readable form. I personally find it hard as an IoT device newbie to read the vendor guides sometimes.
First thing I can provide you with is the original vendor manual
Secondly see here our own extract
What is more helpful for you?
And did you find what you need for reading the DL messages? -
@uta thanks.
The extract is really nice. More of these simplifications might be very useful for people that have ideas to try with IoT but do not have the nerdiness to go through those manuals.
However, I still cannot get it to work:- Sending over the portal.
- Sending message from SARA-N2 device.
- Running
AT+NQMGR
results inBUFFERED=0,RECEIVED=0,DROPPED=0
-
@magnatron Did you already send me your account, the project and the imei of the device. I like to check the logs. You can send it to roland.baldin@telekom.de.
Regards, Roland
-
Hello guys
@Yassine-Amraue : thank you for explaining that there is a GUI and an API user. I’ve been banging my head trying to send a downlink message via API and always getting an ‘unauthorized’ error. But after registering a callback URL for the API user as well I can now send downlink messages via API to my device. Thanks again.
@magnatron : I am using a SIM7020 based device and previously via API sent downlink messages are getting delivered to it as soon as the device sends an uplink message.
Thanks
Felix