1

Adding wialon apps in KIT

(11/01/2016 14:20:56 отредактировано kaippally)

Тема: Adding wialon apps in KIT

While logged in as top level user I query for available service and I get

svc : core/get_account_data 

This produces:

{
  "plan": "Wialon Kit",
  "enabled": 1,
  "switchTime": 0,
  "flags": 18,
  "created": 1385571094,
  "balance": "0.00",
  "daysCounter": 0,
  "services": {
   ...
    "email_report": {
      "type": 1,
      "usage": 3,
      "maxUsage": 600
    },
    "app.1452509616_65219": {
      "type": 1,
      "usage": 0,
      "maxUsage": -1
    },
  ...
    
  },
  "dealerRights": 1,
  "subPlans": [
    "Wialon Kit"
  ]
}

Now I want to give access to this app to user

So I send the following api  request:

note: the user itemId = 11761996 and resource itemId is 11761997

svc='account/update_billing_plan'
 params =
    { 'itemId':11761997,
        'callMode':'update',
        personal:{
            "services":  
            {'app.1452509616_65219':{                  
                    "type": 2,       
                    "maxUsage": 0,     
                    "cost": [],          
                    "interval": 0,   
                    "descr": 'Sensor Console',       
                    "flags": 0  
                }
            }
        }

    }

I get error 4 (invalid input)

Pleae help

Nishad Hussain Kaippally
Implementation Specialist, Middle East, Gurtam

"Computer science is no more about computers than astronomy is about telescopes."
2

Adding wialon apps in KIT

Re: Adding wialon apps in KIT

If you want grant access to user you should use account/update_billing_service (not account/update_billing_plan). Like this

svc=account/update_billing_service
params={"itemId":544,"name":"app.chatterbox","type":1,"intervalType":0,"costTable":"-1"}

Another variant, more complicated, is create billing plan and then set it to the account.

3

Adding wialon apps in KIT

Re: Adding wialon apps in KIT

Thanks Shmi, That was quick

Nishad Hussain Kaippally
Implementation Specialist, Middle East, Gurtam

"Computer science is no more about computers than astronomy is about telescopes."
4

Adding wialon apps in KIT

Re: Adding wialon apps in KIT

It did work once but now  for some unknown reason. The apps don't appear in the sub accounts.

As you suggested I tried the following from the top level account

[{svc:'account/update_billing_service', params:{"itemId":a,"name":"app.1452509616_65219","type":1,"intervalType":0,"costTable":'-1'}}]

But when I try the follwoing from the lower level account :

{svc:'apps/list',params:{"manageMode":0,"filterLang":"en"}}

The new app does not appear.

Nishad Hussain Kaippally
Implementation Specialist, Middle East, Gurtam

"Computer science is no more about computers than astronomy is about telescopes."
5

Adding wialon apps in KIT

Re: Adding wialon apps in KIT

kaippally
My fail, "costTable":'-1' means disable service, use "costTable":"" to enable it