1

Remote API - eid vs sid question

Тема: Remote API - eid vs sid question

Hello there!
I have a simple question: when I use the login function of the Remote API I'm getting a string in the returned eid field. According to the documentation, that's the session id and should be an integer.
However, I get a string back; and when I try to use that value with the other functions that use the sid parameter, I'm getting errors.
Naturally, I also tried to convert the eid value to an integer, so that I can pass it as the sid.
No success so far.
Can you please help me to sort this out?
Thanks in advance!

2

Remote API - eid vs sid question

(19/10/2012 12:26:35 отредактировано zorrow)

Re: Remote API - eid vs sid question

BTW, this is what I'm doing:

http://hosting.wialon.com/wialon/ajax.html?svc=core/login&params={"user":"myuser","password":"mypassword"}

From this call, I'm getting a result that looks like this:

{"eid":"94f16b429929efe426999b35a5667170".... etc. }

How can I use that returned eid value as the sid for a call to, let's say, logout?

3

Remote API - eid vs sid question

Re: Remote API - eid vs sid question

Field eid has string type. We will correct this mistake in the documentation.

Mobile Development
Gurtam
4

Remote API - eid vs sid question

Re: Remote API - eid vs sid question

kopa пишет:

Field eid has string type. We will correct this mistake in the documentation.

Ok, so... how do I use it as the session ID? Or in other words, how do I get the value to pass to the "sid" parameter then?
Thanks again!

5

Remote API - eid vs sid question

Re: Remote API - eid vs sid question

zorrow

have you tried to pass a string-type "sid" (as "eid" is)?

Developer
Gurtam
6

Remote API - eid vs sid question

Re: Remote API - eid vs sid question

I did try something like this -and it doesn't work:

http://hosting.wialon.com/wialon/ajax.html?svc=core/logout&sid="94f16b429929efe426999b35a5667170"

I haven't tried something like this -I will tonight:

http://hosting.wialon.com/wialon/ajax.html?svc=core/logout&params={"sid":"94f16b429929efe426999b35a5667170"}

However, I strongly prefer avoiding the trial-and-error approach with third-party APIs. I'd better rely on documentation and support.

In any case, it seems like some people around are actually using the Remore API. So, can you guys please provide some examples to, let's say, log in, get the list of units, get the list of POIs and then log out?

Thanks a zillion in advance!

PS: Please don't refer me to the documentation for the examples. I already tried those and we have already confirmed the "eid" field is wrongly documented.

7

Remote API - eid vs sid question

Re: Remote API - eid vs sid question

Try to use:

You don't need to use quotes around HTTP parameter "sid".

Mobile Development
Gurtam
8

Remote API - eid vs sid question

Re: Remote API - eid vs sid question

kopa пишет:

Try to use:

You don't need to use quotes around HTTP parameter "sid".

Ok, this does work. Huge thanks! Now I can move on with all what I want to do. If there's more blocking issues, I'll certainly let you know. wink

Thanks again!