Topic: cannot create driver
Hi guys, I am trying this request:
and I keep getting error 7, what could be the problem? if needed I can send in PM the login i use
Hi guys, I am trying this request:
and I keep getting error 7, what could be the problem? if needed I can send in PM the login i use
Hello
error 7 - Access denied code
Check your ACL to resource with "itemId":12198150 and ensure you have "Create driver" enabled
thanks, yes I noticed err 7 is access denied. The account where I try to create the driver has full access, incl Resources - ACL
Check your token access_flags
You need at least
0x100 - to view drivers (default access_flags value)
0x800 - to create/edit//delete
I use flag -1, the exact request is
http://mysite.com/login.html?client_id= … duration=0
after that i send user/pass to this form to login and get token from its navigated url
Lets try to execute following request
http://hst-api.wialon.com/wialon/ajax.html?svc=core/search_item¶ms={"id":12198150,"flags":1}&sid=
and check "cls" and "uacl" fields in response
thanks, response is
{"item":{"nm":"XXXX","cls":1,"id":12198150,"mu":0,"uacl":2146947},"flags":1}
thanks, response is
{"item":{"nm":"XXXX","cls":1,"id":12198150,"mu":0,"uacl":2146947},"flags":1}
Ok, now its clear
This item is user ("cls": 1) and for resource/update_driver you have to send resource id
yes that is correct, this item is user and its resource id is 12198150. This user is created as sub account of another "top" account. Using same api request at the top of this thread but the resource ID of the top account i can create driver under "top" account. Question is what has to be enabled to allow the subaccount to create drivers
this item is user and its resource id is 12198150
User and account (resource) are different instances, and you can't create driver in user.
Try this request and you'll see "bact" - account (resource) id of this user
http://hst-api.wialon.com/wialon/ajax.html?svc=core/search_item¶ms={"id":12198150,"flags":5}&sid=
Ok shmi,
i got the info from support, that if i have a master account which has subaccounts and each subaccount need to have its own driver ans each vehicle is sending ddd files and needs to be analysed by each individual account and each subuser should NOT see all 1000 drivers from all subusers than i need to create for each subuser a ressource and now i can add drivers for each subuser.
Only not via the API?
Wolf.
Hi Wolf
First of all CMS and Hosting sites works via Remote API so everything you can do in interface can be implemented via Remote API. The only problem is to understand exactly what do you need.
We can't split 1000 drivers from same resource to grant access to different users, so if you need separate drivers lists for users - you have to create drivers in different resources and grant each user access to needed.
Logic here is pretty straightforward
- login with master account with token/login
- create user using core/create_user or find existing using core/search_items - in response you'll get userId
- create resource for user (creatorId = userId) using core/create_resource - in response you'll get resourceId
- Optionally - you can convert new resource into account account/create_account
- create driver in new resource (itemId = resourceId) with resource/update_driver
In first message of topic you are sending itemId=userId instead of itemId=resourceId for resource/update_driver
Please give me to know is something still unclear
thanks shmi, i think i start to understand what i am doing wrong. Only one thing is not clear atm - when I create resource for user - what flag should I specify?
i tried with flag 1 but received error 1002:
http://hst-api.wialon.com/wialon/ajax.html?svc=core/create_resource¶ms={"creatorId":12198150, "name":"test1","dataFlags":1, "skipCreatorCheck":1}&sid=
with flag 256 i get same error
venellinus, error 1002 means that such resource name (test1) already exists. Pass another resource name.
thanks, actually it is even simpler, we have the resources already created(manually). I just need to search for resourceID , driver creation works then ok
thanks both of you for your help
I am developing an new App where I use Wialon API to log in a Driver with phonenumber and password.
With the Drivers operate request:
https://sdk.wialon.com/wiki/en/kit/remo … er_operate
But how is it possible to login a Driver that is not bind to a unit yet?