Post by brainyprb » Thu Jun 13, 2019 4:24 pm

I am getting the following error while trying to login to opencart api

Notice: Undefined index: api_token in /var/www/html/example.com/catalog/controller/startup/session.php on line 8Notice: Undefined variable: config in /var/www/html/example.com/catalog/controller/api/login.php on line 30

I tried using python and also postman, i could not find the issue, it the opencart api code in itself broken ?

Code: Select all

import requests

    s = requests.Session()

    username = 'my_username'




 key='opmVKtQGll4pddfg68kEqH4kS5dGFbx5nhJ5VSJRXePlJzpUsk4id0ZZX5NXu6Hyf0hYCTYAHPWo62lGroiKkbjHPIutaEQ624kFU1eKVzPVqAOyo226AslRyDYJjPoH1Jq0BTamFtIY5QOcXrBBD3osryUgdKae3RPJROxDcJw4gf45rQUQMP4dek7zhDPzwG16VDRiC5WALItSYrEzYlPu1Wx1HfkjqCWvEApuZlDWCSoVcxLpohxdEMOKSytF'

    s.post(
    'https://example.com/index.php?route=api/login',
    data={'username':username, 'key':key}
).text
I am expecting to receive token for the logged in session

Newbie

Posts

Joined
Thu Aug 17, 2017 2:14 am

Post by straightlight » Thu Jun 13, 2019 9:16 pm

No OC version posted. Forum rules.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: JessiesBoutique, pprmkr and 500 guests