Differences
This shows you the differences between two versions of the page.
|
|
en:pro:remoteapi:codesamples:batch [06/03/2013 16:31] zuve |
en:pro:remoteapi:codesamples:batch [29/11/2013 13:31] |
{{indexmenu_n>11}} | |
====== Executing several commands at once ====== | |
| |
Several commands can be executed with one request. In this case, the response is also presented in one JSON. For example we may need to send an online message to many users. We can do this using combination of [[../apiref/core/batch|core/batch]] and [[../apiref/user/update_user_notification|user/update_user_notification]] commands: | |
| |
<code> | |
<your_wialon_pro_address>/ajax.html?svc=core/batch& | |
params=[{ | |
"svc":"user/update_user_notification", | |
"params":{ | |
"h":"Hi there!", | |
"d":";-)", | |
"s":"", | |
"ttl":1359015606, | |
"itemId":30, | |
"id":0, | |
"callMode":"create" | |
} | |
},{ | |
"svc":"user/update_user_notification", | |
"params":{ | |
"h":"Hi there!", | |
"d":";-)", | |
"s":"", | |
"ttl":1359015606, | |
"itemId":39, | |
"id":0, | |
"callMode":"create" | |
} | |
}]&sid=<your_sid> | |
</code> | |
| |
Response: | |
<code javascript> | |
[ | |
[1, { | |
"t": 1359013247, | |
"d": ";-)", | |
"h": "Hi there!", | |
"s": "" | |
}], | |
[1, { | |
"t": 1359013247, | |
"d": ";-)", | |
"h": "Hi there!", | |
"s": "" | |
}] | |
] | |
</code> | |