# Possible way to access router api?

**URL:** <https://discourse.nodered.org/t/possible-way-to-access-router-api/55148>\
**Category:** Developing Nodes\
**Tags:** http-request\
**Created:** [14 December 2021 06:06 UTC](https://discourse.nodered.org/t/possible-way-to-access-router-api/55148 "2021-12-14T06:06:46Z")\
**Posts on this page:** 7\
**Page:** 2

<div class="post-metadata">

**Author:** ![alpha815](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/alpha815/32/47825_2.png) [@alpha815](https://discourse.nodered.org/u/alpha815)\
**Post date:** [14 December 2021 15:46 UTC](https://discourse.nodered.org/t/possible-way-to-access-router-api/55148/21 "2021-12-14T15:46:42Z")

</div>

yeah that is really progress, i have already tried still getting that error.

> [@UnborN](#):
>
> ```auto
> let base64pass = "ZmUxNzJlY2RiNjU3OWI2ZWE5ODQ5Y2UwN2FmM2NlNzIyNDEyNzhjODQ2Y2ViZWVhMjI1MzFmYzZlNTBiZTgwMw=="
> 
> ```

---

<div class="post-metadata">

**Author:** ![alpha815](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/alpha815/32/47825_2.png) [@alpha815](https://discourse.nodered.org/u/alpha815)\
**Post date:** [14 December 2021 15:51 UTC](https://discourse.nodered.org/t/possible-way-to-access-router-api/55148/22 "2021-12-14T15:51:57Z")

</div>

I tried online base64 decode and encode, password encoded by a node is correct, I don't know why the modem is rejecting. maybe need mode digging into Huwaei LTE API.

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [14 December 2021 16:01 UTC](https://discourse.nodered.org/t/possible-way-to-access-router-api/55148/23 "2021-12-14T16:01:35Z")

</div>

I spent a lot of time developing a flow similar to the one which you are trying, and I also had a similar response.  
Have you considered adapting the code which I posted above?

---

<div class="post-metadata">

**Author:** ![alpha815](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/alpha815/32/47825_2.png) [@alpha815](https://discourse.nodered.org/u/alpha815)\
**Post date:** [14 December 2021 16:06 UTC](https://discourse.nodered.org/t/possible-way-to-access-router-api/55148/24 "2021-12-14T16:06:51Z")

</div>

I have already looked at your code, Huawei is using a very different strategy to provide WebUI for their LTE modem. as far I can understand you are accessing a direct webpage for login. on the other hand Huawei provide API to client-side. for example for accessing current statistics i send a get request to `api/monitoring/traffic-statistics/r/nConnection` and modem replies with data.on newer version of huawei devices you have to loged into modem to access these API.

---

<div class="post-metadata">

**Author:** ![alpha815](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/alpha815/32/47825_2.png) [@alpha815](https://discourse.nodered.org/u/alpha815)\
**Post date:** [14 December 2021 17:16 UTC](https://discourse.nodered.org/t/possible-way-to-access-router-api/55148/25 "2021-12-14T17:16:54Z")

</div>

Hi there,  
I have done it finally, guess what? I don't need to log in to get data of my interest. the flow you provided to extract session id and token I make a second HTTP request to

```auto
http://192.168.1.1/api/monitoring/traffic-statistics/r/nConnection
http://192.168.1.1/api/monitoring/status

```

and here is the output

```auto
{"response":{"CurrentConnectTime":["3570"],
"CurrentUpload":["7470469"],
"CurrentDownload":["25712745"],"
CurrentDownloadRate":["92"],"
CurrentUploadRate":["1059"],"
TotalUpload":["14956663649"],"
TotalDownload":["248347829410"],"
TotalConnectTime":["5357112"],
"showtraffic":["1"]}}
{"ConnectionStatus":["901"],
"WifiConnectionStatus":["902"],
"SignalStrength":[""],
"SignalIcon":["4"],
"CurrentNetworkType":["19"],
"CurrentServiceDomain":["3"],
"RoamingStatus":["0"],
"BatteryStatus":["0"],
"BatteryLevel":["2"],
"BatteryPercent":["50"],
"simlockStatus":["0"],
"PrimaryDns":["10.177.88.32"],
"SecondaryDns":["202.69.12.151"],
"PrimaryIPv6Dns":[""],
"SecondaryIPv6Dns":[""],
"CurrentWifiUser":["2"],
"TotalWifiUser":["16"],
"currenttotalwifiuser":["16"],
"ServiceStatus":["2"],
"SimStatus":["1"],
"WifiStatus":["1"],
"CurrentNetworkTypeEx":["101"],
"WanPolicy":["2"],
"maxsignal":["5"],
"wifiindooronly":["0"],
"wififrequence":["0"],
"classify":["mobile-wifi"],
"flymode":["0"],"
cellroam":["1"],
"ltecastatus":["0"]}

```

Thank you so much I could not have done without you. Now I can peacefully send this data to InfluxDB and display it on grafana, from there I can get notifications about anything going wrong.

---

<div class="post-metadata">

**Author:** ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)\
**Post date:** [14 December 2021 17:29 UTC](https://discourse.nodered.org/t/possible-way-to-access-router-api/55148/26 "2021-12-14T17:29:52Z")

</div>

Nice .. im glad you found a solution .. all the best with the rest of the project 👍

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [28 December 2021 17:30 UTC](https://discourse.nodered.org/t/possible-way-to-access-router-api/55148/27 "2021-12-28T17:30:04Z")

</div>

Closed on 28 December 2021 17:30 UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.

[Previous page](https://discourse.nodered.org/t/possible-way-to-access-router-api/55148.md?page=1)
