Homepage | Products | OX Knowledge Base | Support | Try Now | Contact | Company
OX Logo
Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2014
    Posts
    8

    Default 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. #2
    Join Date
    Aug 2014
    Posts
    8

    Default

    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))

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •