1

I'm getting error: 7 what I'm doing wrong?

Тема: I'm getting error: 7 what I'm doing wrong?

Hello people

To get my token I'm using access_type =-1 as follows:
http://hosting.wialon.com/login.html?access_type=-1

I'm trying to get current position from one unit for doing this I'm using this:
route: core/search_item
params.flag: 4194304

https://hst-api.wialon.com/wialon/ajax.html?svc=core/search_item&params={"id":000000000000000,"flags":4194304}&sid=000....

Everything seems to be alright, but when I try to GET current position throw me { error: 7 } (Access denied)

I readed some where in the documentation that we have to activate the SDK service (but my provider dont know about this topic) and I dont know if this feature is enabled or disabled. Where I could find this information?

As aditional information I'm using php library wich I downloaded from GIT
Currently I'm not able to share my ID's
Hope some one could help me.

Thanks in advance.

2

I'm getting error: 7 what I'm doing wrong?

Re: I'm getting error: 7 what I'm doing wrong?

Hello!

The error 7 due to request search_item means that is not access right (not enough access right) or not correct item id.
Please check the access rights for user by which you login - https://sdk.wialon.com/wiki/en/sidebar/ … cess_flags
You can execute searh_item with flag =1 and check the "uacl" - current user access level for unit

Also check the id - you can execute request search_items to find unit by name, and get the id in response.

Diana Cheley
Wialon Hosting Expert
Gurtam
3

I'm getting error: 7 what I'm doing wrong?

Re: I'm getting error: 7 what I'm doing wrong?

Thanks, I was sending IMEI instead of ID item.

Excuse me, two more questions.

What is the correct/best way to get my item last position?
I have to do the login every time I do an API call or how long the SID lasts?

Regards.

4

I'm getting error: 7 what I'm doing wrong?

Re: I'm getting error: 7 what I'm doing wrong?

carlos.rainde.net пишет:

Thanks, I was sending IMEI instead of ID item.

Excuse me, two more questions.

What is the correct/best way to get my item last position?
I have to do the login every time I do an API call or how long the SID lasts?

Regards.


Hi!

Depend on your task (your app logic) you can get last position from requests search_item(s) , including flag value = 1024, last position
it's useful when you, for example, build the table (list) of all units where one of column is last position, but in this case to update date it needs to execute again this request
The other way is execute request avl_evts periodically, for example every 2-3 sec - https://sdk.wialon.com/wiki/en/sidebar/ … s/avl_evts
And catch the new messages from unit
This way is good that you can get always the update data and due to constitutionally execution it allows to hold session,
The session lasts during 5 minutes after last request to server. If there is no executing any request after 5 minutes, the session will be interrupted.

Diana Cheley
Wialon Hosting Expert
Gurtam
5

I'm getting error: 7 what I'm doing wrong?

Re: I'm getting error: 7 what I'm doing wrong?

Hi, thaks a lot for your help.
Excuse me, I have another question.
I have read the following article about events https://sdk.wialon.com/wiki/en/sidebar/ … datafalags
I understand that we have to add units to the session, but I do not know exactly how to listen for event that provide latitud and longitud.
Do I have to add my unit with an specific flag?

6

I'm getting error: 7 what I'm doing wrong?

Re: I'm getting error: 7 what I'm doing wrong?

carlos.rainde.net пишет:

Hi, thaks a lot for your help.
Excuse me, I have another question.
I have read the following article about events https://sdk.wialon.com/wiki/en/sidebar/ … datafalags
I understand that we have to add units to the session, but I do not know exactly how to listen for event that provide latitud and longitud.
Do I have to add my unit with an specific flag?

Hi Carlos!

You are right, you need to add unit id and specify flag = 1024 (in dec) to get unit's position
https://sdk.wialon.com/wiki/en/sidebar/ … d_position

https://sdk.wialon.com/wiki/en/sidebar/ … data_flags

Diana Cheley
Wialon Hosting Expert
Gurtam
7

I'm getting error: 7 what I'm doing wrong?

Re: I'm getting error: 7 what I'm doing wrong?

Thanks a lot, that works.

8

I'm getting error: 7 what I'm doing wrong?

Re: I'm getting error: 7 what I'm doing wrong?

Hello,
I want to know the reason why I get message error ACCESS DENIED or error:7 when I try to login using "url/wialon/ajax.html?svc=core/login&params={user:"username",password:"password"}" OR "wialon.core.Session.getInstance().login()"

Thank you in advance!

9

I'm getting error: 7 what I'm doing wrong?

Re: I'm getting error: 7 what I'm doing wrong?

detroithitec 
core/login method is deprecated, see docs