The information contained in this document is subject to change. This document contains proprietary information, which is protected by copyright
laws. All rights are reserved. No part of this document may be photocopied, reproduced or translated to another language or program language
without prior written consent of RFI Engineering B.V.
RefGuide_U-routerNGW_v1.01.docx
Page: 40(
57)
14 API Reference
The U-router NGW contains an API based on REST. It accepts form-encoded request bodies, returns
JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.
14.1 Base URL
The API can be found on the https interface of the U-router NGW. The default IP address of the U-
router NGW is
192.168.168.1
. In this manual we use the default IP address and the default user
‘
rfi
’ for the examples below.
BASE URL
https://ip_address/api
Where ip_address is the IP address of the U-router NGW.
14.2 Authentication
Authentication to the API is performed via HTTP Basic Auth. Provide your U-router NGW username
as the basic auth username value and your password as the auth password value. All API requests
can be made over HTTPS. HTTP access has been disabled, calls made over plain HTTP will fail and
will redirect to HTTPS. API requests without authentication will also fail.
AUTHENTICATED REQUEST
curl https://ip_address/api/status -u user:password
Where ip_address is the IP address of the U-router NGW and -u indicates the user:password
combination.
14.3 Errors
The U-router NGW API uses conventional HTTP response codes to indicate the success or failure of
an API request. In general: Codes in the 2xx range indicate success. Codes in the 4xx range indicate
an error that failed given the information provided (e.g., a required parameter was omitted, a charge
failed, etc.). Codes in the 5xx range indicate an error with the U-router NGW.
HTTP STATUS CODE SUMMARY
200 – OK
Everything worked as expected.
400 – Bad Request
The request was unacceptable, often due to missing
a required parameter.
401 - Authorization Required
Failure to properly authenticate yourself in the
request.
503 – Service Not Available
Something went wrong on the U-router NGW server
end.
ATTRIBUTES
status
String stating ‘error’
message
String describing the error. For example: String
for '{ip}' is not a valid IP address