Multitech MTR-H5, MTR-C2, MultiConnect rCell MTR-H6,MultiConnect rCell MTR-G3,MultiConnect rCell MTR-EV3, MTR-H6, MTR-G3 Developer's Manual

...
Page 1
MultiConnect
Developer Guide
R
rCell API
Page 2
Copyright and Technical Support
MultiConnect
rCell API Developer Guide Models: MTR-H5, MTR-H6, MTR-G3, MTR-EV3, MTR-C2 (Software Version 3.0.9) S000576, Version 1.0
Copyright
This publication may not be reproduced, in whole or in part, without prior expressed written permission from Multi-Tech Systems, Inc. All rights reserved. Copyrightc 2014, by Multi-Tech Systems, Inc. Multi-Tech Systems, Inc. makes no representations or warranties with respect to the contents hereof and specifically disclaims any implied warranties of merchantability or fitness for any particular purpose. Furthermore, Multi-Tech Systems, Inc. reserves the right to revise this publication and to make changes from time to time in the content hereof without obligation of Multi-Tech Systems, Inc. to notify any person or organization of such revisions or changes. Check Multi-Techs web site for current versions of our product documentation.
Revision History
Revision Date Author Description
0.1 1/4/13 Jason Reiss Initial Document
0.2 1/30/13 Jason Reiss Auto-Gen Script and Reference Updates
0.3 2/27/13 Jason Reiss Removed Unused Elements
0.4 3/11/13 Jason Reiss Updated Logout Instructions
0.5 6/1/13 Sean Godinez Updated Auto-Gen Scripts and Document Content
0.6 6/6/13 Sean Godinez Added Statistics and Help Section
0.7 11/21/13 Sean Godinez Updated for rCell v3.0.9
0.8 12/2/13 Sean Godinez Added ’DRAFT’ Watermark
0.9 12/4/13 Jason Reiss Updated document layout
1.0 1/15/14 Sean Godinez Release
Trademarks
Multi-Tech Registered Trademarks: MultiConnect, Multi-Tech, and the Multi-Tech logo. All other products and technologies are the trademarks or registered trademarks of their respective holders.
Contacting Multi-Tech
Knowledge Base
The Knowledge Base provides immediate access to support information and resolutions for all Multi-Tech products. Visit http://www.multitech.com/kb.go.
Installation Resources
To download manuals, firmware, and software, visit http://www.multitech.com/setup/product.go.
Support Portal
To create an account and submit a support case directly to our technical support team, visit: https://support.multitech.com.
Technical Support
Business Hours: M-F, 9am to 5pm CST
Country By Email By Phone
Europe, Middle East, Africa: support@multitech.co.uk +(44) 118 959 7774
U.S., Canada, all others: support@multitech.com (800) 972-2439 or (763) 717-5863
World Headquarters
Multi-Tech Systems, Inc. 2205 Woodale Drive Mounds View, MN 55112 United States Phone: 800-328-9717 or 763-785-3500 Fax: 763-785-9874
Warranty
To read the warranty statement for your product, please visit: http://www.multitech.com/warranty.go.
2 Multi-Tech Systems, Inc. MultiConnect
R
rCell API Developer Guide
Page 3
CONTENTS
Contents
1 Introduction 5
2 Requests 5
2.1 Making Requests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2 Logging In . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.3 Logging Out . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.4 Who Am I . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.5 Passing JSON Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.6 Saving Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.7 Selecting a Version of an API Call . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.8 Element Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.9 URI Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3 Responses 10
3.1 Success . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.1.1 Success response format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.2 Error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.2.1 Error response format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.2.2 Error Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
4 Commands and Collections 12
4.1 Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
4.2 Collections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
4.3 Collection Details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
4.3.1 autoDialout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
4.3.2 autoReboot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.3.3 bluetooth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.3.4 brand . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.3.5 ddns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.3.6 devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.3.7 dhcp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
4.3.8 dns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
4.3.9 filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
4.3.10 gccp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4.3.11 gps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4.3.12 greTunnels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
4.3.13 ipPipes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
4.3.14 ipsecTunnels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4.3.15 lan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
4.3.16 nat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
4.3.17 networks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
4.3.18 ppp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
4.3.19 remoteAccess . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
4.3.20 remoteManagement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
4.3.21 routes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
4.3.22 serial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
4.3.23 sntp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
4.3.24 syslog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
4.3.25 system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
4.3.26 users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
4.3.27 wifi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Multi-Tech Systems, Inc. MultiConnect
R
rCell API Developer Guide 3
Page 4
CONTENTS
5 Statistics 28
5.1 dns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
5.2 gps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
5.3 gre . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
5.4 ipsec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
5.5 lan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
5.6 modbus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
5.7 ppp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
5.8 serial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
5.9 service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
5.10 wlan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
6 Appendix 34
6.1 REST Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
6.2 JSON Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
6.3 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
6.3.1 Using Curl to log in . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
6.3.2 Using Curl to enable PPP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
6.3.3 Using Curl to add a firewall DNAT rule . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
6.3.4 Using Curl to add a firewall filter rule . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
6.3.5 Using Curl to delete a firewall filter rule by name . . . . . . . . . . . . . . . . . . . . . . 37
6.3.6 Using Curl to delete a firewall filter rule by index . . . . . . . . . . . . . . . . . . . . . . 37
6.3.7 Using Curl to save current configurations and reboot . . . . . . . . . . . . . . . . . . . . 37
4 Multi-Tech Systems, Inc. MultiConnect
R
rCell API Developer Guide
Page 5
2 REQUESTS
1 Introduction
R
The MultiConnect
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 G ET https://192.168.2.1/api/dhcp?method=GET 2 3 S t a tus : HTT P /1. 1 2 00 OK 4 { 5 " c ode " : 2 0 0 , 6 " r e sult " : { 7 " de f a u l t G a t e way " : "192 . 1 6 8 . 2 . 1 " , 8 " d o m a i n " : "" , 9 " e n a b l e d " : tr u e ,
10 " fi x e d A d d r e s ses " : [ 11 { 12 " ip" : "1 9 2 . 1 6 8 . 2.15" , 13 " ma c " : " 0 0 : 1 A : 1 2 : 1 9 : 3 F : 60 " 14 } 15 ] , 16 " l e a s e T i m e " : 864 0 0 , 17 " l e a s e s " : [ 18 { 19 " e x p i ration " : 70 359 , 20 " h o s tName " : " my - p c " , 21 " ip" : "1 9 2 . 1 6 8 . 2 .103" ,
Multi-Tech Systems, Inc. MultiConnect
R
rCell API Developer Guide 5
Page 6
2 REQUESTS
22 " ma c " : " 0 0 : 3 a : 8 3 : 1 0 : 2 4 : DC " 23 } 24 ] , 25 " m a x L e a s e s " : 20 0 , 26 " o p t i o n s " : [ " d hcp - au t h o r i t a t i v e " ] , 27 " r a n g e E n d " : "192.16 8 . 2 . 2 5 4 " , 28 " ra n g e S t art " : "19 2 . 1 6 8 . 2 . 1 0 0 " , 29 " su b n e t A d d r ess " : "192. 1 6 8 . 2 . 0 " , 30 " su b n e t M ask " : "25 5 . 2 5 5 . 2 5 5 . 0 " 31 }, 32 " s t atus " : " su c c e ss " 33 }
The API allows requests to path to specific elements or groups of embedded elements. For example, if a user only wanted to know if DHCP was enabled, they could make the request: https://[rcell ip]/api/dhcp/enabled.
Example: Path to an element within the DHCP collection.
1 G ET https://192.168.2.1/api/dhcp/enabled 2 3 S t a tus : HTT P /1. 1 2 00 OK 4 { 5 " c ode " : 2 0 0 , 6 " r e sult " : t r u e , 7 " s t atus " : " su c c e ss " 8 }
Accessing objects within an array can be done using the index of the desired object in the path. Some collections support using an object’s unique identifier in place of the object’s index; generally, this unique identifier is a member called name or guid. For example, suppose an rCell was configured with a GRE tunnel named MyGreTunnel, and a user wanted to know the IP address of the remote end point of that tunnel. The user could make a RESTful GET request to https://[rcell ip]/api/greTunnels/MyGreTunnel/remoteIp.
Example: Path to an element within an object in an array using the object’s unique identifier.
1 G ET https://192.168.2.1/api/greTunnels/MyGreTunnel/remoteIp 2 3 S t a tus : HTT P /1. 1 2 00 OK 4 { 5 " c ode " : 2 0 0 , 6 " r e sult " : "1 6 6 . 1 8 4 .38.73" , 7 " s t atus " : " su c c e ss " 8 }
2.2 Logging In
To use the API, a user must be authorized and have equal or greater privileges than the API call they are invoking. A user can login with valid credentials by passing their username and password to the login URL ( https://192.168.2.1/api/login ) either as URI parameters or within a JSON object. The following call will login the user admin, and return the session information including an authorized token. The API attempts to cache the token as a cookie in the user’s web browser for authorizing future calls. As an alternative to using a browser cookie, this token can be passed as a URI parameter using the key: token. Additional URI parameters can be found in section 2.9 URI Parameters.
Example: Login using username ’admin’ and password ’admin’.
1 G ET https://192.168.2.1/api/login?username=admin&password=admin 2 3 S t a tus : HTT P /1. 1 2 00 OK
6 Multi-Tech Systems, Inc. MultiConnect
R
rCell API Developer Guide
Page 7
2 REQUESTS
4 { 5 " c ode " : 2 0 0 , 6 " r e sult " : { 7 " a d d r e s s " : "192.16 8 . 2 . 1 0 3 " , 8 " pe r m i s s ion " : "ad m i n " ,
9 " p o r t " : "5 9 4 8 6 " , 10 " t i m e s t a m p " : "2 : 58 : 4 0 : 38 9 " , 11 " t o k e n " : "B7083A0B14C0F0BEFFBE D 8 9 B 9 9 E F B C ", 12 " u s e r " : "ad m i n " 13 }, 14 " s t atus " : " su c c e ss " 15 }
A token may timeout due to inactivity. The timeout configuration is in the rCell’s Remote Access collection ( api/remoteAccess/timeoutSeconds ). There are two authorizers, one for website access and one for non-web browser usage, such as command line utilities like wget and curl. The same user can not be logged in through the same authorizer from more than one IP address. If a user is already logged in and attempts to login from another IP address, a conflict error will be returned. A user can logout from any IP address with the proper credentials.
2.3 Logging Out
The logout call requires that the caller has equal or greater permissions than the user they are logging out. If a user wants to logout, they can pass their authorized token in the following call:
Example:. https://192.168.2.1/api/logout?token=ABCDEF1234567890ABCDEF12345678
To logout another user (guest), a user with equal or greater permissions can use their token to authorize the call:
Example: https://192.168.2.1/api/logout?logoutUser=guest&token=ABCDEF1234567890ABCDEF12345678
Credentials can also be passed with the logout command to authorize the logout call of another user:
Example: https://192.168.2.1/api/logout?username=admin&password=admin&logoutUser=guest
2.4 Who Am I
At any point, a user can retrieve their session information using the following API call:
Example:
1 G ET https://192.168.2.1/api/whoami
2
3 S t a tus : HTT P /1. 1 2 00 OK
4 {
5 " c ode " : 2 0 0 ,
6 " r e sult " : {
7 " a d d r e s s " : "192.16 8 . 2 . 1 0 3 " ,
8 " pe r m i s s ion " : "ad m i n " ,
9 " p o r t " : "5 9 4 8 6 " , 10 " t i m e s t a m p " : "2 : 58 : 4 0 : 38 9 " , 11 " t o k e n " : "B7083A0B14C0F0BEFFBE D 8 9 B 9 9 E F B C ", 12 " u s e r " : "ad m i n " 13 }, 14 " s t atus " : " su c c e ss " 15 }
Multi-Tech Systems, Inc. MultiConnect
R
rCell API Developer Guide 7
Page 8
2 REQUESTS
2.5 Passing JSON Data
Data can be sent to the rCell by passing a JSON object as the request content or by passing a JSON object in the URI parameter: data. As an example, the following request uses a RESTful PUT call to edit the current DHCP configurations by passing in a JSON object with the enabled member set to false
Example: To disable DHCP, send the following request:
https://192.168.2.1/apidhcp?data={"enabled":false}&method=PUT
2.6 Saving Changes
A call to save ( https://[rcell ip]/command/save ) will write current changes to the device settings. Commands are executed using RESTful POST requests. A full list of commands can be found in section 4.1 Commands.
Example: To save the current changes, send a request to:
https://192.168.2.1/api/command/save?method=POST
2.7 Selecting a Version of an API Call
As the rCell API evolves and new features are added, backwards compatibility can be maintained by setting the desired API version within the request. The API version can be set through the version URI parameter, or through the URL path by subscripting the version number with the letter ’v’. If a request has only one version, this value is ignored.
Example: To use version 1 of the API, all API requests would be made through https://[rcell ip]/api/v1/[request path] or https://[rcell ip]/api/[request path]?version=1. If a version is not specified, the request will be executed using the latest API version.
2.8 Element Descriptions
The API provides documentation on collections and elements through https://[rcell ip]/api/help. For a description of an element or group of elements, use the path to retrieve the data and prepend help to the collection component. For example, if a user wanted information on the DHCP element enabled ( https://[rcell ip]/api/dhcp/enabled ), they could submit a RESTful GET request to https://[rcell ip]/api/help/dhcp/enabled.
Example: Retrieving a description of the DHCP member enabled.
1 G ET https://192.168.2.1/api/help/dhcp/enabled
2
3 S t a tus : HTT P /1. 1 2 00 OK
4 {
5 " c ode " : 2 0 0 ,
6 " r e sult " : {
7 " dh c p _ e n a b led " : "en a b l e or disa b l e D H C P s erver ( de f a u l t : tr u e ) : BO O L "
8 },
9 " s t atus " : " su c c e ss " 10 }
The API also provides a separate set of help descriptions that are used by the rCell website for context-sensitive help-on-hover content. The path to each description follows the menu and category embedding of the rCell website.
8 Multi-Tech Systems, Inc. MultiConnect
R
rCell API Developer Guide
Page 9
2 REQUESTS
Example: Retrieving a more human-readable description of the DHCP member enabled.
1 G ET https://192.168.2.1/api/help/Setup/DHCP/Settings/Enabled
2
3 S t a tus : HTT P /1. 1 2 00 OK
4 {
5 " c ode " : 2 0 0 ,
6 " r e sult " : {
7 " Se t u p _ D H C P _ S e t t i n g s _ E n a b l e d " : " Chec k t o use a DHCP serv e r o n n etwor k "
8 },
9 " s t atus " : " su c c e ss " 10 }
2.9 URI Parameters
URI parameters are reserved keys that are used to modify the functionality of API calls, override HTTP header values, and bundle multiple API requests together. Below is a list of available URI keys and descriptions of their functionality.
URI Key Description
fields Applies a RESTful action to multiple collections/elements. Each request path is separated by a comma. Requested
data within a field is returned using the path by replacing ’/’ characters with ’ ’ characters.
Example:
1 G ET https://192.168.2.1/api?fields=lan/ip, serial/client/enabled&method=GET 2 3 S t a tus : HTT P /1. 1 2 00 OK 4 { 5 " c ode " : 2 0 0 , 6 " r e sult " : { 7 " l a n _ i p " : "192. 1 6 8 . 2 . 1 " , 8 " se r i a l _ c l i e n t _ e n a b l e d " : fal s e 9 },
10 " s t atus " : " su c c e ss " 11 }
method Allows passing RESTful action (GET, PUT, POST, & DELETE) in URI. This overrides the HTTP header method.
See section 2.1
apply Allows the request to be applied at the given timestamp without restarting. Currently, only apply=now is
supported.
token Authorized Login Token. This can be passed to authorize an API call. A token is returned upon a successful
login. If a user is logged in, the whoami request will return the users current token. See section 2.2
inactivity Allows requests to be made without bumping the user’s token expiration date. This is useful for automated polling
loops that still want to allow a user to timeout due to inactivity (inactivity=true)
session Reserved for internal use. This member will be overwritten.
data Allows passing a JSON Object in the URI.
default This option will retrieve the factory defaults of a collection when using a RESTful GET request, and set a collection
to its factory defaults when using a RESTful PUT request. (default=true)
version Sets the API version to use during the request. See section 2.7
username User’s login name. Used for logging into the API. See section 2.2
password User’s login password. Used for logging into the API. See section 2.2
logoutUser User to be logged out. Only used on api/logout request. See section 2.3
R
Multi-Tech Systems, Inc. MultiConnect
rCell API Developer Guide 9
Page 10
3 RESPONSES
3 Responses
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 a HTTP response code describing the outcome of the API result. Certain actions or events in the API may result in a URL redirect, such as trying to access API methods when a user is not logged in. In these situations, the JSON response may contain the member referrer.
3.1 Success
In the event of a successful request a success message will be returned with the member status set to success and code set to 200. If data is sent in the response it will be found in the result field.
3.1.1 Success response format
1 S t a tus : HTT P /1. 1 2 00 OK
2 {
3 " c ode ": 20 0 ,
4 " s t atus ": "suc c e s s " ,
5 " r e sult ": { [ J S O N O b ject or Arr a y ] }
6 }
3.2 Error
An error response will always contain the members: code, status, and error. If an error is encountered during a request, the API will halt processing and return an error message. This means that a request with multiple errors will receive a response containing error information on only the first error that the API finds during the processing of that request.
3.2.1 Error response format
1 S t a tus : HTT P /1. 1 [ E r r or Code ] [ Er r o r M e s s age ]
2 {
3 " c ode ": [Er r o r C ode ] ,
4 " s t atus ": "fa i l " ,
5 " e rror ": "[ Er r o r M e ssage ]"
6 }
10 Multi-Tech Systems, Inc. MultiConnect
R
rCell API Developer Guide
Page 11
3 RESPONSES
3.2.2 Error Codes
Code Error
400 Bad Request
401 Unauthorized
403 Forbidden
404 Not Found
405 Method Not Allowed
406 Not Acceptable
408 Request Timeout
409 Conflict
500 Internal Server Error
501 Not Implemented
Multi-Tech Systems, Inc. MultiConnect
R
rCell API Developer Guide 11
Page 12
4 COMMANDS AND COLLECTIONS
4 Commands and Collections
4.1 Commands
The API supports a set of special actions through the Command URL ( api/command ). To execute a command, the call method must be a POST request. A RESTful GET request will return an array of all of the commands.
Command Description Parameters
firmware upgrade Upgrades rCell firmware upgrade file
legacy sync Synchronizes legacy configurations
restart Restarts rCell device
revert Reverts all changes since the last save
save Saves the current configurations
ddns update Pushes DDNS information to the configured DDNS server
download config Downloads the current configurations
loglvl debug Sets the API’s logging level to DEBUG
loglvl info Sets the API’s logging level to INFO
loglvl trace Sets the API’s logging level to TRACE
loglvl warning Sets the API’s logging level to WARNING
radio cmd Send a string directly to the cellular radio
1 { 2 " at": [ A T C O M M AND ] , 3 " t i meout ": [milli s e c o n d s ] 4 }
JSON Data
remove icon Deletes user-supplied icon
remove image Deletes user-supplied image
remove logo Deletes user-supplied logo
reset bluetooth Resets the Bluetooth hardware
reset modem Resets the cellular radio hardware
reset wifi Resets the WiFi hardware
restore defaults Resets the rCell with User-Defined defaults if set, otherwise factory
restore factory Resets the rCell with factory defaults
clean oem Clears User-Defined default configurations returning factory default
save oem Saves current configurations as factory/OEM defaults
save restart Saves the current configurations and restarts the rCell
telit upgrade Upgrades the Telit radio firmware upgrade file
upload config Uploads and sets new configurations configuration file
upload icon Uploads and sets new icon icon file
upload image Uploads and sets new image image file
upload logo Uploads and sets new logo logo file
12 Multi-Tech Systems, Inc. MultiConnect
R
rCell API Developer Guide
Page 13
4 COMMANDS AND COLLECTIONS
4.2 Collections
Collections are groups of related elements used to configure a service or capability. There are four main actions that can be performed on a collection: get, edit, add, and delete. These actions align with RESTful calls: GET, PUT, POST, and DELETE.
Collection Type Description
autoDialout OBJECT allow use of cellular modem directly from serial port
autoReboot OBJECT cause the device to automatically reboot
bluetooth OBJECT allow a device to connect via Bluetooth
brand OBJECT customize icons, images and support information for re-branded rCell
ddns OBJECT dynamic domain name server update remote server when ip address changes
devices ARRAY list of saved devices
dhcp OBJECT DHCP settings
dns OBJECT dns forwarding feature
filters ARRAY list of firewall filters
gccp OBJECT settings for gccp application
gps OBJECT gps service settings
greTunnels ARRAY list of GRE tunnels
ipPipes ARRAY list of configured IP Pipes
ipsecTunnels ARRAY list of IPsec tunnels
lan OBJECT lan interface settings
nat ARRAY list of NAT rules for advanced firewall settings
networks ARRAY list of networks to be used in setting filters and tunnels
ppp OBJECT PPP settings
remoteAccess OBJECT settings to configure remote access of device
remoteManagement OBJECT remote management settings
routes ARRAY list of static routes
serial OBJECT settings for serial port
sntp OBJECT settings for clock synchronization between computer systems
syslog OBJECT settings for syslog support
system OBJECT system attributes
users ARRAY users collection for authentication
wifi OBJECT settings for wi-fi services
4.3 Collection Details
4.3.1 autoDialout
Description: allow use of cellular modem directly from serial port : OBJECT
Element Type Description
eia BOOL enable or disable EIA standard signal characteristics (default:false)
enabled BOOL enable or disable this feature (default:true)
inactivity UINT set inactivity timeout in seconds set to 0 to disable (default:0)
login BOOL enable or disable login requirement (default:true)
port UINT configure port to use when connecting to rCell (default:5000)
raw BOOL enable or disable raw mode (default:false)
Multi-Tech Systems, Inc. MultiConnect
R
rCell API Developer Guide 13
Page 14
4.3.2 autoReboot
Description: cause the device to automatically reboot : OBJECT
Element Type Description
hour UINT based on the mode as either Hour of Day or Hours from Boot
mode STRING DISABLED, TIME, or TIMER (default: DISABLED)
4.3.3 bluetooth
Description: allow a device to connect via Bluetooth : OBJECT
Element Type Description
device OBJECT bluetooth settings of connected device
address STRING mac address of bluetooth device
name STRING name of bluetooth device
devices ARRAY list of bluetooth devices found during last scan
address STRING mac address of device
name STRING label for device
enabled BOOL enable or disable bluetooth feature (default:false)
savedDevices ARRAY list of saved bluetooth devices
address STRING mac address of device
friendlyName STRING user defined name of device
name STRING scanned name of device
4 COMMANDS AND COLLECTIONS
4.3.4 brand
Description: customize icons, images and support information for rebranded rCell : OBJECT
14 Multi-Tech Systems, Inc. MultiConnect
R
rCell API Developer Guide
Page 15
4 COMMANDS AND COLLECTIONS
Element Type Description
address1 STRING address of company for support contact
address2 STRING address of company for support contact
city STRING city of company for support contact
companyName STRING company name for support contact
country STRING country of company for support contact
fax STRING fax number of company for support contact
icon STRING image file name for custom favicon in browser
image STRING image file name for custom image on support page
links ARRAY list of web links for customer support
label STRING label for hyperlink
text STRING text of hyperlink
url STRING url of hyperlink
logo STRING image file name for custom logo in header and on login page
phoneNumbers ARRAY list of phone numbers for customer support
label STRING phone number label
number STRING phone number
showOnDashboard BOOL enable or disable display of brand information on support page (default:false)
state STRING state or province of company for support contact
website STRING website of company for support contact
zipCode STRING zipCode of company for support contact
4.3.5 ddns
Description: dynamic domain name server update remote server when ip address changes : OBJECT
Element Type Description
authentication OBJECT authentication information
password STRING password for ddns account
username STRING username for ddns account
checkIp OBJECT configure remote server to connect to
enabled BOOL enable or disable check IP feature (default:true)
port UINT port on remote server (default:80)
server STRING domain name of remote server (default:’checkip.dyndns.org’)
domain STRING registered domain name
enabled BOOL enable or disable DDNS feature (default:false)
port UINT servers port number (default:80)
retriesMax UINT maximum number of tries to connect before failing (default:5)
server STRING name of server with currently assigned IP address (default:’members.dyndns.org’)
system STRING system registration type, DYNAMIC or CUSTOM (default:DYNAMIC)
updateInterval UINT number of days between forced update (default:28)
4.3.6 devices
Description: list of saved devices : ARRAY
Multi-Tech Systems, Inc. MultiConnect
R
rCell API Developer Guide 15
Page 16
Element Type Description
friendlyName STRING friendly name to associate with device
mac STRING mac address of device
name STRING name of device
4.3.7 dhcp
Description: DHCP settings : OBJECT
Element Type Description
defaultGateway STRING default gateway of network (default:’192.168.2.1’)
domain STRING network domain name
enabled BOOL enable or disable DHCP server (default:true)
fixedAddresses ARRAY list of fixed addresses
ip STRING ip address to assign to client
mac STRING mac address of client
leaseTime UINT number of seconds leases are issued for (default:86400)
leases ARRAY current leases issued by DHCP server
maxLeases UINT maximum number of leases that can be issued (default:200)
options ARRAY an array of additional dhcp options
rangeEnd STRING end ip address of dhcp lease range (default:’192.168.2.254’)
rangeStart STRING start ip address of dhcp lease range (default:’192.168.2.100’)
subnetAddress STRING subnet of network (default:’192.168.2.0’)
subnetMask STRING mask of network (default:’255.255.255.0’)
4 COMMANDS AND COLLECTIONS
4.3.8 dns
Description: dns forwarding feature : OBJECT
Element Type Description
enabled BOOL enable or disable dns server (default:true)
options ARRAY an array of additional dns options
primary STRING static ip address of primary dns server
secondary STRING static ip address of secondary dns server
4.3.9 filters
Description: array of firewall filters : ARRAY
16 Multi-Tech Systems, Inc. MultiConnect
R
rCell API Developer Guide
Page 17
4 COMMANDS AND COLLECTIONS
Element Type Description
action STRING action of filter: ACCEPT, REJECT, LOG or DROP
description STRING filter description
direction STRING direction of traffic: INGRESS or EGRESS
dstIp STRING ip address of destination or ’ANY’
dstMask UINT network mask of destination (0-32)
dstPortEnd STRING end of destination port range or ’ANY’
dstPortStart STRING beginning of destination port range or ’ANY’
enabled BOOL enable or disable this filter
name STRING name of filter
protocol STRING filter protocol, TCP, UDP or TCP/UDP
srcIp STRING ip address of source or ’ANY’
srcMac STRING mac address of source
srcMask UINT network mask of source (0-32)
srcPortEnd STRING end of source port range or ’ANY’
srcPortStart STRING beginning of source port range or ’ANY’
4.3.10 gccp
Description: settings for gccp application : OBJECT
Element Type Description
enabled BOOL enable or disable gccp feature (default:false)
port UINT port to open on rCell for gccp connection (default:5000)
4.3.11 gps
Description: gps service settings : OBJECT
Multi-Tech Systems, Inc. MultiConnect
R
rCell API Developer Guide 17
Page 18
4 COMMANDS AND COLLECTIONS
Element Type Description
client OBJECT settings for gps client
enabled BOOL enable or disable gps client (default:false)
password STRING password to use when connecting to remote server
port UINT port to connect on remote server (default:5445)
protocol STRING protocol to when making connection, UDP or TCP (default:TCP)
remoteHost STRING ip address of remote server (default:’192.168.2.3’)
nmea OBJECT specify what nmea sentences to send and how often to send them
gga BOOL global positioning system fix data (default:true)
gll BOOL geographic position, latitude/longitude (default:true)
gsa BOOL GPS DOP and active satellites (default:true)
gsv BOOL GPS Satellites in view (default:true)
id STRING optional id to attach to messages
idPrefix STRING optional prefix to attach to messages
interval UINT interval in seconds to send gps information (default:10)
rmc BOOL recommended minimum specific GPS/Transit data (default:true)
vtg BOOL track made good and ground speed (default:true)
server settings for gps server
dumpSerialPort BOOL output gps information to serial port (default:false)
enabled BOOL enable or disable gps server on rCell (default:false)
password STRING password needed for client to connect to server
port UINT port to for server to listen on (default:5445)
4.3.12 greTunnels
Description: list of gre tunnels : ARRAY
Element Type Description
description STRING description for gre tunnel
enabled BOOL enable or disable this tunnel
name STRING name of tunnel
remoteIP STRING remote ip of tunnel
routes ARRAY list or tunnel routes
ip STRING ip address of route
mask STRING network mask of route (0-32)
ttl UINT time to live (0-255)
4.3.13 ipPipes
Description: list of configured IP Pipes : ARRAY
18 Multi-Tech Systems, Inc. MultiConnect
R
rCell API Developer Guide
Page 19
4 COMMANDS AND COLLECTIONS
Element Type Description
activation STRING signal to start connection
description STRING summary of the pipe
enabled BOOL enable or disable this pipe
ip STRING ip address of the remote end of the pipe
mode STRING determines whether local end point is a client or server or both
name STRING label of the pipe
port UINT port number of the remote end point when in CLIENT mode, or listening port
when in SERVER mode
protocol STRING the internet protocol to use (UDP or TCP)
secondaryIp STRING ip address of the second server to try if a connection can not be made to the
first. Requires CLIENT mode
secondaryPort STRING port of the second server to try if a connection can not be made to the first.
Requires CLIENT mode
sequence STRING the character or stream of characters that signal the pipe to terminate. Requires
termination mode to be SEQUENCE
source STRING the source defines the local device to convert data to and from ip communication
termination STRING the mode for terminating the pipe
timeoutSeconds UINT the amount of seconds of inactivity allowed before the pipe will close. Requires
termination mode to be TIMEOUT
type STRING the type of pipe. currently only serial-to-ip and bluetooth-to-ip are supported
4.3.14 ipsecTunnels
Description: array of IPsec tunnels : ARRAY
Multi-Tech Systems, Inc. MultiConnect
R
rCell API Developer Guide 19
Page 20
4 COMMANDS AND COLLECTIONS
Element Type Description
authMethod STRING how the two security gateways should authenticate each other
compression BOOL whether IPComp compression of content is proposed on the connection
description STRING a note about the tunnel
enabled BOOL enable or disable this tunnel
encryptMethod STRING IKE encryption/authentication algorithm to be used for phase 1 and phase 2 of
ikelife UINT how long the keying channel of a connection should last before being renegotiated
keylife UINT how long a particular instance of a connection should last, from successful nego-
localId STRING how the local participant should be identified for authentication
name STRING label of tunnel
perfectForwardSecrecy BOOL whether Perfect Forward Secrecy of keys is desired on the connection’s keying
phase1 STRING [OPTIONAL] specific algorithms to use for phase 1. Format: cipher-hash;group.
phase2 STRING [OPTIONAL] specific algorithms to use for phase 2. Format: cipher-hash;group.
psk STRING pre-shared key
remoteId STRING how the remote participant should be identified for authentication
remoteNetwork STRING saved network of remote end of tunnel
remoteNetworkIp STRING network at the remote end of tunnel
remoteNetworkMask UINT network mask at the remote end of tunnel
remoteWanIp STRING public ip of remote end of tunnel
retries UINT number of attempts that should be made to negotiate a connection, or a replace-
type STRING type of ipsec tunnel: Internet Key Exchange is currently the only type supported
uid BOOL whether or not tunnel end points should be identified for authentication
the connection
(hours)
tiation to expiry (hours)
channel
Example: aes128-sha1;modp1024
Example: aes128-sha1;modp1024
ment for one, before giving up
4.3.15 lan
Description: lan interface settings : OBJECT
Element Type Description
gateway STRING default gateway (default:192.168.2.1)
ip STRING ip address (default:192.168.2.1)
mask STRING subnet mask (default:255.255.255.0)
4.3.16 nat
Description: list of NAT rules for advanced firewall settings : ARRAY
20 Multi-Tech Systems, Inc. MultiConnect
R
rCell API Developer Guide
Page 21
4 COMMANDS AND COLLECTIONS
Element Type Description
description STRING description of rule
direction STRING direction of rule, INGRESS or EGRESS
enabled BOOL enable or disable rule (default:true)
guid STRING rule guid
lanIp STRING LAN ip address of rule
lanPortEnd STRING LAN end port range of rule
lanPortStart STRING LAN beginning port range of rule
name STRING name of rule
protocol STRING TCP, UDP or TCP/UDP
type STRING SNAT or DNAT
wanIp STRING WAN ip address of rule or ’ANY’
wanPortEnd STRING WAN end port range or ’ANY’
wanPortStart STRING WAN beginning port range or ’ANY’
4.3.17 networks
Description: array of networks to be used in setting filters and tunnels : ARRAY
Element Type Description
ip STRING ip address of network
mask UINT network mask (0-32)
name STRING name of network
type STRING type of network, STATIC or DYNAMIC, configured networks should be set as
DYNAMIC
4.3.18 ppp
Description: PPP settings : OBJECT
Multi-Tech Systems, Inc. MultiConnect
R
rCell API Developer Guide 21
Page 22
4 COMMANDS AND COLLECTIONS
Element Type Description
authentication OBJECT PPP authentication settings
password STRING password of ppp account
type STRING type of authentication to use when connecting to ppp, PAP, CHAP or PAP-CHAP
(default:’PAP-CHAP’)
username STRING username of ppp account
connectTimeout UINT time in seconds to wait for a connection while in receive mode (default:90)
dialOnDemand BOOL enable or disable dial on demand : (default:false)
diversity BOOL enable or disable antenna diversity (default:true)
enabled BOOL enable or disable ppp connection (default:false)
idleTimeout UINT timeout in seconds before connection is considered idle and disconnected (de-
fault:180)
keepAlive OBJECT PPP keep alive settings
dataRecv OBJECT keep ppp connection alive as long as data is being received
enabled BOOL enable or disable data receive monitor (default:false)
window UINT time in minutes (default:0)
enabled OBJECT enable or disable keep alive feature
hostname STRING host to connect to
icmpCount UINT number of pings to send (default:10)
pingInterval UINT interval in seconds to send pings (default:60)
tcpPort UINT port on host to connect to (default:0)
type STRING method to use for keep alive, ICMP or TCP (default:ICMP)
maxRetries UINT maximum number of retries to attempt before failing (default:0)
modem OBJECT modem settings
apnString STRING apn connection string from service provider
baudRate UINT baud rate of modem (default:115200)
commands ARRAY list of at commands to send to modem after successfully connecting
connectString STRING string to send modem on successful connection (default:’CONNECT’)
dialNumber STRING number for modem to dial for connection (default:’*99***1#’)
dialPrefix STRING prefix to add to number (default:’ATDT’)
initStrings ARRAY list of init strings to send to modem (default:[’AT+CSQ’])
simPin STRING pin used to unlock sim for use
nat BOOL enable or disable nat feature (default:true)
powerOnInitString STRING string to send to radio on boot up
wakeUpOnCall OBJECT wake-up on call settings
ackString STRING sequence of characters sent to the cellular modem upon receiving a valid caller
ID
callerIds OBJECT list of valid caller ids for wake-up
action STRING action to perform on wake-up
text STRING text of wake-up SMS message or caller-id value
type STRING type of call: CALLER or SMS
delay UINT seconds to wait after call before reconnecting (default:10)
enabled BOOL enable or disable wake-up on call (default:false)
fromLan BOOL enable or disable wake-up on lan activity (default:false)
initStrings ARRAY list of cellular radio AT init strings
onCallerId BOOL enable or disable wake-up on caller id (default:false)
onRing BOOL enable or disable wake-up on ring (default:false)
onSms BOOL enable or disable wake-up on sms (default:false)
22 Multi-Tech Systems, Inc. MultiConnect
R
rCell API Developer Guide
Page 23
4 COMMANDS AND COLLECTIONS
4.3.19 remoteAccess
Description: settings to configure remote access of device : OBJECT
Element Type Description
bruteForcePrevention OBJECT settings to configure login attempt throttling
enabled BOOL enable device to throttle username and password combination attempts (de-
failAttempts UINT set the number of consecutive failures before locking out an account (default:3)
lockoutSeconds UINT set the amount of seconds that a user account will be locked out (default:300)
dosAttackPrevention OBJECT settings to configure new connection throttling
enabled BOOL enable device to throttle number of new connection attempts to device (de-
limitBurst UINT set the upper limit of new connections allowed per minute (default:100)
limitPerMinute UINT set the average number of new connections allowed per minute (default:60)
http OBJECT settings to configure HTTPS redirect
enabled BOOL (default:true)
lan BOOL enable redirect for lan traffic (default:true)
port UINT set port for redirect (default:80)
wan BOOL enable redirect for wan traffic (default:false)
https OBJECT settings to configure HTTPS access to device
port UINT set port for rcell configuration website (default:443)
wan BOOL enable access to rcell configuration website from wan (default:false)
icmp OBJECT settings to configure ICMP access to device
enabled BOOL enable any response to icmp traffic (default:true)
respondToLan BOOL respond to lan icmp traffic (default:true)
respondToWan BOOL responsd to wan icmp traffic (default:false)
pingLimit OBJECT settings to configure ICMP throttling
enabled BOOL enable device to throttle number of icmp packets allowed to device (default:false)
limitBurst UINT set the upper limit of icmp packets allowed per second (default:30)
limitPerSecond UINT set the average number of new connections allowed per second (default:10)
privateWan BOOL drop packets with private source addresses coming from public wan interfaces,
ssh OBJECT settings to configure SSH access to device
enabled BOOL enable ssh access to the device (default:true)
lan BOOL allow ssh access from lan (default:true)
port UINT set the port for ssh access to the device (default:22)
wan BOOL allow ssh access from wan (default:false)
timeoutSeconds UINT (default:300)
fault:false)
fault:false)
i.e. spoofed packets (default:false)
4.3.20 remoteManagement
Description: remote management settings : OBJECT
Multi-Tech Systems, Inc. MultiConnect
R
rCell API Developer Guide 23
Page 24
4 COMMANDS AND COLLECTIONS
Element Type Description
accountKey STRING account key registered to user by device management platform
allowConfigurationUpgrade BOOL allow configuration upgrades to be managed through device management plat-
allowFirmwareUpgrade BOOL allow firmware upgrades to be managed through device management platform
enabled BOOL enable the device to be managed by a remote management platform (default:false)
gpsDataInterval UINT set the gps push interval in seconds (default:43200)
queryServerInterval UINT set the check-in interval in seconds (default:43200)
serverName STRING remote management platform’s url or IP address (default:ds.multitech.com)
serverPort UINT remote management platform’s IP port (default:5798)
sslEnabled BOOL enable traffic encryption (default:true)
syncWithDialOnDemand BOOL only allow the device to contact the remote management platform when the
form (default:true)
(default:true)
cellular link is already up (default:false)
4.3.21 routes
Description: list of static routes : ARRAY
Element Type Description
gateway STRING default gateway of route
ip STRING ip address of route
mask UINT network mask of route (0-32)
name STRING name of route
4.3.22 serial
Description: settings for serial port : OBJECT
Element Type Description
baudRate UINT (default:115200)
dataBits UINT (default:8)
flowControl STRING RTS-CTS or NONE (default:NONE)
modbus BOOL enable or disable modbus (default:false)
parity STRING ODD, EVEN or NONE (default:NONE)
stopBits UINT (default:1)
type STRING if device support flexible serial port: RS-232, RS-422, or RS-485 (default:RS-232)
4.3.23 sntp
Description: settings for clock synchronization between computer systems : OBJECT
Element Type Description
enabled BOOL enable or disable SNTP client (default:false)
pollingTime UINT frequency in minutes to poll current time (default:120) [0-1440]
server STRING ip address or domian name of server
timeZone STRING zoneinfo file path to use as timezone : (default:UTC)
24 Multi-Tech Systems, Inc. MultiConnect
R
rCell API Developer Guide
Page 25
4 COMMANDS AND COLLECTIONS
4.3.24 syslog
Description: settings for syslog support : OBJECT
Element Type Description
enabled BOOL enable or disable syslog daemon (default:false)
ipAddress STRING ip address of syslog server
logLevel UINT level of debug output to log, 20(warning), 30(info), 50(debug), 60(trace) or
outputToFile BOOL enable or disable syslog output to file (default:false)
100(maximum) (default:30)
4.3.25 system
Description: system attributes : OBJECT
Multi-Tech Systems, Inc. MultiConnect
R
rCell API Developer Guide 25
Page 26
4 COMMANDS AND COLLECTIONS
Element Type Description
capabilities OBJECT hardware capabilites
adc BOOL true if device supports analog inputs, otherwise false
bluetooth BOOL true if device supports bluetooth, otherwise false
din BOOL true if device supports digital inputs, otherwise false
dout BOOL true if device supports digital outputs, otherwise false
externalSerialPort BOOL true if device supports external serial port, otherwise false
flexibleSerialPort BOOL true if device supports flexible serial port, otherwise false
gps BOOL true if device supports gps, otherwise false
wifi BOOL true if device supports wifi, otherwise false
cmdtty STRING tty device to access used to issue at commands to radio
date STRING current system date
datetime STRING current system date and time
dbDirty BOOL true if is database in dirty state
defaultDeviceName STRING default name of device
deviceId STRING device id
deviceName STRING configured name of device
firmware STRING firmware version
firmwareDate STRING firmware built date
firstTimeSetup BOOL true if this is first run of device or has been reset to defaults
hardwareVersion STRING hardware version of device
imei STRING international mobile station equipment identity
imsi STRING international mobile subscriber identity
macAddress STRING mac address of ethernet port
macBluetooth STRING mac address of bluetooth module
macWifi STRING mac address of wifi module
memory OBJECT current memory stats
mode STRING system level mode of rcell (default:ROUTER)
oemId STRING configurable device id
permission STRING authorization level of the current user
ppptty STRING tty device used by ppp to make connections
productId STRING product id
radio OBJECT radio model number and type
carrier STRING current carrier providing cellular connectivity
code STRING radio model code number, H5, H6, EV3, C2 or G3
type STRING type of radio, GSM or CMDA
restartNeeded BOOL true if settings have been changed and a restart is needed to reflect those changes
time STRING current system time of device
uptime STRING time unit has been running
user STRING current logged in user
vendorId STRING Multi-Tech Systems
webTitle STRING configurable title to display in browser
in services
4.3.26 users
Description: users collection for authentication : ARRAY
26 Multi-Tech Systems, Inc. MultiConnect
R
rCell API Developer Guide
Page 27
4 COMMANDS AND COLLECTIONS
Element Type Description
name STRING name of user
password STRING password hash
permission STRING permission level : ADMIN, USER, GUEST
4.3.27 wifi
Description: settings for wi-fi services : OBJECT
Element Type Description
ap OBJECT wi-fi access point settings
beaconInterval UINT time in msec between beacon frames (default:100)
channel STRING wireless channel to use. Valid entries are 1-14 depending on country code or
countryCode STRING two character operating country code
dtimInterval UINT frames between delivery traffic indication messages for buffered multicast/broad-
enabled BOOL enable or disable the wifi access point (default:false)
networkMode STRING access point radio mode of operation. Valid entries are b, n, bg or bgn (de-
rtsThreshold UINT request to send threshold (default:2347)
security OBJECT wi-fi access point security settings
algorithm STRING algorithm to use with WPA modes. Valid entries are TKIP, AES or TKIP+AES
mode STRING security mode for access point. Valid entries are NONE, WEP, WPA-PSK or
psk STRING pre-shared key for client authentication
ssid STRING network SSID, may only contain alpha-numeric characters and symbols not in-
client OBJECT wi-fi client settings
enabled BOOL enable or disable the wifi client (default:false)
mode STRING use the wifi interface as a WAN or LAN (default:WAN)
savedNetworks ARRAY list of network wi-fi client will use to find a connection
enabled BOOL enable or disable saved network when trying to connect
name STRING name of network
security OBJECT wi-fi client security settings
algorithm STRING algorithm to use with WPA modes. Valid entries are TKIP, AES or TKIP+AES
mode STRING security mode (default:NONE)
password STRING password used to connect to network
psk STRING pre-shared key to connect to network
username STRING username used to connect to network
ssid STRING ssid of network
wpaConfig OBJECT settings gathered from wi-fi scan
networks ARRAY list of networks from last wifi scan
AUTO (default:AUTO)
cast data (default:1)
fault:bgn)
(default:TKIP+AES)
WPA2-PSK (default:NONE)
cluding ?, ”, $, [, \, ] and + characters
(default:TKIP+AES)
Multi-Tech Systems, Inc. MultiConnect
R
rCell API Developer Guide 27
Page 28
5 STATISTICS
5 Statistics
The API supports collecting dynamic system data through its Statistics URL. This data is read-only. Every call actively collects the latest data associated with the selected stats element. For a list of pollable options, use a GET request on https://[rcell ip]/api/stats.
Statistic Group Description
dns Current DNS servers
gps GPS NMEA and Statistics
gre GRE Tunnel statistics
ipsec IPsec Interface statistics
lan Local Area Network statistics
modbus Modbus statistics
ppp PPP statistics
serial Serial port statistics
service Various service status
wlan WiFi statistics
Example Collecting latest PPP statistics:
1 G ET https://192.168.2.1/api/stats/ppp
2
3 S t a tus : HTT P /1. 1 2 00 OK
4 {
5 " c ode " : 2 0 0 ,
6 " r e sult " : {
7 " a r eaCod e " : " 7 D 0 E " ,
8 " d n s Server s " : [ " 2 2 2 . 8 8.33.23" ] ,
9 " i p " : " 1 4 2 . 1 3 3 . 1 2 . 4 0 " , 10 " link " : " P P P Link i s up" , 11 " l o cal I p " : "1 4 2 . 1 3 3.12.40" , 12 " mtu " : " 1 5 5 0" , 13 " n umber " : " 1 4 8 3 1 2 6 8 3 0 6 " , 14 " r e moteI p " : "1 9 2 . 1 6 8 .202.0" , 15 " r o ami n g " : f a l s e , 16 " rssi " : " 1 0" , 17 " r x " : { 18 " byte s " : " 1 0 2 5 42" , 19 " d roppe d " : " 0" , 20 " e rror s " : " 0" , 21 " fram e " : " 0" , 22 " o verrun s " : " 0" , 23 " p acket s " : " 7 9 7" 24 }, 25 " t ower " : " 2 8 0 2" , 26 " t x " : { 27 " byte s " : " 4 4 8 41" , 28 " c arrie r " : " 0" , 29 " c o llisio n s " : " 0 " , 30 " d roppe d " : " 0" , 31 " e rror s " : " 0" , 32 " o verrun s " : " 0" , 33 " p acket s " : " 6 4 8" , 34 " q u e ueLeng t h " : " 3 " 35 }, 36 " u ptime " : 1 0 4 6 03 37 }, 38 " s t atus " : " su c c e ss " 39 }
28 Multi-Tech Systems, Inc. MultiConnect
R
rCell API Developer Guide
Page 29
5 STATISTICS
5.1 dns
Description: current dns server ip addresses : ARRAY
Element Type Description
dhcpLease ARRAY array of dns servers issued to dhcp clients with lease
servers ARRAY array of dns servers available for domain name resolution
5.2 gps
Description: statistics and positional information of gps device : OBJECT
Element Type Description
alt STRING altitude
data ARRAY a list of NMEA data strings containing latest gps information
fix STRING fix quality (0=Invalid, 1=GPS fix, 2 = DGPS fix)
lat STRING latitude coordinate
lng STRING longitude coordinate
sats STRING number of satelites
time STRING time
5.3 gre
Description: statistics on gre tunnels (keys are tunnel names) : OBJECT
Element Type Description
tunnel OBJECT statistics on ipsec lan interface transmitted bytes
localIp STRING the ip address assigned to this interface
mode STRING tunnel mode
remoteIp STRING the ip address of the remote end of this tunnel
rx OBJECT statistics on gre tunnel received bytes
Mcasts UINT number of multicast packets received
bytes UINT number of received bytes
csumErrors UINT number of packets dropped because of checksum failures
errors UINT number of received byte errors
outOfSequence UINT number of packets dropped because they arrived out of sequence
packets UINT number of received packets
ttl STRING time to live (specified in seconds or inherited)
tx OBJECT statistics on gre tunnel transmitted bytes
bytes UINT number of transmitted bytes
deadLoop UINT number of packets which were not transmitted because the tunnel is looped back
errors UINT number of transmitted errors
noBuffs UINT number of packets which were not transmitted because the kernel failed to allo-
noRoute UINT number of packets which were not transmitted because there is no IP route to
packets UINT number of transmitted packets
to itself
cate a buffer
the remote endpoint
Multi-Tech Systems, Inc. MultiConnect
R
rCell API Developer Guide 29
Page 30
5.4 ipsec
Description: statistics on ipsec interfaces : OBJECT
Element Type Description
ipsec0 OBJECT statistics on ipsec lan interface
ip STRING the ip address assigned to this interface
mtu STRING maximum transmission unit in bytes
rx OBJECT statistics on ipsec lan interface received bytes
bytes STRING number of received bytes
dropped STRING number of received byte drops
errors STRING number of received byte errors
frame STRING number of received frames
overruns STRING number of received overruns
packets STRING number of received packets
tx OBJECT statistics on ipsec lan interface transmitted bytes
bytes STRING number of transmitted bytes
carrier STRING number of transmitted carriers
collisions STRING number of transmitted collisions
dropped STRING number of transmitted drops
errors STRING number of transmitted errors
overruns STRING number of transmitted overruns
packets STRING number of transmitted packets
queueLength STRING number of packets that can be queued for transmission
ipsec1 OBJECT statistics on ipsec wan interface
ip STRING the ip address assigned to this interface
mtu STRING maximum transmission unit in bytes
rx OBJECT statistics on ipsec lan interface received bytes
bytes STRING number of received bytes
dropped STRING number of received byte drops
errors STRING number of received byte errors
frame STRING number of received frames
overruns STRING number of received overruns
packets STRING number of received packets
tx OBJECT statistics on ipsec lan interface transmitted bytes
bytes STRING number of transmitted bytes
carrier STRING number of transmitted carriers
collisions STRING number of transmitted collisions
dropped STRING number of transmitted drops
errors STRING number of transmitted errors
overruns STRING number of transmitted overruns
packets STRING number of transmitted packets
queueLength STRING number of packets that can be queued for transmission
5 STATISTICS
5.5 lan
Description: statistics on local area network : OBJECT
30 Multi-Tech Systems, Inc. MultiConnect
R
rCell API Developer Guide
Page 31
5 STATISTICS
Element Type Description
ip STRING the ip address assigned to this interface
mtu STRING maximum transmission unit in bytes
rx OBJECT statistics on local area network received bytes
bytes STRING number of received bytes
dropped STRING number of received byte drops
errors STRING number of received byte errors
frame STRING number of received frames
overruns STRING number of received overruns
packets STRING number of received packets
tx OBJECT statistics on local area network transmitted bytes
bytes STRING number of transmitted bytes
carrier STRING number of transmitted carriers
collisions STRING number of transmitted collisions
dropped STRING number of transmitted drops
errors STRING number of transmitted errors
overruns STRING number of transmitted overruns
packets STRING number of transmitted packets
queueLength STRING number of packets that can be queued for transmission
5.6 modbus
Description: statistics on modbus passthrough pipe : ARRAY
Element Type Description
id UINT identification of device on bus
rx UINT number of bytes received by device
status STRING status of device
time UINT seconds since last activity
tx UINT number of bytes transmitted by device
5.7 ppp
Description: statistics on ppp interface : OBJECT
Multi-Tech Systems, Inc. MultiConnect
R
rCell API Developer Guide 31
Page 32
Element Type Description
areaCode STRING identification code of area
dnsServers ARRAY an array of strings representing ip addresses of DNS servers
ip STRING the ip address assigned to this interface
link STRING status of the link
localIp STRING the ip address assigned to this interface
mtu STRING maximum transmission unit in bytes
number STRING cellular phone number
remoteIp STRING the externally facing ip address of this interface
roaming BOOL indicates whether or not this connection is considered roaming
rssi STRING a value representing signal strength [0-31]
rx OBJECT statistics on ppp interface received bytes
bytes STRING number of received bytes
dropped STRING number of received byte drops
errors STRING number of received byte errors
frame STRING number of received frames
overruns STRING number of received overruns
packets STRING number of received packets
tower STRING tower identification number
tx OBJECT statistics on ppp interface transmitted bytes
bytes STRING number of transmitted bytes
carrier STRING number of transmitted carriers
collisions STRING number of transmitted collisions
dropped STRING number of transmitted drops
errors STRING number of transmitted errors
overruns STRING number of transmitted overruns
packets STRING number of transmitted packets
queueLength STRING number of packets that can be queued for transmission
uptime UINT number of minutes connection has been established
5 STATISTICS
5.8 serial
Description: statistics on serial interface : OBJECT
Element Type Description
dcd STRING status of dcd
rx UINT number of bytes received on serial interface
tx UINT number of bytes transmitted on serial interface
5.9 service
Description: status on various services : OBJECT
32 Multi-Tech Systems, Inc. MultiConnect
R
rCell API Developer Guide
Page 33
5 STATISTICS
Element Type Description
ddns OBJECT status on ddns services
enabled BOOL indicates whether or not service is employed
status STRING status of ddns
dialOnDemand OBJECT status on dial-on-demand services
enabled BOOL indicates whether or not service is employed
status STRING status of dial-on-demand
keepAlive OBJECT status on keep-alive services
enabled BOOL indicates whether or not service is employed
status STRING status of keep-alive
sntp OBJECT status on sntp services
enabled BOOL indicates whether or not service is employed
status STRING status of sntp
5.10 wlan
Description: statistics on wlan interface : OBJECT
Element Type Description
channels ARRAY array of available channels
countryCode STRING code used to assign wifi hardware to use country’s authorized frequencies
ip STRING the ip address assigned to this interface
link STRING status of the wifi link
mtu STRING maximum transmission unit in bytes
rx OBJECT statistics on wifi interface received bytes
bytes STRING number of received bytes
dropped STRING number of received byte drops
errors STRING number of received byte errors
frame STRING number of received frames
overruns STRING number of received overruns
packets STRING number of received packets
tx OBJECT statistics on wifi interface transmitted bytes
bytes STRING number of transmitted bytes
carrier STRING number of transmitted carriers
collisions STRING number of transmitted collisions
dropped STRING number of transmitted drops
errors STRING number of transmitted errors
overruns STRING number of transmitted overruns
packets STRING number of transmitted packets
queueLength STRING number of packets that can be queued for transmission
Multi-Tech Systems, Inc. MultiConnect
R
rCell API Developer Guide 33
Page 34
6 APPENDIX
6 Appendix
6.1 REST Architecture
A REST (Representational State Transfer) architecture is a style for interacting with distributed systems and is commonly used in websites. There are four methods to REST: POST, GET, PUT, and DELETE. These actions expose the four basic functions of persistent storage: Create, Read, Update, and Delete (CRUD). The responses to these RESTful actions can be returned in various formats. A RESTful JSON API responds to REST requests with JSON.
6.2 JSON Data
JSON (JavaScript Object Notation) is a text-based human-readable data interchange that represents simple data structures and associative arrays.
6.3 Examples
6.3.1 Using Curl to log in
1 c url --ssl v 3 - k " h ttps : / / 1 9 2 .168.2.1 / api/ l o gin ? u s e r n ame = a d m i n & pa s s w o r d = ad m i n "
Curl result:
1 {
2 " code " : 2 00 ,
3 " r esult " : {
4 " a d dress " : "1 9 2 . 1 6 8 . 2.103" ,
5 " p e r m ission " : " ad m in " ,
6 " p ort " : " 5 2 2 2 2 " ,
7 " t i m estamp " : " 1 4 : 3 0 : 5 : 95 7 " ,
8 " t oken " : " 2 4 4 2 CB 0 C B 6 0 B 2 E E 9 F 5 A 3 5 D F 5 E D 8 C 3 3 ",
9 " u ser " : " a d m i n " 10 }, 11 " s tatus " : " s u c c e s s " 12 }
Verbose Curl result:
1 * Abo u t t o conne c t () t o 1 9 2 .168. 2 . 1 po rt 443 ( # 0 )
2 * T r y i ng 1 9 2 . 1 6 8.2.1.. . co n n e c t e d
3 * succes s f u l l y s e t c e r t ificate ve r i f y l o c a tions :
4 * C A f i le : n one
5 C A path : /e t c / ss l / ce r ts
6 * SSL v 3 , T LS h andsha k e , Cl i e n t h ello (1 ) :
7 * SSL v 3 , T LS h andsha k e , Se r v e r h ello (2 ) :
8 * SSL v 3 , T LS h andsha k e , CE R T ( 11) :
9 * SSL v 3 , T LS h andsha k e , Se r v e r f i n ished (1 4 ) : 10 * SSL v 3 , T LS h andsha k e , Cl i e n t key exch a n g e ( 1 6) : 11 * SSL v 3 , T LS chang e ci p her , Clien t h e l l o (1) : 12 * SSL v 3 , T LS h andsha k e , Fi n i s h e d ( 20) : 13 * SSL v 3 , T LS chang e ci p her , Clien t h e l l o (1) : 14 * SSL v 3 , T LS h andsha k e , Fi n i s h e d ( 20) : 15 * SS L c o n n e c t ion u sing AES2 5 6 - S HA 16 * Ser v e r c e r t i f i c a te : 17 * su b j e c t : C= US ; ST = Minn e s o t a ; L = M i n n e a p o l i s ; CN = r c ell . e x a m p le . c o m 18 * st a r t d ate : 20 13 - 0 5 - 0 1 16 : 31 : 0 6 GMT
34 Multi-Tech Systems, Inc. MultiConnect
R
rCell API Developer Guide
Page 35
6 APPENDIX
19 * ex p i r e d ate : 20 1 4 - 0 5 -0 1 16: 31 : 06 GM T 20 * is s u e r : C= US ; ST = Mi n n e s o t a ; L = M i n n e a p o l i s ; CN = r c ell . e x a m p le . c o m 21 * S S L c e r t i f icate verif y re s ult : sel f s i g n e d c e r t i ficate (18 ) , co n t i n u ing a nyway . 22 > GE T / a pi / l o g in ? us e r n a me = ad m in & pa s s w ord = a d m i n H TTP / 1.1 23 > Us er - Ag e n t : c u rl / 7 . 2 2 .0 ( x86 _ 64 -pc -l i n ux -gnu ) li b c url / 7 . 2 2 . 0 O p enSSL / 1 .0.1 zl ib /1 . 2 . 3.4
lib i d n /1 . 2 3 l i b r tmp / 2 . 3
24 > Ho s t : 1 9 2 . 1 6 8 . 2 .1 25 > Acc e p t : * /* 26 > 27 < HT T P /1 . 1 2 00 OK 28 < Set - C o o k i e : t o ken = 5 8 10 A5 7 D F 8 7 3 2 8 9 5 1 F F 1 9 0 1 0 2 7 A 0 9 A 7 4 ; M ax - Ag e =3 0 0 ; P ath =/; Se c ure 29 < Ca che - Co n t r o l : no - c ache 30 < Co n t ent - ty p e : a p p l i c ation / j s o n 31 < Tr a n sfer - E n c o d i n g : c h u n ked 32 < Da t e : W ed , 15 J a n 2014 1 4 : 56 : 0 9 GMT 33 < Ser v e r : r c e ll 34 < 35 { 36 " code " : 2 00 , 37 " r esult " : { 38 " a d dress " : "1 9 2 . 1 6 8 . 2.103" , 39 " p e r m ission " : " ad m in " , 40 " p ort " : " 4 3 5 1 6 " , 41 " t i m estamp " : " 1 4 : 5 6 : 9 : 36 3 " , 42 " t oken " : " 5 8 1 0 A5 7 D F 8 7 3 2 8 9 5 1 F F 1 9 0 1 0 2 7 A 0 9 A 7 4 ", 43 " u ser " : " a d m i n " 44 }, 45 " s tatus " : " s u c c e s s " 46 } 47 * Conne c t i o n # 0 to h o s t 1 9 2 . 1 68.2.1 lef t i n t a c t 48 * Cl o s i n g c o n n e c t i on #0 49 * SSL v 3 , T LS aler t , Cl i e nt h ello (1) :
6.3.2 Using Curl to enable PPP
1 c url --ssl v 3 - k -X PU T -H "Co n tent - Ty p e : a p p l i cation / j s on " -d ’{
2 " en a b l ed " : tr u e ,
3 } ’ htt p s : //192.1 6 8 . 2 . 1 / ap i /pp p ? to k e n =2 4 4 2 CB0CB60B 2 E E 9 F 5 A 3 5 D F 5 E D 8 C 3 3
Curl result:
1 {
2 " code " : 2 00 ,
3 " s tatus " : " s u c c e s s "
4 }
Multi-Tech Systems, Inc. MultiConnect
R
rCell API Developer Guide 35
Page 36
6.3.3 Using Curl to add a firewall DNAT rule
1 c url --ssl v 3 - k -X PO S T -H "Co n tent - Ty p e : a p p l i c ation / j s on " -d ’{
2 " de s c r i p t i o n " : "" ,
3 " di r e c t i on " : "ING R E S S " ,
4 " en a b l ed " : tr u e ,
5 " gu id " : "F TP - SE RVE R - D N A T " ,
6 " la n Ip " : "192. 1 6 8 . 2 . 1 0 3 " ,
7 " la n P o r t E n d " : 21 ,
8 " la n P o r t S t a r t " : 20 ,
9 " na me " : "F TP - SE R V E R " , 10 " pr o t o c ol " : "TC P " , 11 " ty pe " : " D N A T " , 12 " wa n Ip " : "A N Y " , 13 " wa n M a sk " : 32 , 14 " wa n P o r t E n d " : "2 1 " , 15 " wa n P o r t S t a r t " : "2 0 " 16 } ’ htt p s : //192.1 6 8 . 2 . 1 / ap i /na t ? to k e n =2 4 4 2 CB0CB60B 2 E E 9 F 5 A 3 5 D F 5 E D 8 C 3 3
Curl result:
1 {
2 " code " : 2 00 ,
3 " s tatus " : " s u c c e s s "
4 }
6 APPENDIX
6.3.4 Using Curl to add a firewall filter rule
1 c url --ssl v 3 - k -X PO S T -H "Co n tent - Ty p e : a p p l i c ation / j s on " -d ’{
2 " ac t i on " : "AC C E P T " ,
3 " de s c r i p t i o n " : "" ,
4 " di r e c t i on " : "ING R E S S " ,
5 " ds t Ip " : "192. 1 6 8 . 2 . 1 0 3 " ,
6 " ds t M a sk " : 32 ,
7 " ds t N e t w o r k " : "" ,
8 " ds t P o r t E n d " : 21 ,
9 " ds t P o r t S t a r t " : 20 , 10 " en a b l ed " : t rue , 11 " na me " : "F TP - SE R V E R " , 12 " pr o t o c ol " : "TC P " , 13 " sr c Ip " : "A N Y " , 14 " sr c M a sk " : 32 , 15 " sr c M ac " : "" , 16 " sr c N e t w o r k " : "" , 17 " sr c P o r t E n d " : "AN Y " , 18 " sr c P o r t S t a r t " : "AN Y " 19 } ’ htt p s : //192.1 6 8 . 2 . 1 / ap i /filt e r s ?tok e n =2 4 4 2 CB0CB60B2EE9F 5 A 3 5 D F 5 E D 8 C 3 3
Curl result:
1 {
2 " code " : 2 00 ,
3 " s tatus " : " s u c c e s s "
4 }
36 Multi-Tech Systems, Inc. MultiConnect
R
rCell API Developer Guide
Page 37
6 APPENDIX
6.3.5 Using Curl to delete a firewall filter rule by name
1 c url --ssl v 3 - k -X DE L E T E
2 " h t tps : / / 1 9 2 . 1 6 8 . 2 . 1/ ap i / fi l t e rs / F T P - S E R V E R ? to k e n =2 4 42 CB 0 C B 6 0 B 2 E E 9 F 5 A 3 5 D F 5 E D 8 C 3 3
Curl result:
1 {
2 " code " : 2 00 ,
3 " s tatus " : " s u c c e s s "
4 }
6.3.6 Using Curl to delete a firewall filter rule by index
1 c url --ssl v 3 - k -X DE L E T E
2 " h t tps : / / 1 9 2 . 1 6 8 . 2 . 1/ ap i / fi l t e rs / 0 ? to k en = 2 4 4 2 CB0C B 6 0 B 2 E E 9 F 5 A 3 5 D F 5 E D 8 C 3 3
Curl result:
1 {
2 " code " : 2 00 ,
3 " s tatus " : " s u c c e s s "
4 }
6.3.7 Using Curl to save current configurations and reboot
1 c url --ssl v 3 - k -X PO S T -d ""
2 " h t tps : / / 1 9 2 . 1 6 8 . 2 . 1/ ap i / co m m a nd / sa v e _ r e s t a r t ? to k e n =2 4 42 CB 0 C B 6 0 B 2 E E 9 F 5 A 3 5 D F 5 E D 8 C 3 3 "
Curl result:
1 {
2 " code " : 2 00 ,
3 " s tatus " : " s u c c e s s "
4 }
Multi-Tech Systems, Inc. MultiConnect
R
rCell API Developer Guide 37
Loading...