This document was formulated under the cognizance of the TIA Committee TR50, Smart Device Communications.
The contents of the present document are subject to continuing work within the Formulating Group and may change following formal approval. Should the Formulating Group approve modification, the present document will be re-released with an identifying change of release level, for example:
Suggestions for improvement of this document are welcome, and should be sent to:
Telecommunications Industry Association,
Standards and Technology,
2500 Wilson Boulevard, Suite 300
Arlington, VA 22201-3834
Scope
This document is a member of a multi-part standard that, when taken in total, defines the requirements for communications pertaining to the access agnostic (e.g. PHY and MAC agnostic) monitoring and bi-directional communication of events and information between smart devices and other devices, applications and networks. This document provides an introduction to the protocols.
1Introduction
This document is a member of a multi-part standard that has controlling document TIA-4940-000. When taken in total, defines the requirements for communications pertaining to the access agnostic (e.g., PHY and MAC) monitoring and bi-directional communication of events and information between logical entities, such as Point-of-Attachment and applications or networks. This document provides an introduction to the protocols.
2References
Normative References
The following standards contain provisions which, through reference in this text, constitute provisions of this Standard. At the time of publication, the editions indicated were valid. All standards are subject to revision, and parties to agreements based on this Standard are encouraged to investigate the possibility of applying the most recent editions of the standards indicated below. ANSI and TIA maintain registers of currently valid national standards published by them.
References are either specific (identified by date of publication, release level, etc.) or non-specific. For a specific reference, subsequent revisions do not apply. For a non-specific reference, the latest version applies: a non-specific reference implicitly refers to the latest version.
Hypertext Transfer Protocol - HTTP/1.1
http://tools.ietf.org/html/rfc2616
Every system implementing this protocol shall implement the following basic commands for listing and executing capabilities of an entity:
method.list
method.exec
The following diagram shows the way these two commands could be executed:
Figure - Basic Command Flow
5.1method.list
Use this command to list all the available methods and their description.
5.1.1Request
{
"auth": {
"applicationToken": "",
"sessionId": ""
},
"refcmd": {
"command": "method.list"
"params": {
"objectId": ""
}
}
} The “auth” section is described in section 4.1.
The “refcmd” section is described below:
Name
Description
Type
Mandatory
Command
Keyword. Identifies the invoke method. Always set to “method.list”
String
Yes
objectId
Keyword. Identifies the entity that would be asked for the list of methods. If it is not present, all the method registered with the target entity will be returned.
String
No
5.1.2Response
The following JSON stanza represents the response for the “method.list” command.
{
"refcmd": {
"success": true,
"params": {
"remoteMethods": [
{"remoteMethod": "myMethod1",
"objectId": "",
"notificationVariables": {},
"completionVariables": {}
},
{"remoteMethod": "myMethod2",
"notificationVariables": {},
"completionVariables": {}
}
]
}
}
}
Name
Description
Type
Mandatory
remoteMethods
Keyword. Identifies the array of methods that can be invoked.
String
Yes
remoteMethod
Keyword. Identifies the method’s name
String
Yes
notificationVariables
Keyword. Identifies the method’s input parameters and their definition as specified in the section 7
String
Yes
completionVariables
Keyword. Identifies the method’s output (results) values and their definition as specified in the section 7
String
Yes
objectId
Keyword. Identify the objectId in the target entity space that implements the remote method.
String
No
5.2method.exec
Use this command to execute a specific method on a remote entity.
5.2.1Request
{
"auth": {
"applicationToken": "",
"sessionId": ""
},
"refcmd": {
"command": "method.exec"
"params": {
"objectId": "<the target objectId>",
"remoteMethod": "",
"notificationVariables": [
{"input1": ""},
{"input2": ""}
]
}
}
} The “auth” section is described in section 4.1.
The “refcmd” section is described below:
Name
Description
Type
Mandatory
command
Keyword. Identifies the invoke method. Always set to “method.exec”
String
Yes
objectId
Keyword. Identifies the entity that will execute the method described by the “remoteMethod”
String
NoYes
remoteMethod
Keyword. Identifies the method that needs to be invoked.
String
Yes
notificationVariables
Keyword. Identifies the array of invoked method input params.
String
Yes
input1, input2, …
Keyword. Identifies the input parameters.
String
No
5.2.2Response
The response of the invocation method is described here:
{
"refcmd": {
"success": true,
"params": {
"completionVariables": [
{"return1": "foo"},
{"return2": "bar"}
]
}
}
} Fields Description:
Name
Description
Type
Mandatory
success
Keyword. If the invocation succeeded, it would always be “true”.
String
Yes
completionVariables
Keyword. Identifies the array of the returning results.
String
Yes
return1, return2
Keyword. Identifies the return result.
String
No
If the field “success” is “false”, the response is described as in the following section 4.1.
6Security Commands
These services would apply to the following connections:
Connection Name
Server
Client
Notes
A1
AAA-SD
Home Application
Bi-directional
A2
AAA-SD
Node Application
Bi-directional
A3/A3’
AAA-SD
PoA device/application
Bi-directional
A short description of the communication between the Home Application, PoA and AAA-SD is shown below:
Figure - Basic Security Commands
6.1api.authenticate
Use this API command to authenticate an M2M application against the AAA-SD and to obtain the credentials for subsequent api.authorize and api.deauthorize commands
6.1.1Request
{
"refcmd": {
"command": "api.authenticate",
"params": {
"applicationToken": "",
"organizationToken": ""
}
}
}
Name
Description
Type
Mandatory
applicationToken
Keyword. The application token. Identifies the application requesting access to the system. In some cases, the applicationToken can be a userId.
String
Yes
organizationToken
Keyword. The organization token. Identifies the organization requesting access to the system. In some cases, the organizationToken can be passwod
String
Yes
The call will verify the applicationToken and the organizationToken or the username and password. Once validated, a sessionId will be issued.
A sessionId is non-expiring however once the application or organization tokens change or the user account is disabled or deleted then the sessionId will be invalidated and a new sessionId will be required.
6.1.2Response
The following is the description of the response to the authentication request:
{
"refcmd":
{
"success": true,
"params": {
"sessionId": ""
}
}
}
Name
Description
Type
Mandatory
cmd
The command. Must match the request.
String
Yes
success
Keyword. The response of the authentication request. Always true.
String
Yes
params
Keyword. Identifies the response.
String
Yes
sessionId
Keyword. The sessionId returned by the AAA-SD (a string 36 in length)
String
Yes
If the field “success” is “false”, the response is described as in the following section 4.1.
6.2api.deauthenticate
Use this API command to de-authenticate your M2M application program with AAA-SD.
6.2.1Request
{
"refcmd": {
"command": "api.deauthenticate",
"params": {
"applicationToken": "",
"organizationToken": "",
"sessionId": ""
}
}
}
Name
Description
Type
Mandatory
applicationToken
Keyword. The application token. Identifies the application requesting access to the system. In some cases, the applicationToken can be a userId.
String
Yes
organizationToken
Keyword. The organization token. Identifies the organization requesting for de-authentication.
String
Yes
sessionId
Keyword. If present, identifies the sessionId that you want to invalidate.
String
No
If the sessionId is present, only the respective sessionId will be invalidated, if not all the sessionId associated with the applicationToken and organizationToken will be invalidated.
6.2.2Response
The following is the description of the response to the de-authentication request:
{
"refcmd":
{
"success": true,
"params": []
}
}
Name
Description
Type
Mandatory
cmd
The command. Must match the request.
String
Yes
success
Keyword. The response of the authentication request. Always true.
String
Yes
params
Keyword. Empty if the operation is successful.
String
Yes
If the field “success” is “false”, the response is described as in the following section 4.1.
6.3api.authorize
Use this API command to authorize the request of an entity.
6.3.1Request
{
"refcmd": {
"command": "api.authorize",
"params": {
"applicationToken": "",
"sessionId": "",
"remoteApplicationToken": "",
"remoteSessionId": "",
"objectId": "<>",
"methodName": "<>", }
}
}
Name
Description
Type
Mandatory
applicationToken
Keyword. The application token. Identifies the application requesting access to the system.
String
Yes
sessionId
Keyword. The session ID of the entity making requests.
String
Yes
remoteApplicationToken
Keyword. The application token of the remote entity.
String
Yes
remoteSessionId
Keyword. The session ID of the remote entity.
String
Yes
objectId
Keyword. If present , identifies the object ID that the remote entity tries to access
String
No
methodName
Keyword. If present, identifies the method name that the remote entity tries to access.
String
No
6.3.2Response
The following is the description of the response to the authorization request:
{
"refcmd":
{
"success": true,
"params": {
"authorizationToken": ""
}
}
}
Name
Description
Type
Mandatory
Rrefcmd
The command. Must match the request.
String
Yes
success
Keyword. The response of the authorization request. Always true.
Keyword. Identifies the authorization token for the respective request. If the request contains a method the authorization token is only for that specific method, if the request does not have an method, the authorization token is for all the requests for that specific applicationToken / sessionId combination.
String
Yes
If the field “success” is “false”, the response is described as in the following section 4.1.
6.4api.deauthorize
Use this method to de-authorize an entity from accessing the system. This request is made only by the AAA-SD to a specific entity in the system to de-authorize the access to the system.
6.4.1Request
{
"refcmd": {
"command": "api.dauthorize",
"params": {
"authorizationToken": "",
}
}
}
Name
Description
Type
Mandatory
authorizationToken
Keyword. Identifies the authorization token that the AAA-SD de-authorize.
String
Yes
6.4.2Response
The following is the description of the response to the de-authorization request:
{
"refcmd":
{
"success": true,
"params": []
}
}
Name
Description
Type
Mandatory
refcmd
The command. Must match the request.
String
Yes
success
Keyword. The response of the authorization request. Always true.
String
Yes
params
Keyword. Empty if the operation is successful.
String
Yes
If the field “success” is “false”, the response is described as in the following section 4.1.
7Common Data Structure
When using “method.list”, each remote method will contain a list of notification and completion variables. The data structure for these variables as well as possible values follows:
{
"name": "To",
"type": "STRING",
"count": 1,
"length": 16
}
Option
Description
Mandatory
name
The name of the variable
Yes
type
The data type of the variable. Can be one of the following common types:
INT1, INT2, INT4, INT8, UINT1,
UINT2, UINT4, UINT8, FLOAT4,
FLOAT8, STRING, BOOL, BINARY (Base64 Encoded)
Yes
count
Specifies the number of data variable variables, which are included, each of the length specified below, as a single value single value. or as an array. If the field is missing or specified to be a non-positive integer, the count is assumed to be 1.
NoYes
length
Specifies the The allowallowable ed length of the data variables which are included. valueMandatory for and only applicable to STRING type. If the field is missing or specified to be a negative integer, the length is assumed to be 0..