1

Error 4 on svc=resource/update_notification

(08/09/2016 09:55:57 отредактировано davis.tom)

Тема: Error 4 on svc=resource/update_notification

I'm trying to create a new notification using Remote API.

https://hst-api.wialon.com/wialon/ajax.html?svc=resource/update_notification&params={"itemId":13935213,"id":0,"callMode":"create","n":"name1","txt":"dect1","ta":1473019200,"td":0,"ma":0,"mmtd":2,"cdt":2,"mast":2,"mpst":2,"cp":2,"fl":1,"un":[13016217,13016242,14046325],"trg":"speed","act":["push_messages"]}&sid=SID

Above is the call I'm using. My doubt is whether I'm using the correct itemId param. This value is the value i get under "bact" for call svc=token/login.

2

Error 4 on svc=resource/update_notification

(08/09/2016 10:30:36 отредактировано spev)

Re: Error 4 on svc=resource/update_notification

You should send correct (full) json. Documentation: https://sdk.wialon.com/wiki/en/sidebar/ … tification
For example: "trg" param - should be object, but in your request - text

+ correct json example
{
    "n": "new notification",
    "ta": 1473282000,
    "td": 0,
    "tz": 134228528,
    "la": "en",
    "ma": 0,
    "sch": {
      "f1": 0,
      "f2": 0,
      "t1": 0,
      "t2": 0,
      "m": 0,
      "y": 0,
      "w": 0
    },
    "un": [
      <unitid>
    ],
    "trg": {
      "t": "speed",
      "p": {
        "sensor_type": "",
        "sensor_name_mask": "",
        "lower_bound": 0,
        "upper_bound": 0,
        "merge": 0,
        "min_speed": 0,
        "max_speed": 100
      }
    },
    "act": [
      {
        "t": "message",
        "p": {
          "name": "new notification",
          "url": "",
          "color": "",
          "blink": 0
        }
      }
    ],
    "txt": "notificationtext",
    "fl": 0,
    "mast": 0,
    "mpst": 0,
    "cdt": 0,
    "mmtd": 3600,
    "cp": 3600,
    "id": 0,
    "itemId": <youritemid>,
    "callMode": "create"
 }
Telegram: Обновления Wialon, Wialon updates
Google Chrome Extensions: Wialon Units Map | Gurtam Forum Notifications | Wialon Apps Launcher
Evgenij Spitsyn, Developer, flespi team
3

Error 4 on svc=resource/update_notification

Re: Error 4 on svc=resource/update_notification

spev пишет:

You should send correct (full) json. Documentation: https://sdk.wialon.com/wiki/en/sidebar/ … tification
For example: "trg" param - should be object, but in your request - text

Thanks, worked.