RUT241 API login response has no token

Hello,
I tried to get a token by following your API tutorial.
But, the response.json() was as

{“expires”:299,“timeout”:300,“ubus_rpc_session”:“c4c5614004fcf866ecaa175183152557”,“success”:true,“data”:{“username”:“admin”},“acls”:{“vuci.firmware”:{“factory_reset”:[“write”]},“ubus”:{“vuci.network.network”:[“get_devices”,“network_netlist”,“conntrack_table”],“rut_fota”:[“get_process”],“uci”:[“get”,“set”,“order”,“delete”,“add”,“apply”],“mnfinfo”:[“get”],“gsmd”:[“reinit_modems”,“get_modems”],“vuci.firmware”:[“user_defaults”],“ip_block”:[“unblock”,“reload”],“vuci.ui”:[“lang”,““],””:[“"],“network.device”:[“status”],“iwinfo”:[“devices”,“assoclist”,“info”],“vuci.services.packages”:[“get_available_language_packages”,“install_package”,“remove_pending_package”],“vuci.network.mobile”:[“get_all_modems”,“modem_update_state”],“vuci.system.firmware”:[“get_current_info”,“check_fw”,“get_fw_info”,“prepare_modem_upgrade”,“validate_firmware”,“validate_modem_firmware”,“download_device_fw”,“download_module_fw”,“continue_download”,“check_modem_fw_install_status”,“remove_fw”,“upgrade_firmware”,“modem_upgrade_trb14”,“modem_upgrade”],“vuci.system”:[“get_ca”,“modify_ca”,“firewall_access”,“cli_access”,“telnet_access”,“validate_uhttpd_cert”,“check_config”,“reboot”,“get_routername”,“get_board”,“file_stats”,“get_switch_topologies”,“system_status”,“remove_vuci_uploads”,“diskfree”,“lucibwc”,“clock_status”,“version”,“df”,“get_networks_devices”],“network.interface”:[“dump”],“vuci.services.services”:[“update_configs”],"network.interface.”:[“status”],“network.wireless”:[“status”],“vuci.system.profiles”:[“update_profile”],“ioman..”:[“status”,“update”],“vuci.services.gre”:[“gre_create”,“gre_remove”,“gre_save”,“route_create”,“validate_netmask”],“vuci.login”:[“get_routername”],“system”:[“reboot”,“board”,“info”],“vuci.network.wireless”:[“wifi_interface_status”],“sim”:[“get”],“network.rrdns”:[“lookup”],“session”:[“access”,“login”,“destroy”,“get”],“rpc-sys”:[“upgrade_clean”]},“api”:{“/access_control/webui/“:[“read”,“write”],”/firewall/attack_prevention/syn_flood_protection/”:[“read”,“write”],“/l2tpv3/“:[“read”,“write”],”/administration/general/”:[“read”,“write”],“/profiles/config/“:[“read”],”/wireless/devices/actions/wifi_scan/”:[“write”],“/vlan/interface_based/“:[“read”,“write”],”/io/post_get/”:[“read”,“write”],“/ipsec/“:[“read”,“write”],”/packages/config/language/”:[“read”],“/wireguard/“:[“read”,“write”],”/mobile/”:[“read”],“/gre/“:[“read”,“write”],”/administration/general/config/”:[“read”,“write”],“/device/status/“:[“read”,“write”],”/recipients/send_email/”:[“write”],“/firmware/“:[“read”,“write”],”/access_control/security/attempts/”:[“read”,“write”],“/dhcp/servers/“:[“read”,“write”],”/firewall/traffic_rules/”:[“read”,“write”],“/devices/status/“:[“read”],”/l2tpv3/config/”:[“read”],“/mwan3/general/status/“:[“read”],”/logout”:[“write”],“/cloud_solutions/rms/config/general/“:[“read”],”/interfaces/stats/”:[“read”],“/recipients/phone_groups/config/“:[“read”],”/access_control/telnet/”:[“read”,“write”],“/interfaces/status/“:[“read”],”/administration/ntp/client/”:[“read”,“write”],“/data_sender/“:[“read”,“write”],”/firewall/attack_prevention/remote_icmp_requests/”:[“read”,“write”],“/events_log/log/network/“:[“read”],”/dmvpn/”:[“read”],“/topology/“:[“read”],”/wireless/devices/config/”:[“read”],“/routes/advanced_static/“:[“read”,“write”],”/firewall/custom_rules/”:[“read”,“write”],“/mobile_utilities/“:[“read”,“write”],”/l2tp/server/config/”:[“read”],“/ui/config/“:[“read”],”/mobile_utilities/call_utilities/rules/config/”:[“read”],“/pptp/server/config/“:[“read”],”/openvpn/”:[“read”,“write”],“/mwan3/“:[“read”,“write”],”/recipients/email_users/config/”:[“read”],“/io/status/“:[“read”,“write”],”/events_reporting/options/”:[“read”],“/device/“:[“read”],”/io/juggler/options/general/actions/”:[“read”],“/recipients/phone_groups/“:[“read”,“write”],”/administration/uscripts/”:[“read”,“write”],“/io/status/config/“:[“read”],”/interfaces/”:[“read”,“write”],“/events_log/log/system/“:[“read”],”/firewall/zones/”:[“read”,“write”],“/certificates/actions/“:[“write”],”/gre/config/”:[“read”],“/auto_reboot/periodic/“:[“read”,“write”],”/firewall/attack_prevention/http_attack_prevention/”:[“read”,“write”],“/mobile_utilities/sms_messages/read/“:[“read”,“write”],”/base/”:[“read”,“write”],“/diagnostics/“:[“read”,“write”],”/ui/config/languages/”:[“read”],“/io/juggler/config/general/inputs/“:[“read”],”/dhcp/servers/config/”:[“read”,“write”],“/io/juggler/config/general/actions/“:[“read”,“write”],”/io/scheduler/”:[“read”,“write”],“/firewall/nat_rules/“:[“read”,“write”],”/mobile/sim_switch/”:[“read”,“write”],“/fota/“:[“read”,“write”],”/mobile_utilities/call_utilities/”:[“read”,“write”],“/wireless/interfaces/signal/“:[“read”],”/mobile_utilities/sms_gateway/email_to_sms/”:[“read”,“write”],“/profiles_scheduler/“:[“read”,“write”],”/users/”:[“read”,“write”],“/events_log/log/“:[“read”],”/wireless/interfaces/”:[“read”,“write”],“/administration/ntpd/config/general/“:[“read”],”/wireless/”:[“read”,“write”],“/wireguard/config/“:[“read”],”/widget/”:[“read”,“write”],“/vrrp/status/“:[“read”],”/vrrp/config/”:[“read”],“/mobile/modems/status_full/“:[“read”],”/vlan/port_based_general_settings/”:[“read”,“write”],“/ports_settings/“:[“read”,“write”],”/mobile_utilities/sms_gateway/post_get/”:[“read”,“write”],“/vlan/port_based/“:[“read”,“write”],”/vlan/interface_based/config/”:[“read”],“/l2tp/“:[“read”,“write”],”/dhcp/”:[“read”,“write”],“/ulog/general/options/“:[“read”],”/io/scheduler/config/general/”:[“read”],“/ui/“:[“read”,“write”],”/devices/traffic/”:[“read”],“/troubleshoot/“:[“read”,“write”],”/backup/”:[“read”,“write”],“/auto_reboot/ping/“:[“read”,“write”],”/routes/static/”:[“read”,“write”],“/mobile/sim_switch/config/“:[“read”],”/sstp/”:[“read”],“/administration/ntp/“:[“read”,“write”],”/services/”:[“read”,“write”],“/serial/“:[“read”],”/pptp/client/”:[“read”],“/mobile_utilities/sms_storage/“:[“read”,“write”],”/dhcp/static_leases/config/”:[“read”],“/routes/status/“:[“read”,“write”],”/profiles/”:[“read”,“write”],“/administration/general/actions/“:[“read”,“write”],”/routes/connections/”:[“read”,“write”],“/root_ca/“:[“read”,“write”],”/recipients/email_users/”:[“read”,“write”],“/firewall/nat_offloading/“:[“read”,“write”],”/hotspot/general/status/”:[“read”],“/recipients/“:[“read”],”/l2tp/client/”:[“read”],“/firewall/zones/config/“:[“read”],”/certificates/config/”:[“read”],“/routes/connections_realtime/“:[“read”,“write”],”/interfaces/config/”:[“read”,“write”],“/access_control/webui/status/“:[“read”],”/firewall/attack_prevention/port_scan/”:[“read”,“write”],“/packages/“:[“read”,“write”],”/package_restore/”:[“read”,“write”],“/vlan/port_based/config/“:[“read”],”/mobile/apn_database/”:[“read”,“write”],“/mobile/modems/“:[“read”,“write”],”/openvpn/status/”:[“read”],“/openvpn/config/“:[“read”],”/firewall/iptables/”:[“read”,“write”],“/cloud_solutions/rms/“:[“read”,“write”],”/pptp/client/config/”:[“read”],“/mwan3/interfaces/config/“:[“read”],”/events_log/log/connections/”:[“read”],“/access_control/cli/“:[“read”,“write”],”/dns/”:[“read”,“write”],“/dhcp/servers/status/“:[“read”],”/cloud_solutions/rms/status/”:[“read”],“/administration/system/config/“:[“read”,“write”],”/mobile_utilities/sms_rules/config/”:[“read”],“/firewall/dmz/“:[“read”,“write”],”/mobile_utilities/sms_messages/send/”:[“read”,“write”],“/administration/ntp/client/config/“:[“read”],”/device/info/”:[“read”,“write”],“/access_control/ssh/“:[“read”,“write”],”/overview/”:[“read”,“write”],“/certificates/config/ca/“:[“read”],”/mobile/simcards/”:[“write”,“read”],“/mobile_utilities/sms_forwarding/“:[“read”,“write”],”/devices/”:[“read”],“/io/juggler/config/“:[“read”,“write”],”/profiles_scheduler_general/”:[“read”,“write”],“/access_control/security/general/“:[“read”,“write”],”/events_log/log/events/”:[“read”],“/mobile/simcards/status/“:[“read”],”/administration/led/config/”:[“read”,“write”],“/events_reporting/“:[“read”,“write”],”/certificates/”:[“read”,“write”],“/mobile/simcards/config/“:[“read”],”/pptp/”:[“read”,“write”],“/administration/buttons/config/“:[“read”,“write”],”/mobile_utilities/sms_gateway/auto_reply/”:[“read”,“write”],“/firewall/attack_prevention/https_attack_prevention/“:[“read”,“write”],”/dhcp/static_leases/”:[“read”,“write”],“/bluetooth/general/config/general/“:[“read”],”/mobile/operator_lists/”:[“write”,“read”],“/mobile/modems/status_basic/“:[“read”],”/mobile/modems/status”:[“read”],“/firewall/attack_prevention/ssh_attack_prevention/“:[“read”,“write”],”/l2tp/client/config/”:[“read”],“/logging/“:[“read”,“write”],”/device/load/”:[“read”,“write”],“/usb_tools/general/mounts/“:[“read”],”/io/juggler/config/general/conditions/”:[“read”,“write”],“/firewall/general_settings/“:[“read”,“write”],”/firewall/port_forwards/”:[“read”,“write”],“/mwan3/general/config/globals/“:[“read”],”/groups/”:[“read”,“write”]},“uci”:{" “:[“read”,“write”],“ntpclient”:[“read”,“write”],“rpcd”:[“read”,“write”],“dropbear”:[“read”,“write”],“wireless”:[“read”,“write”],“widget”:[“read”,“write”],“ioman”:[“read”,“write”],”“:[“read”,“write”],“pam”:[“read”,“write”],“vuci”:[“read”,“write”],“sim_switch”:[“read”,“write”],“ip_blockd”:[“read”,“write”],“uhttpd”:[“read”,“write”],“user_groups”:[“read”],“openvpn”:[“read”,“write”],“buttons”:[“read”,“write”],“dhcp”:[“read”,“write”],“system”:[“read”,“write”],“simcard”:[“read”,“write”],“iojuggler”:[“read”,“write”],“telnetd”:[“read”,“write”],“operctl”:[“write”,“read”],“firewall”:[“read”,“write”],“rut_fota”:[“read”,“write”],“cli”:[“read”,“write”],“profiles”:[“read”],“overview”:[“write”,“read”],“network”:[“write”,“read”]},“file”:{”/usr/lib/opkg/info/pam.control":[“list”],"":[“read”,“write”,“exec”]},“cgi-io”:{“upload”:[“write”]},“access-group”:{“network/mobile/general”:[“write”,“read”],“services/mobile_utilities/sms_messages/storage”:[“read”,“write”],“system/wizard/step_lan”:[“read”,“write”],“status/mobile_usage/total”:[“read”],“services/mobile_utilities/sms_gateway/auto_reply”:[“read”,“write”],“services/events_reporting”:[“read”,“write”],“network/failover/mwan”:[“read”,“write”],“services/mobile_utilities/sms_gateway/sms_forwarding”:[“read”,“write”],“system/wizard/step_wan”:[“read”,“write”],“services/io/juggler/action”:[“read”,“write”],“network/firewall/attack_prevention”:[“read”,“write”],“network/vlan/interface_based”:[“read”,“write”],“status/realtime/mobile”:[“read”],“system/admin/multiusers/users_configuration”:[“read”,“write”],“network/routes/static_routes”:[“read”,“write”],“services/vpn/gre”:[“read”,“write”],“system/admin/access_control/safety”:[“read”,“write”],“system/maintenance/auto_reboot/reboot_scheduler”:[“read”,“write”],“services/mobile_utilities/sms_gateway/post_get”:[“read”,“write”],“network/mobile/sim_switch”:[“read”,“write”],“network/wan”:[“read”,“write”],“system/maintenance/eventlog/network”:[“read”,“write”],“system/admin/certificates/manager”:[“read”,“write”],“system/wizard/step_pwd”:[“read”,“write”],“unauthenticated”:[“read”],“system/wizard/step_wifi”:[“read”,“write”],“system/wizard/step_rms”:[“read”,“write”],“network/firewall/rules”:[“read”,“write”],“network/routes/advanced_routing”:[“read”,“write”],“system/admin/datetime/ntp”:[“read”,“write”],“services/mobile_utilities/call_utilities”:[“read”,“write”],“status/mobile_usage/month”:[“read”],“status/realtime/bandwidth”:[“read”],“system/admin/certificates/root_ca”:[“read”,“write”],“system/admin/access_control/general”:[“read”,“write”],“system/maintenance/uscripts”:[“read”,“write”],“status/network/dhcp_leases”:[“read”,“write”],“system/maintenance/eventlog/connections”:[“read”,“write”],“status/mobile_usage/week”:[“read”],“system/ui”:[“read”,“write”],“services/vpn/openvpn”:[“read”,“write”],“system/maintenance/eventlog/system”:[“read”,“write”],“services/mobile_utilities/sms_messages/read”:[“read”,“write”],“system/admin/profiles/scheduler”:[“read”,“write”],“system/maintenance/backup”:[“read”,“write”],“system/info”:[“read”,“write”],“system/maintenance/eventlog/all”:[“read”,“write”],“system/maintenance/cli”:[“read”],“system/maintenance/auto_reboot/ping_reboot”:[“read”,“write”],“network/dhcp_servers/general”:[“read”,“write”],“services/io/post_get”:[“read”,“write”],“network/dhcp_servers/static_leases”:[“read”,“write”],“system/license”:[“read”],“system/packages/packages”:[“read”,“write”],“status/routes/general”:[“read”],“status/realtime/wireless”:[“read”],“system/maintenance/eventlog/general”:[“read”,“write”],“system/admin/profiles/config”:[“read”,“write”],“system/admin/multiusers/change_password”:[“read”,“write”],“system/admin/group/phone”:[“read”,“write”],“system/admin/group/email”:[“read”,“write”],“services/io/juggler/condition”:[“read”,“write”],“system/maintenance/troubleshoot”:[“read”,“write”],“system/admin/datetime/general”:[“read”,“write”],“system/flashops/general”:[“read”,“write”],“system/admin/certificates/generation”:[“read”,“write”],“status/network/firewall/ipv4”:[“read”,“write”],“system/admin/admin”:[“read”,“write”],“superuser”:[“read”,“write”],“network/dns”:[“read”,“write”],“network/firewall/forwards”:[“read”,“write”],“network/wireless/ssids”:[“read”,“write”],“status/widget”:[“read”,“write”],“services/vpn/wireguard”:[“read”,“write”],“status/system”:[“read”],“core”:[“read”,“write”],“status/services”:[“read”,“write”],“system/flashops/fota”:[“read”,“write”],“system/reboot”:[“read”,“write”],“status/realtime/connections”:[“read”],“services/vpn/ipsec”:[“read”,“write”],“status/overview”:[“read”,“write”],“status/network/lan”:[“read”],“status/network/topology”:[“read”],“status/wireless/channel_analysis”:[“read”,“write”],“network/firewall/custom”:[“read”,“write”],“services/io/scheduler”:[“read”,“write”],“status/network/firewall”:[“read”,“write”],“network/firewall/nat_rules”:[“read”,“write”],“status/mobile_usage/day”:[“read”],“system/packages/upload”:[“read”,“write”],“network/lan”:[“read”,“write”],“network/firewall/dmz”:[“read”,“write”],“services/vpn/pptp”:[“read”,“write”],“services/io/juggler/input”:[“read”,“write”],“network/wireless/scan”:[“read”,“write”],“network/mobile/operators/list”:[“write”,“read”],“serial”:[“read”],“status/network/firewall/ipv6”:[“read”,“write”],“services/vpn/l2tpv3”:[“read”,“write”],“services/vpn/l2tp”:[“read”,“write”],“services/mobile_utilities/sms_utilities”:[“read”,“write”],“services/io/general”:[“read”,“write”],“services/mobile_utilities/sms_messages/send”:[“read”,“write”],“network/vlan/port_based”:[“read”,“write”],“services/data_sender”:[“read”,“write”],“network/ports/ports_settings”:[“read”,“write”],“status/network/mobile”:[“read”,“write”],“network/mobile/apn_database”:[“read”,“write”],“network/mobile/operators/scan”:[“read”,“write”],“services/cloud_solutions/rms”:[“read”,“write”],“status/realtime/load”:[“read”],“services/mobile_utilities/sms_gateway/email_to_sms”:[“read”,“write”],“network/firewall/zones”:[“read”,“write”],“status/wireless/interfaces”:[“read”]}}}

What is the problem??

Hi there,

Could you please provide the specific API call you made? It seems different from the typical response in tutorials.

Best regards,
Marijus

1 Like

Hello,
At first, thank you for your comment.

curl -X POST “http://ip/api/login” -H “Content-Type: application/json” -d ‘{“username”: “id”, “password”: “password”}’

or

headers = {
‘Content-Type’: ‘application/json’
}
data = {
‘username’: “id”,
‘password’: “password”
}
response = requests.post(“http://ip/api/login”, json=data, headers=headers)

Both methods above give the same result.

Best regards,
Kim

I upgraded the firmware version and got the same results as the tutorial.

Thank you!

Seems like you were using firmware version before official API support was added. Official API support is only from 07.06.0 firmware version. When using API documentation make sure you have selected the firmware version that is currently installed on your device and select the correct device model.
Additionally if anyone is looking to get older versions working the login token is ubus_rpc_session.

1 Like

Aha ubus_rpc_session was token!
Thank you so much~

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