Sie sind auf Seite 1von 6

Sending Messages Using the HTTP(GET-POST)

Sending messages to the SNS++ system via an HTTP protocol adds further
flexibility to the SNS++ system. This section describes the command line
syntax that is used in the HTTP protocol, including examples of messages, and
the SNS++ system response to these messages.

Message Syntax Using HTTP Protocol


To send a message using the HTTP protocol, type the following command line
in your browser:
http://<SNS++ server>/Server/API/clientSendMsg?uid=<SNS++
Username>&pass=<SNS++ User password>&<Message parameters ….>
Where:
<SNS++ server> is the name of the SNS++ server. The name can be either the
IP address or the network name. In the above command line example, the
SNS++ server name is indicated by its network name: <SNS++ server>/
Server/API/clientSendMsg is the name of the web page that is used for
sending messages The character ? appears immediately after the page name and
indicates the beginning of the message attributes.
The character & must appear between each attribute. The syntax of the message
attribute is <attribute name=value>. In the above command line example, the
first message attribute is the user name, and the second attribute is user
password. the relevant section of the command line is shown below:
uid=<SNS++ Username>&pass=<SNS++ User password>. For example, if the
user name is user1 and password is pass1, the relevant section of the command
line would be: uid=<user1>&pass=<pass1>

Highnet Systems Ltd.


24 Raoul Wallenberg St.
Tel-Aviv 6971923, Israel
 + 9 7 2 - 3- 9 2 2 3 2 8 4  + 9 7 2 - 3- 9 2 2 3 2 8 5  info@highnet -sys.com
The message attributes are described in the following table, including whether
the attribute is mandatory.
Attribute Description Mandatory?

uid The SNS++ user name code, as defined in the user Yes
information window.
Maximum length 64 type char
pass The SNS++ user name password, as defined in the user Yes
information window.
Maximum length 128 type char
sender The name, address or computer name that sent the No
message (this attribute is mainly used to filter messages
and reports).
Maximum length 512 type char
initiator The name, address, computer name, application or No
process that created the message (this attribute is mainly
used to filter messages and reports).
Maximum length 1024 type char
sev The message severity level. Values range from 0-5 No
0 info, 1 warning, 2 minor, 3 error, 4 major, 5 critical
Maximum length 1 type smallint

Highnet Systems Ltd.


24 Raoul Wallenberg St.
Tel-Aviv 6971923, Israel
 + 9 7 2 - 3- 9 2 2 3 2 8 4  + 9 7 2 - 3- 9 2 2 3 2 8 5  info@highnet -sys.com
pri The message priority level. Values range from 0 - 3 No
0 for low,1 for normal,2 for high,3 for urgent, Default is 1
Maximum length 1 type smallint
ticket ticket data FORMAT: ticket= <SENDER>:<Key> No
before using this key define relevant environment
parameters on Server Side in file:
$SNSPP_HOME/env/setSNSEnv.sh
Maximum length 256 type char
msg The message text (short version). Yes
Maximum length 8750 type char
lmsg The message text (long version). Some device No
communications, such as e-mail, support long messages.
Maximum length 14350 type char
encoding The SNS++ encoding, as defined in the user information No
window. Default is UTF8
Maximum length 16 type char
when When to send the message format : yyyy-MM- No
dd,HH:mm Default is now
Maximum length 128 type timestamp
timeout Message expiration time out in minutes Default is NO No
Maximum length 6 type integer

Highnet Systems Ltd.


24 Raoul Wallenberg St.
Tel-Aviv 6971923, Israel
 + 9 7 2 - 3- 9 2 2 3 2 8 4  + 9 7 2 - 3- 9 2 2 3 2 8 5  info@highnet -sys.com
external Customer Message ID, Message ID on the client No
application
FORMAT: external=<type>:<datatype>:<data>
type - name of the external system,application
Maximum length 128 type char
datatype – integer, string
Maximum length 32 type char
data – message id for example - z01200-2323001
Maximum length 256 type char
to The message recipient, which can be a recipient/group Yes
that is defined in SNS++, or a one-time recipient.
Maximum length 1024 type char

Highnet Systems Ltd.


24 Raoul Wallenberg St.
Tel-Aviv 6971923, Israel
 + 9 7 2 - 3- 9 2 2 3 2 8 4  + 9 7 2 - 3- 9 2 2 3 2 8 5  info@highnet -sys.com
Format using HTTP (GET/POST):
http://xxx.xxx.xxx.xxx/Server/API/clientSendMsg?uid=USER@COMP
ANY&pass=xxxxxxx&sender=senderAPI&initiator=initiatorAPI&enco
ding=UTF8&msg=this is a test msg&lmsg=this is a long test
msg&to=sms:*05221234567;email:*support@highnet-sys.com
Examples Using CURL: POST Method
curl -X POST --data
"uid=user@com&pass=xxxx&initiator=CRM&sender=Tool&pri=1&msg=test&to=sms:*0
521111111" "http://xxx.xxx.xxx.xxx/Server/API/clientSendMsg"
Example with separate parameters
curl -X POST --data "uid=user@com" --data "pass=xxxx" --data "initiator=CRM" --data
"sender=Tool" --data "pri=1" --data "msg=test" --data "to=email:*support@highnet-
sys.com" "http://xxx.xxx.xxx.xxx/Server/API/clientSendMsg"
Example using Jason Data
curl -H "Content-Type: application/json" -X POST --data "{"uid" : "user@com" , "pass" :
"xxx" , "initiator" : "CRM" , "sender" : "Tool" , "pri" : "1" , "msg" : "test" , "to" : "system"
}" "http://xxx.xxx.xxx.xxx/Server/API/clientSendMsg"
Examples Using CURL: Get Method
curl
http://xxx.xxx.xxx.xxx/Server/API/clientSendMsg?uid=user@com&pass=xxxx&initiator=
CRM&sender=Tool&pri=1&msg=test&to=sms:*0521111111

Get Message Status


http://xxx.xxx.xxx.xxx/Server/API/clientMsgInfo?uid=user@company&pass=xxx&index=
<message id> (message id generated by SNS++ as respond to client send message)

Highnet Systems Ltd.


24 Raoul Wallenberg St.
Tel-Aviv 6971923, Israel
 + 9 7 2 - 3- 9 2 2 3 2 8 4  + 9 7 2 - 3- 9 2 2 3 2 8 5  info@highnet -sys.com
Http Client Response Codes - JSON Schema (IETF Draft 4.0)
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"status": {
"type": "integer",
"minimum": 1
},
"info": {
"type": "string",
"maxLength": 256
}
},
"required": [
"status",
"info"
]
}
In Case of Success
{"status":200,"info":"<id>"} (id is unique id generated by SNS++)

In Case of Failure
{"status":500,"info":"Could not login user"}
{"status":500,"info":"User data is invalid"}
{"status":500,"info":"User does not exist"}
{"status":500,"info":"User is temporarily blocked"}
{"status":500,"info":"User is unauthorized"}
{"status":500,"info":"Missing one or more mandatory parameters: uid,
pass, to, msg"}
{"status":500,"info":"Could not save client message object: <database
exception>"}

Highnet Systems Ltd.


24 Raoul Wallenberg St.
Tel-Aviv 6971923, Israel
 + 9 7 2 - 3- 9 2 2 3 2 8 4  + 9 7 2 - 3- 9 2 2 3 2 8 5  info@highnet -sys.com

Das könnte Ihnen auch gefallen