2
REQUESTS
1
Introduction
The MultiConnect
R
rCell is a cellular router that uses a RESTful JSON API for managing configurations, polling
statistics, and issuing commands. This document provides information on the design, patterns, and methods
within the rCell API. The Appendix of this document has additional information for those unfamiliar with the
REST architecture or JSON data format. For additional examples and use-cases, explore the JavaScript within
the rCell website, specifically https://[rcell ip]/js/api.js.
2
Requests
All API requests will be directed to the https://[rcell ip]/api url. The majority of requests follow the same RESTful
pattern. Following the api url will be a collection name or a command directive. For example, information on
the current DHCP settings can be found in the DHCP collection at https://[rcell ip]/api/dhcp. A full list of
collections and commands can be found in section 4. For all examples in this document, the rCell’s IP address is
192.168.2.1.
2.1
Making Requests
The RESTful interface allows users to retrieve data, add data, update data, and delete data using call methods:
GET, POST, PUT and DELETE, respectively. These methods can be set in the HTTP header, or they can be
set in the URI using the key:
method
. Using the URI parameter
method
is a useful way to execute RESTful
requests through a web browser. Additional URI parameters can be found in section 2.9 URI Parameters.
All API requests return a JSON object. The JSON response will always contain the members
code
and
status
.
The
status
member indicates a high-level result of the request and has two possible values:
success
and
fail
. The
code
member is an HTTP response code describing the outcome of the API result. For a full list of response
code values, see section 3.2.2 Error Codes.
If an API call was successful, it may contain the member:
result
. This member contains data that was either
requested or data that was generated as part of the API request. If an API call was unsuccessful, the JSON
response will contain the member
error
. This member is a short description of the failure.
Example:
Retrieving the current DHCP setting using the
method
URI parameter.
1
GET https://192.168.2.1/api/dhcp?method=GET
2
3
S t a t u s
:
H T T P / 1 . 1 200 OK
4
{
5
" c o d e "
:
200
,
6
" r e s u l t "
:
{
7
" d e f a u l t G a t e w a y "
:
" 1 9 2 . 1 6 8 . 2 . 1 "
,
8
" d o m a i n "
:
""
,
9
" e n a b l e d "
:
t r u e
,
10
" f i x e d A d d r e s s e s "
:
[
11
{
12
" ip "
:
" 1 9 2 . 1 6 8 . 2 . 1 5 "
,
13
" mac "
:
"00
:
1 A
:
12
:
19
:
3 F
:
60"
14
}
15
]
,
16
" l e a s e T i m e "
:
8 6 4 0 0
,
17
" l e a s e s "
:
[
18
{
19
" e x p i r a t i o n "
:
7 0 3 5 9
,
20
" h o s t N a m e "
:
" my - pc "
,
21
" ip "
:
" 1 9 2 . 1 6 8 . 2 . 1 0 3 "
,
Multi-Tech Systems, Inc. MultiConnect
R
rCell API Developer Guide
5
Содержание MultiConnect rCell MTR-C2
Страница 1: ...MultiConnect R rCell API Developer Guide ...