Identification & things to know


Identification is made using cookies (via phpsessid).
Each call must be made with a cookie called PHPSESSID,
with a shared value that authenticates you.
To get this sessid, connect on www.k-net.fr, or use the /auth method.
If such cookie is not given, all calls will return 401.
If the value sent is obsolete, you will still get a 401 Unauthorized.

If you try to make an unauthorized call, a 403 Forbidden will be returned.
As an admin, you can do every thing.
As a user, you can only handle your router.

Almost each call contains the target mac address, as a first uri-argument.
This mac address must be a 12-char string, ie without separator.

Index

Resources

/auth/{user}/{passwd}/

resource-wide template parameters
parameter value description
userstringyour username
passwdstringyour password
Methods

GET

/auth/{user}/{passwd}/

try to authenticate yourself

Example request URI(s):
  • /auth/jack/azerty/
Query parameter(s)
Example query:
GET /auth/jack/azerty/ HTTP/1.1
User-Agent: curl/7.37.0
Host: 127.0.0.1
Accept: */*
Result(s)
available response representations:

/get_config/{mac}/{version}/

resource-wide template parameters
parameter value description
macmacThe mac address of the router, without separator
version (optional)intThe revision of the document
Methods

GET

/get_config/{mac}/

This will retrieve the stored configuration about this router.
If version is not given, the last configuration will be retrieved.

Example request URI(s):
  • /get_config/04A151301C41/
  • /get_config/841b5e52bae7/50/
Query parameter(s)
Example query:
GET /get_config/841b5e52bae7/ HTTP/1.1
User-Agent: curl/7.37.0
Host: 127.0.0.1
Accept: */*
Cookie: PHPSESSID=kvfljqubp0ve1c8j9219c5gp44
Result(s)
available response representations:

/set_config/

Methods

POST

/set_config/

This will store a new configuration for a router.

Query parameter(s)
Example query:
POST /set_config/ HTTP/1.1
Host: 127.0.0.1
Connection: keep-alive
Content-Length: 1718
User-Agent: curl/7.37.0
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Accept-Encoding: gzip,deflate
Cookie: PHPSESSID=kvfljqubp0ve1c8j9219c5gp44

{
 "active_script_v6": false,
 "add_rh": false,
 "block_wan": false,
 "change_mac_vlan_tv": true,
 "client_pro": false,
 "date_create": "2014-10-06 15:50:16.463319",
 "dhcp_lease": 240,
 "dhcpd_dmdns": true,
 "dhcpd_endip": "192.168.1.100",
 "dhcpd_startip": "192.168.1.10",
 "dhcpd_static": [],
 "firmware_version": "10",
 "get_ip_dhcp": true,
 "igmp_version": 2,
 "ipv6_service": "",
 "lan_ipaddr": "192.168.1.1",
 "lan_lease": 240,
 "lan_proto": true,
 "mac_bridge": "",
 "mode_bridge": false,
 "mode_cpe": true,
 "model": "v2",
 "ms_enable": false,
 "multicast_pass": true,
 "new_mac_vlan_tv": "00:05:69:dd:ee:fe",
 "portforward": [],
 "rrule": "",
 "smbd_autoshare": 1,
 "smbd_passwd": "",
 "smbd_share_desc": "PARTAGE SAMBA - KBOX",
 "smbd_share_directory": "/mnt",
 "smbd_share_name": "KBOX",
 "smbd_user": "",
 "tv_no_vlan": false,
 "udpxy_clients": 15,
 "udpxy_enable": true,
 "udpxy_miface": "vlan1989",
 "udpxy_port": 3333,
 "update_by": "Jack",
 "update_ip": "192.168.1.5",
 "upnp_enable": false,
 "upnp_lan": true,
 "usb_enable": false,
 "vlan1971hwname": "et0",
 "vlan1971ports": "0t 8",
 "vlan1989hwname": "et0",
 "vlan1989ports": "0t 4 8",
 "vlan1ports": "1 2 3 8*",
 "vlan_admin": "vlan2",
 "vlan_internet": "vlan1971",
 "vlan_tv": "vlan1989",
 "wan_dns": [],
 "wl0_akm": "psk2",
 "wl0_channel": 0,
 "wl0_closed": false,
 "wl0_crypto": "aes",
 "wl0_gmode": 1,
 "wl0_maclist": [],
 "wl0_macmode": "disabled",
 "wl0_nbw": 20,
 "wl0_net_mode": "n-only",
 "wl0_nmcsidx": 32,
 "wl0_nmode": 1,
 "wl0_nreqd": 1,
 "wl0_radio": true,
 "wl0_security_mode": "wpa2_personal",
 "wl0_ssid": "KNET_ccddeeff",
 "wl0_wpa_psk": "morCrjcV0kKUM",
 "workgroup": "WORKGROUP",
 "mac_address": "aabbccddeeff"
}
Result(s)
available response representations:

/infos/{mac}/

Methods

GET

/infos/{mac}/

This will retrieve runtime information about the router (cpu, mem, uptime etc).

Example request URI(s):
  • /infos/04A151301C41/
  • /infos/841b5e52bae7/
Query parameter(s)
Example query:
GET /infos/841b5e52bae7/ HTTP/1.1
User-Agent: curl/7.37.0
Host: 127.0.0.1
Accept: */*
Cookie: PHPSESSID=kvfljqubp0ve1c8j9219c5gp44
Result(s)
available response representations:

/all_versions/{mac}/

Methods

GET

/all_versions/{mac}/

This will retrieve all stored configuration for this router.

Example request URI(s):
  • /all_versions/04A151301C41/
  • /all_versions/841b5e52bae7/
Query parameter(s)
Example query:
GET /all_versions/841b5e52bae7/ HTTP/1.1
User-Agent: curl/7.37.0
Host: 127.0.0.1
Accept: */*
Cookie: PHPSESSID=kvfljqubp0ve1c8j9219c5gp44
Result(s)
available response representations:

/m3u/{mac}/

Methods

GET

/m3u/{mac}/

Get a m3u file.

Example request URI(s):
  • /m3u/04A151301C41/
  • /m3u/841b5e52bae7/
Query parameter(s)
Example query:
GET /m3u/841b5e52bae7/ HTTP/1.1
User-Agent: curl/7.37.0
Host: 127.0.0.1
Accept: */*
Cookie: PHPSESSID=kvfljqubp0ve1c8j9219c5gp44
Result(s)
available response representations:

/log/{mac}/{nb_line}/

resource-wide template parameters
parameter value description
nb_line (optional)integerThe number of line you will get back. You will always get the last of them.
Methods

GET

/log/{mac}/

Get router system logs.

Example request URI(s):
  • /log/04A151301C41/
  • /log/841b5e52bae7/50
Query parameter(s)
Example query:
GET /log/841b5e52bae7/10/ HTTP/1.1
User-Agent: curl/7.37.0
Host: 127.0.0.1
Accept: */*
Cookie: PHPSESSID=kvfljqubp0ve1c8j9219c5gp44
Result(s)
available response representations:

/ping/{mac}/{address}/{count}/{pkt_size}/

resource-wide template parameters
parameter value description
addressstringThe address to ping. This can only be an IPv4.
count (optional)intThe number of ICMP echo request packet to send.
pkt_size (optional)intThe size of each packet, in byte. Can be useful to test the network behavior (MTU etc).
Methods

GET

/ping/{mac}/{address}/{count}/{pkt_size}/

Ping an host from the router.
Note that the 'count' params must be set in order to use this (misconception, again!)

Example request URI(s):
  • /ping/04A151301C41/178.250.208.80/
  • /ping/04A151301C41/178.250.208.80/20/
  • /ping/841b5e52bae7/178.250.208.80/50/1516/
Query parameter(s)
Example query:
GET /ping/841b5e52bae7/k-net.fr/ HTTP/1.1
User-Agent: curl/7.37.0
Host: 127.0.0.1
Accept: */*
Cookie: PHPSESSID=kvfljqubp0ve1c8j9219c5gp44
Result(s)
available response representations:

/scan_wifi/{mac}/

Methods

GET

/scan_wifi/{mac}/

This will scan the wireless channels around the router.
A lot of handy informations will be retrieved.

Query parameter(s)
Example query:
GET /scan_wifi/841b5e52bae7/ HTTP/1.1
User-Agent: curl/7.37.0
Host: 127.0.0.1
Accept: */*
Cookie: PHPSESSID=kvfljqubp0ve1c8j9219c5gp44
Result(s)
available response representations:

/reboot/{mac}/

Methods

GET

/reboot/{mac}/

Reboot a router.

Query parameter(s)
Example query:
GET /reboot/841b5e52bae7/ HTTP/1.1
User-Agent: curl/7.37.0
Host: 127.0.0.1
Accept: */*
Cookie: PHPSESSID=kvfljqubp0ve1c8j9219c5gp44
Result(s)
available response representations:

/reset/{mac}/

Methods

GET

/reset/{mac}/

Reset a router.

Query parameter(s)
Example query:
GET /reset/841b5e52bae7/ HTTP/1.1
User-Agent: curl/7.37.0
Host: 127.0.0.1
Accept: */*
Cookie: PHPSESSID=kvfljqubp0ve1c8j9219c5gp44
Result(s)
available response representations:

/trace/{mac}/{address}/{max_hops}/{max_wait}/

resource-wide template parameters
parameter value description
addressstringThe address to trace. This can only be an IPv4.
max_hops (optional)intLimit the trace to the first 'n' hops.
max_wait (optional)intLimit the waiting time for each probe, in sec.
Decrease this value makes the call faster.
Must be between 0 and 5, included.
Methods

GET

/trace/{mac}/{address}/

Run a traceroute from the router.

Example request URI(s):
  • /trace/841b5e52bae7/178.250.208.80/
  • /trace/841b5e52bae7/178.250.208.80/10/5/
Query parameter(s)
Example query:
GET /trace/841b5e52bae7/178.250.208.80/ HTTP/1.1
User-Agent: curl/7.37.0
Host: 127.0.0.1
Accept: */*
Cookie: PHPSESSID=kvfljqubp0ve1c8j9219c5gp44
Result(s)
available response representations:

/wol/{mac}/{peripheral_mac}/

resource-wide template parameters
parameter value description
peripheral_macstringThe mac address to be woken up.
Methods

GET

/wol/{mac}/{peripheral_mac}/

Wake up a slave.
The call uses a so-called "magic" packet, send through
a wired network.
Also, please note that this call can be used to make a "wake on lan",
and not a "wake on wireless lan".

Example request URI(s):
  • /trace/841b5e52bae7/eca86baa4597/
Query parameter(s)
Example query:
GET /trace/841b5e52bae7/eca86baa4597/ HTTP/1.1
User-Agent: curl/7.37.0
Host: 127.0.0.1
Accept: */*
Cookie: PHPSESSID=kvfljqubp0ve1c8j9219c5gp44
Result(s)
available response representations:

/list_mac/

Methods

GET

/list_mac/

Get the list of your mac. Only usefull for simple user, as
admin can play with all of them.

Query parameter(s)
Example query:
GET /list_mac/ HTTP/1.1
User-Agent: curl/7.37.0
Host: localhost
Accept: */*
Result(s)
available response representations: