A Go library for interacting with Linksys Smart WiFi-enabled routers using the JNAP protocol described below.
All API requests are POST requests made to http://192.168.1.1/JNAP/
. The API endpoint can be changed if 192.168.1.1
does not point to the router. The special domain LinksysSmartWIFI.com points to the router ONLY if the DNS server is still the default. If using any other DNS server, such as Google's 8.8.8.8
, it will point to 54.183.80.213
.
All requests contain a JSON object as the POST data. Even if the action doesn't require any parameters, the POST data must be {}
. All actions below take no parameters unless otherwise documented. The Content-Type
header does not matter and is assumed to be application/json
.
All responses are JSON objects with two keys: output
and response
. The response
key indicates the status of the action. A value of OK
indicates the operation was successful, any other value indicates an error. When an error occurs, another field, error
, may be returned.
Every request has an HTTP header, X-JNAP-Action
, that describes the action, request, and response parameters. Every action starts with http://linksys.com/jnap/
(alternatively, http://cisco.com/jnap/
could be used, but it seems to be deprecated). The actions described below have the prefix omitted, but are required in the header. For example, if the heading below is core/GetDeviceInfo
, the HTTP header X-JNAP-Action
in the request will be http://linksys.com/jnap/core/GetDeviceInfo
.
Most actions require authorization provided by the X-JNAP-Authorization
HTTP header. The header is a basic access authentication with the username admin
. An example of the value of X-JNAP-Authorization
in pseudocode would be:
"Basic "+base64("admin:"+password)
For example, if the password was password
, the header would be Basic YWRtaW46cGFzc3dvcmQ=
This action returns the password hint.
This action returns the restrictions for the admin password.
This action returns information about the router including the model, firmware, and a list of supported actions.
This action returns whether the admin password is the default password.
This action returns every device that has connected to the router (whether it is currently connected or not) with information such as it's local IP address (if currently connected), hostname, MAC addresses, device model (if detected), and operating system (if detected). Surprisingly, this action does not require authorization.
sinceRevision
an integer that, when provided, makes the response only contain devices that have connected since the specified revision.
This action returns the router-assigned GUID of the device performing the request.
This action returns the firewall ALG settings.
This action returns the timestamp of the last time the router checked for an update.
This action returns the time zone of the router.
This action returns information associated with every connected device including its MAC address, Mbps, band (2.4GHz, 5GHz, ...), and signal decibels. Surprisingly, this action does not require authorization.
Same as networkconnections/GetNetworkConnections
, but with the radio ID.
This action returns the parental controls settings, such as if it's enabled and rules.
This action returns QoS settings.
This action returns WLAN QoS settings.
This action returns DHCP leases for every connected device.
This action returns ethernet port connections.
This action returns whether express forwarding is enabled.
This action returns IPv6 settings.
Same as router/GetIPv6Settings
, but with more information.
This action returns LAN settings.
This action returns the MAC address clone settings.
This action returns routing settings.
This action returns information about the WAN status of the router.
This action returns a bit more information than router/GetWANStatus
.
This action returns a bit more information than router/GetWANStatus2
.
This action returns a list of activated LEDs on the router.
This action returns DHCP log entries.
firstEntryIndex
an integerentryCount
an integer
This action returns incoming log entries.
firstEntryIndex
an integerentryCount
an integer
This action returns log settings.
This action returns outgoing log entries.
firstEntryIndex
an integerentryCount
an integer
This action returns security log entries.
firstEntryIndex
an integerentryCount
an integer
This action returns management settings of the router.
Same as routermanagement/GetManagementSettings
, but with more information.
This action returns the remote management status of the router.
This action returns UPnP settings.
This action returns a list of external storage devices.
This action returns the hours that wireless access is permitted by parental controls.
This action validates the password provided with the X-JNAP-Authorization
.
This action instructs the router to reboot.
This action sets the router admin password, NOT the network password.
adminPassword
a string set to the passwordpasswordHint
a hint viewable by anyone connected to the network
This action sets properties for a specified device.
deviceID
the device GUID assigned by the routerpropertiesToModify
an array of objects of properties to modifyname
the property to modify. known values are:urn:cisco-com:ui:qos
(QoS)value
the value to set the property- QoS
userPrioritized
prioritizes the device over other devices
- QoS
This action sets the interval at which to check for updates and whether to automatically check for updates.
autoUpdateWindow
an object containing information on when to check for updatesdurationMinutes
interval at which to check for updates in minutesstartMinute
updatePolicy
a string set toManual
orAutomaticallyCheckAndInstall
This action instructs the router to perform a firmware upgrade.
This action returns information about the guest network, such as if it's enabled, its SSID, and password.
This action sets the settings for the guest network.
isGuestNetworkEnabled
a boolean that is set to true when the guest network will be enabled.maxSimultaneousGuests
an integer that is set to the maximum number of devices that are allowed to be connected to the guest network.radios
an array containing information about the networkbroadcastGuestSSID
a string containing the SSID for the guest networkguestPassword
a string containing the guest passwordguestSSID
a string containing the guest SSIDisEnabled
a boolean that is set to true when the guest network is enabled. only takes effect whenisGuestNetworkEnabled
is set to trueradioID
a string containing the radio ID. can be obtained withguestnetwork/GetGuestRadioSettings
This action sets the time zone for the router.
autoAdjustForDST
a boolean set to true when configured to automatically adjust for daylight savings timetimeZoneID
the id for the time zone
This action sets the parental controls settings.
isParentalControlEnabled
a boolean that is set to true when parental controls are enabledrules
an array of objects of rulesblockedURLs
an array of blocked URLsdescription
a string with no meaningisEnabled
a booleanmacAddresses
an array of affected MAC addresseswanSchedule
an object of days and restricted hourssunday
a 48-length string of restricted hours. every character in the string is either a 0 or a 1. 0 means restricted and 1 means allowed. the numbers are in 30-minute intervals. for example, a value of "0101..." would restrict access from 12am-12:30am and 1am-1:30ammonday
same as sundaytuesday
same as sundaywednesday
same as sundaythursday
same as sundayfriday
same as sundaysaturday
same as sunday
This action enables or disables LEDs on the router.
isSwitchportLEDEnabled
a boolean
This action enables or disables logging.
isLoggingEnabled
a boolean
This action returns VLAN tagging profiles.
This action returns VLAN tagging settings.
This action returns information about the main network, such as its SSID and password.
Same as wirelessap/GetRadioInfo
, but with more information.
Same as wirelessap/GetRadioInfo2
, but with more information.
This action sets the SSID and password for the main networks.
bandSteeringMode
a string set to the band steering modeisBandSteeringEnabled
a boolean set to true when band steering is enabledradios
an array of objects describing settings for different frequenciesradioID
the ID of the frequencysettings
an object containing the settings of the frequencybroadcastSSID
a boolean set to false when the network is hiddenchannel
channelWidth
isEnabled
mode
security
a string set to the security protocolssid
wpaPersonalSettings
an object containing the passwordpassphrase
a string set to the password of the network