Connection API¶
This API provides Freebox connection settings information.
Connection Errors¶
When attempting to access the file connection API, you may encounter the following errors:
| error_code | Description |
|---|---|
| inval | invalid request |
| nodev | no device found with this name |
| noent | no entity found with this name |
| netdown | network is down |
| busy | device is busy |
| invalid_port | invalid port |
| insecure_password | the password is too weak to enable remote access |
| invalid_provider | invalid ddns provider name |
| invalid_next_hop | invalid next hop address (should be a link local address) |
Connection status¶
Connection status object¶
-
ConnectionStatus¶ -
stateenum Read-only¶ State Description going_up connection is initializing up connection is active going_down connection is about to become inactive down connection is inactive
-
typeenum Read-only¶ Type Description ethernet FTTH rfc2684 xDSL (unbundled) pppoatm xDSL
-
mediaenum Read-only¶ Media Description ftth FTTH xdsl xDSL
-
ipv4string Read-only¶ Freebox IPv4 address
NOTE: this field is only available when connection state is up
-
ipv6string Read-only¶ Freebox IPv6 address
NOTE: this field is only available when connection state is up
-
rate_upint Read-only¶ current upload rate in byte/s
-
rate_downint Read-only¶ current download rate in byte/s
-
bandwidth_upint Read-only¶ available upload bandwidth in bit/s
-
bandwidth_downint Read-only¶ available download bandwidth in bit/s
-
bytes_upint Read-only¶ total uploaded bytes since last connection
-
bytes_downint Read-only¶ total downloaded bytes since last connection
-
ipv4_port_rangeint[2] Read-only¶ Some customers share the same IPv4 and each customer is then assigned a port range. The first value is the first port of the assigned range and the second value is the last port (inclusive).
All
PortForwardingConfigmust use ports in this range to be effective.
-
Get the current Connection status¶
-
GET/api/v4/connection/¶ Returns the current
ConnectionStatusExample request:
GET /api/v4/connection/ HTTP/1.1 Host: mafreebox.freebox.fr
Example response:
HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8
{ "success": true, "result": { "type": "ethernet", "rate_down": 61, "bytes_up": 5489542, "rate_up": 0, "bandwidth_up": 100000000, "ipv4": "13.37.42.42", "ipv6": "2a01:e30:d252:a2a0::1", "bandwidth_down": 100000000, "state": "up", "bytes_down": 13332830, "media": "ftth" } }
Connection configuration¶
Connection configuration object¶
-
ConnectionConfiguration¶ -
pingbool¶ should the Freebox respond to external ping requests
-
is_secure_passbool Read-only¶ is the admin password secure enough to enable remote access
-
remote_accessbool¶ enable/disable HTTP remote access
-
remote_access_portint¶ port number to use for remote HTTP access
-
remote_access_min_portint Read-only¶ This field indicate the minimum possible value for remote_access_port (see
ConnectionStatusipv4_port_range)
-
remote_access_max_portint Read-only¶ This field indicate the maximum possible value for remote_access_port (see
ConnectionStatusipv4_port_range)
-
remote_access_ipstring Read-only¶ IPv4 to use for remote access (can be missing if connection is down)
-
api_remote_accessbool Read-only¶ is remote access enabled for apps, or share link
-
wolbool¶ enable/disable Wake-on-lan proxy
-
adblockbool¶ is ads blocking feature enabled
-
adblock_not_setbool Read-only¶ if set to true adblock setting has never been set by the user
-
allow_token_requestbool¶ if false, user has disabled new token request. New apps can’t request a new token. Apps that already have a token are still allowed
-
Get the current Connection configuration¶
-
GET/api/v4/connection/config/¶ Returns the current
ConnectionConfigurationExample request:
GET /api/v4/connection/config/ HTTP/1.1 Host: mafreebox.freebox.fr
Example response:
HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8
{ "success": true, "result": { "ping": true, "is_secure_pass": false, "remote_access_port": 80, "remote_access": false, "wol": false, "adblock": false, "adblock_not_set": false, "api_remote_access": true, "allow_token_request": true, "remote_access_ip": "312.13.37.42" } }
Update the Connection configuration¶
-
PUT/api/v4/connection/config/¶ Updates the
ConnectionConfigurationExample request:
PUT /api/v4/connection/config/ HTTP/1.1 Host: mafreebox.freebox.fr { "ping": true, "wol": false }
Example response:
HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8
{ "success": true, "result": { "ping": true, "is_secure_pass": false, "remote_access_port": 80, "remote_access": false, "wol": false, "adblock": false, "adblock_not_set": false, "api_remote_access": true, "allow_token_request": true, "remote_access_ip": "312.13.37.42" } }
Connection IPv6 configuration¶
Connection IPv6 configuration object¶
Get the current IPv6 Connection configuration¶
-
GET/api/v4/connection/ipv6/config/¶ Returns the current
ConnectionIpv6ConfigurationExample request:
GET /api/v4/connection/ipv6/config/ HTTP/1.1 Host: mafreebox.freebox.fr
Example response:
HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8
{ "success": true, "result": { "ipv6_enabled": true, "delegations": [ { "prefix": "2a01:e30:d252:a2a0::/64", "next_hop": "" }, { "prefix": "2a01:e30:d252:a2a1::/64", "next_hop": "" }, { "prefix": "2a01:e30:d252:a2a2::/64", "next_hop": "" }, { "prefix": "2a01:e30:d252:a2a3::/64", "next_hop": "" }, { "prefix": "2a01:e30:d252:a2a4::/64", "next_hop": "" }, { "prefix": "2a01:e30:d252:a2a5::/64", "next_hop": "" }, { "prefix": "2a01:e30:d252:a2a6::/64", "next_hop": "" }, { "prefix": "2a01:e30:d252:a2a7::/64", "next_hop": "" } ] } }
Update the IPv6 Connection configuration¶
-
PUT/api/v4/connection/ipv6/config/¶ Updates the
ConnectionIpv6ConfigurationExample request:
PUT /api/v4/connection/config/ HTTP/1.1 Host: mafreebox.freebox.fr { "delegations": [ { "prefix": "2a01:e30:d252:a2a2::/64", "next_hop": "fe80::be30:5bff:feb5:fcc7" } ] }
Example response:
HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8
{ "success": true, "result": { "ipv6_enabled": true, "ipv6ll": "fe80::224:d4ff:acac:ecec", "delegations": [ { "prefix": "2a01:e30:d252:a2a0::/64", "next_hop": "" }, { "prefix": "2a01:e30:d252:a2a1::/64", "next_hop": "" }, { "prefix": "2a01:e30:d252:a2a2::/64", "next_hop": "fe80::d252:5bff:feb5:fcc7" }, { "prefix": "2a01:e30:d252:a2a3::/64", "next_hop": "" }, { "prefix": "2a01:e30:d252:a2a4::/64", "next_hop": "" }, { "prefix": "2a01:e30:d252:a2a5::/64", "next_hop": "" }, { "prefix": "2a01:e30:d252:a2a6::/64", "next_hop": "" }, { "prefix": "2a01:e30:d252:a2a7::/64", "next_hop": "" } ] } }
Connection xDSL status [UNSTABLE]¶
xDSL status object [UNSTABLE]¶
-
XdslStatus¶ -
statusenum Read-only¶ Status Description down unsynchronized training synchronizing step 1/4 started synchronizing step 2/4 chan_analysis synchronizing step 3/4 msg_exchange synchronizing step 4/4 showtime Ready disabled Disabled
-
protocolenum Read-only¶ Protocol Description t1413 T1.413 adsl1_a ADSL adsl2_a ADSL2 adsl2plus_a ADSL2+ readsl2 ReachDSL adsl2_m ADSL2 annex M adsl2plus_m ADSL2+ annex M unknown Unknown
-
modulationenum Read-only¶ Protocol Description adsl ADSL vdsl VDSL
-
uptimeint Read-only¶ uptime in seconds
-
xDSL stats object [UNSTABLE]¶
-
XdslStats¶ -
maxrateint Read-only¶ ATM max rate in kbit/s
-
rateint Read-only¶ ATM rate in kbit/s
-
snrint Read-only¶ in dB
-
attnint Read-only¶ in dB
-
snr_10int Read-only¶ in dB/10
-
attn_10int Read-only¶ in dB/10
-
fecint Read-only¶
-
crcint Read-only¶
-
hecint Read-only¶
-
esint Read-only¶
-
sesint Read-only¶
-
phyrbool Read-only¶
-
ginpbool Read-only¶
-
nitrobool Read-only¶
-
rxmtint Read-only¶ only available when phyr is on
-
rxmt_corrint Read-only¶ only available when phyr is on
-
rxmt_uncorrint Read-only¶ only available when phyr is on
-
rtx_txint Read-only¶ only available when ginp is on
-
rtx_cint Read-only¶ only available when ginp is on
-
rtx_ucint Read-only¶ only available when ginp is on
-
Get the current xDSL infos¶
-
GET/api/v4/connection/xdsl/¶ Returns the current
XdslInfosExample request:
GET /api/v4/connection/xdsl/ HTTP/1.1 Host: mafreebox.freebox.fr
Example response:
HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8
{ "success": true, "result": { "status": { "status": "showtime", "protocol": "adsl2plus_a", "uptime": 5017, "modulation": "adsl" }, "down": { "es": 43, "phyr": true, "attn": 0, "snr": 7, "nitro": true, "rate": 28031, "hec": 0, "crc": 0, "rxmt_uncorr": 0, "rxmt_corr": 0, "ses": 43, "fec": 0, "maxrate": 30636, "rxmt": 0 }, "up": { "es": 0, "phyr": false, "attn": 23, "snr": 15, "nitro": true, "rate": 1022, "hec": 0, "crc": 0, "rxmt_uncorr": 0, "rxmt_corr": 0, "ses": 0, "fec": 0, "maxrate": 1022, "rxmt": 0 } } }
Connection FTTH status [UNSTABLE]¶
FTTH status object [UNSTABLE]¶
-
FtthStatus¶ -
sfp_presentboolean Read-only¶
-
sfp_alim_okboolean Read-only¶
-
sfp_has_power_reportboolean Read-only¶
-
sfp_has_signalboolean Read-only¶
-
linkboolean Read-only¶
-
sfp_serialstring Read-only¶
-
sfp_modelstring Read-only¶
-
sfp_vendorstring Read-only¶
-
sfp_vendorstring Read-only
-
sfp_pwr_txint Read-only¶ scaled by 100 (in dBm)
-
sfp_pwr_rxint Read-only¶ scaled by 100 (in dBm)
-
Get the current FTTH status¶
-
GET/api/v4/connection/ftth/¶ Returns the current
FtthStatusExample request:
GET /api/v4/connection/ftth/ HTTP/1.1 Host: mafreebox.freebox.fr
Example response:
HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8
{ "success": true, "result": { "sfp_has_power_report": true, "sfp_has_signal": false, "sfp_model": "SPBD-1250E4H2RDB", "sfp_vendor": "DELTA", "sfp_pwr_tx": -1172, "sfp_pwr_rx": -3698, "link": false, "sfp_alim_ok": true, "sfp_serial": "DE104900000471", "sfp_present": true } }
Connection DynDNS status¶
DynDnsProvider status object¶
-
DDNSStatus¶ -
statusenum¶ Status Description disabled Disabled ok Ok wait Updating reqfail Request failed authfail Authentication error nocredential Invalid credential ipinval Invalid IP hostinval Invalid hostname abuse Blocked because of abuse dnserror DNS error unavailable Service unavailable nowan Unable to get wan IP unknown Unknown
-
next_refreshint¶ next refresh timestamp
-
last_refreshint¶ last refresh timestamp
-
next_retryint¶ next retry timestamp
-
last_errorint¶ last error timestamp
-
Get the status of a DynDNS service¶
Right now the supported dynamic dns providers are:
- ovh
- dyndns
- noip
-
GET/api/v4/connection/ddns/{provider}/status/¶ Returns the current
DDNSStatusExample request:
GET /api/v4/connection/ddns/dyndns/status/ HTTP/1.1 Host: mafreebox.freebox.fr
Example response:
HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8
{ "success": true, "result": { "last_error": 1354127350, "status": "hostinval", "next_refresh": 0, "last_refresh": 0, "next_retry": 0 } }
Connection DynDNS configuration¶
DynDns config object¶
Get the config of a DynDNS service¶
-
GET/api/v4/connection/ddns/{provider}/¶ Returns the current
DDNSConfigExample request:
GET /api/v4/connection/ddns/dyndns/ HTTP/1.1 Host: mafreebox.freebox.fr
Example response:
HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8
{ "success": true, "result": { "enabled": true, "hostname": "test", "user": "test" } }
Set the config of a DynDNS service¶
-
PUT/api/v4/connection/ddns/{provider}/¶ Set the
DDNSConfigExample request:
PUT /api/v4/connection/ddns/dyndns/ HTTP/1.1 Host: mafreebox.freebox.fr { "enabled": false, "user": "test", "password": "ssss", "hostname": "ttt" }
Example response:
HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8
{ "success": true, "result": { "enabled": false, "hostname": "ttt", "user": "test" } }