Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
6509 Widoki

Hello. I'm trying to create a session over JSON-RPC on an odoo online (trial) instance. My method worked with Odoo 9 (community, on-premise, but doesn't with Odoo 14. Instead, I get an Access denied error in response to the request.


curl --location --request POST 'http://host.odoo.com/web/session/authenticate' \
--header 'Content-Type: application/json' \
--data-raw '
{
"jsonrpc": "2.0",
"params": {
"login": "email",
"password": "password",
"db": "dbname"
}
}'

What I have checked:

- the username is valid (it is the one I use to administrate the instance.

- for the password, I have both tried with my own password, and with an API key generated for that user

- the database name is correct.


Is the error specific to the online version of Odoo ? Or is it a change in authentication between v9 and v14 ?


Thank you.

Awatar
Odrzuć

I followed Jainesh's comments above, it worked fine for me, I could successfully authenticate with Odoo 14 server. Many thanks Jainesh.


Najlepsza odpowiedź

Hello Bertrand Dunogier,

can you please try to execute below code. please change few things as per your requirement like URL, Login, Password, Database.

curl -X POST 'http://host.odoo.com/web/session/authenticate' -H 'Content-Type: application/json' \
--data-raw '
{
"jsonrpc": "2.0",
"params": {
"login": "login",
"password": "password",
"db": "database_name"
}
}'


For more you can check this odoo document: https://www.odoo.com/documentation/14.0/developer/howtos/backend.html#json-rpc-library


Hope this may help you!

Thanks & Regards,

Email: odoo@aktivsoftware.com

Skype: kalpeshmaheshwari

Awatar
Odrzuć