Announcement

Collapse
No announcement yet.

HTTP API invalid session

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • HTTP API invalid session

    Hello

    I am trying to get access to the http api via pythons request module. To say the least, I am stuck.

    The ox logs clearly show that there is not nly a session id created, but a random secret, too. The secret is not delivered to python:

    Code:
    {"session":"long random string","user":"me@mydomain.de","user_id":10,"context_id":2,"locale":"en_US"}
    Due to that (I assume) no further handling of the session in python seems possible (cat:4, "session invalidated").

    What am I missing?

    Thanks, Toby

    P.S.
    Here my params for the login:

    Code:
    login = {'name': 'me@mydomain.de', 'password': 'password'}
    r = requests.post("https://localhost/ajax/login?action=login", data=login, verify=False)

  • #2
    Well, one of these days...

    Found it:

    Code:
    mail = {'session': req['session'], 'columns':'607', 'headers':''}
    res = requests.post("https://localhost/ajax/mail?action=list", data=mail, verify=False, cookies=requests.utils.dict_from_cookiejar(r.cookies))

    Comment

    Working...
    X