1

Working with svc=resource/update_notification, remoteapi command

(edited by glizarraga 04/10/2013 21:07:02)

Topic: Working with svc=resource/update_notification, remoteapi command

I am trying to create a new notification when an event occurs, but got stocked, it keeps showing error=4, I have two days gueezing what the problem is, here is the url:
https://kit-api.wialon.com/wialon/ajax.html?svc=resource/update_notification&params={"itemId":764053,"id":"","callMode":"create","txt":"","un":[821962],"trg":{"t":"geozone","p":{"geozone_ids":"1","type":"1"}},"act":[{"t":"message","name":"Entro o salio de geo1"},{"t":"event","flags":"0"}]}&sid=7ba1e609456716433b952aa32c91d439

I got the documentation here
http://sdk.wialon.com/wiki/en/sidebar/r … tification
http://sdk.wialon.com/wiki/en/sidebar/r … ation_data

Thanks!

2

Working with svc=resource/update_notification, remoteapi command

Re: Working with svc=resource/update_notification, remoteapi command

Error 4 means a     Invalid input
http://sdk.wialon.com/wiki/en/kit/remot … ors/errors
In your request notification ID is empty : ,"id":""
You should set any number of id when you create a notification
Also you should set other required parameters: name, text of notification and so on
http://sdk.wialon.com/wiki/en/kit/remot … ation_data

Diana Cheley
Wialon Hosting Expert
Gurtam
3

Working with svc=resource/update_notification, remoteapi command

Re: Working with svc=resource/update_notification, remoteapi command

chdi wrote:

Error 4 means a     Invalid input
http://sdk.wialon.com/wiki/en/kit/remot … ors/errors
In your request notification ID is empty : ,"id":""
You should set any number of id when you create a notification
Also you should set other required parameters: name, text of notification and so on
http://sdk.wialon.com/wiki/en/kit/remot … ation_data

Hi, Thanks for your atention.
I am still getting the error, here is the params i´m using.
?svc=resource/update_notification&params={"itemId":"764053","id":"1","callMode":"create","n":"tea","txt":"asdas","ta":"1381196227","td":"1412732227","ma":"1","mmtd":"3","cdt":"3","mast":"3","mpst":"2","cp":"3","tz":"7","la":"es","ac":"4","fl":"0x0","un":["1093167","774390","816212","821962"],"trg":{"t":"geozone","p":{"geozone_ids":[1],"type":"1"}},"act":[{"t":"message","name":"teaaa"},{"t":"event","flags":"0"}]}&sid=6ff759df439e31c1843f2f0a74cf811d

4

Working with svc=resource/update_notification, remoteapi command

Re: Working with svc=resource/update_notification, remoteapi command

Please look attentively which type has every parameter. Everywhere you put text but sometimes int is needed. Also you didn't put parameter sch at all.

Development Department
Gurtam
5

Working with svc=resource/update_notification, remoteapi command

Re: Working with svc=resource/update_notification, remoteapi command

zuve wrote:

Please look attentively which type has every parameter. Everywhere you put text but sometimes int is needed. Also you didn't put parameter sch at all.

Hi! thanks again. I put all parameters in its respective format, and added sch parameter. But im still getting the error: 4.
Is there a way to look at wich param am I failing? This is my last URL params: ?svc=resource/update_notification&params={"itemId":764053,"id":1,"callMode":"create","n":"tea","txt":"asdas","ta":1381196227,"td":1412732227,"ma":1,"mmtd":3,"cdt":3,"mast":3,"mpst":2,"cp":3,"tz":7,"la":"es","ac":4,"fl":0,"sch":{"f1":1,"f2":2,"t1":1,t2:2,"m":3,"y":2014,"w":5},"un":[1093167,774390,816212,821962],"trg":{"t":"geozone","p":{"geozone_ids":[1],"type":1}},"act":[{"t":"message","name":"teaaa"},{"t":"event","flags":"0"}]}&sid=21e3877d3d9ee0c91353e9ffd5f41450

6

Working with svc=resource/update_notification, remoteapi command

Re: Working with svc=resource/update_notification, remoteapi command

Parameter act should be of  following format:
act: [{
    t: <text>,
    p: {}
}]

Development Department
Gurtam
7

Working with svc=resource/update_notification, remoteapi command

Re: Working with svc=resource/update_notification, remoteapi command

zuve wrote:

Parameter act should be of  following format:
act: [{
    t: <text>,
    p: {}
}]

Finally worked!! thanks!