1

Trouble with remote api url for notifications

Topic: Trouble with remote api url for notifications

Hi,

I cant figure what is worng with this URL I want to create a notification but it gives an "error: 4" , this is the url:
https://kit-api.wialon.com/wialon/ajax.html?svc=resource/update_notification&params={"itemId":746743,"n":"Notif+de+prueba","txt":"Notif+de+prueba","ta":"1393390800","td":"1488085200","ma":0,"mmtd":120,"cdt":59,"cp":3,"mast":60,"mpst":120,"fl":0×1,"tz":-7,"la":"es","un":[11502914],"sch":{"f1":0,"f2":0,"t1":0,"t2":0,"m":0,"y":0,"w":0},"id":0,"callMode":"create","trg":{"t":"geozone","p":{"geozone_ids":"28","type":0}},"act":[{"t":"event","p":{"flags":0}}]}&sid=8e94a1e25fd7c2d77a8cc758e91007f0

2

Trouble with remote api url for notifications

Re: Trouble with remote api url for notifications

When you have {error: 4} please first of all check your `params` with any json validator (for example, http://json.parser.online.fr/)

In given example

{"itemId":746743,"n":"Notif+de+prueba","txt":"Notif+de+prueba","ta":"1393390800","td":"1488085200","ma":0,"mmtd":120,"cdt":59,"cp":3,"mast":60,"mpst":120,"fl":0×1,"tz":-7,"la":"es","un":[11502914],"sch":{"f1":0,"f2":0,"t1":0,"t2":0,"m":0,"y":0,"w":0},"id":0,"callMode":"create","trg":{"t":"geozone","p":{"geozone_ids":"28","type":0}},"act":[{"t":"event","p":{"flags":0}}]}

`params` json is not valid: SyntaxError: Unexpected token ×. You have to use x (letter) but not × (multiply symbol) in hex, replace "fl":0×1 with "fl":0x1

3

Trouble with remote api url for notifications

Re: Trouble with remote api url for notifications

Thanks,
I replaced, in the parser seems every thing ok. but in the remote api keeps giving an error: 4

4

Trouble with remote api url for notifications

Re: Trouble with remote api url for notifications

URL shoul be encoded, replace "+" symbols with %2b.
Also "tz" param should be in seconds, so use -25200 instead of -7