Skip to Content
Odoo Menu
  • Prihlásiť sa
  • Vyskúšajte zadarmo
  • Aplikácie
    Financie
    • Účtovníctvo
    • Fakturácia
    • Výdavky
    • Tabuľka (BI)
    • Dokumenty
    • Podpis
    Predaj
    • CRM
    • Predaj
    • POS Shop
    • POS Restaurant
    • Manažment odberu
    • Požičovňa
    Webstránky
    • Tvorca webstránok
    • eShop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Supply Chain
    • Sklad
    • Výroba
    • Správa životného cyklu produktu
    • Nákup
    • Údržba
    • Manažment kvality
    Ľudské zdroje
    • Zamestnanci
    • Nábor zamestnancov
    • Voľné dni
    • Hodnotenia
    • Odporúčania
    • Vozový park
    Marketing
    • Marketing sociálnych sietí
    • Email marketing
    • SMS marketing
    • Eventy
    • Marketingová automatizácia
    • Prieskumy
    Služby
    • Projektové riadenie
    • Pracovné výkazy
    • Práca v teréne
    • Helpdesk
    • Plánovanie
    • Schôdzky
    Produktivita
    • Tímová komunikácia
    • Schvalovania
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Priemyselné odvetvia
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Reštaurácia
    • Fast Food
    • Guest House
    • Beverage distributor
    • Hotel
    Reality
    • Real Estate Agency
    • Architecture Firm
    • Konštrukcia
    • Estate Managament
    • Gardening
    • Property Owner Association
    Poradenstvo
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Jedlo
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware and Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Iní
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Komunita
    Vzdelávanie
    • Tutoriály
    • Dokumentácia
    • Certifikácie
    • Školenie
    • Blog
    • Podcast
    Empower Education
    • Vzdelávací program
    • Scale Up! Business Game
    • Visit Odoo
    Softvér
    • Stiahnuť
    • Porovnanie Community a Enterprise vierzie
    • Releases
    Spolupráca
    • Github
    • Fórum
    • Eventy
    • Preklady
    • Staň sa partnerom
    • Services for Partners
    • Register your Accounting Firm
    Služby
    • Nájdite partnera
    • Nájdite účtovníka
    • Meet an advisor
    • Implementation Services
    • Zákaznícke referencie
    • Podpora
    • Upgrades
    ​Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Získajte demo
  • Cenník
  • Pomoc

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Účtovníctvo
  • Sklady
  • PoS
  • Projektové riadenie
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
Pomoc

odoo[15.0]: rest api use api token instead of password of the user?

Odoberať

Get notified when there's activity on this post

This question has been flagged
restfultokenroute
1 Odpoveď
14508 Zobrazenia
Avatar
Boujraf Youssef

I 'd like to use rest api to exchange data with Odoo.


I tried to connect to Odoo through the rest api but the password to use is not api token but user password.

How to force or which route I need to use to force api token instead of user password ?


Best Regards

0
Avatar
Zrušiť
Boujraf Youssef
Autor

Thanks Dear for your answer,

It works with jsonrpc 2.0 with basic authentication, need to check if I could use oauth2.0.

Best Regards,

Avatar
Bhavin Patel
Best Answer

Odoo's REST API authentication system, by default, requires the usage of a username and password combination. You may, however, setup the system to accept authentication with an API token rather than a password.

To enable API token authentication in Odoo 15, you will need to follow these steps:

Create an API user with the required permissions. This user will be used to generate the API token that will be used for authentication.

Generate an API token for the API user. You can do this by navigating to the user's profile in Odoo, selecting the "Access Rights" tab, and clicking on the "Generate" button next to the API token field.

Once you have generated the API token, you can use it in place of the user's password to authenticate your API requests. You will need to include the token in the "Authorization" header of your API requests, using the following format: "Bearer [token]".

You can now use the Odoo REST API with the API token to authenticate your requests.

Please note that you will need to configure the Odoo server to allow API token authentication. To do this, you will need to set the "api_key" configuration parameter to "True" in the Odoo configuration file. You can find more information about configuring the Odoo server in the official Odoo documentation. https://www.odoo.com/documentation/master/developer/reference/external_api.html

3
Avatar
Zrušiť
Boujraf Youssef
Autor

Dear Thanks for your quick answer.

Boujraf Youssef
Autor

Dear,
Do you have the jsonrpc 2.0 structure to control CRUD ?
Best Regards

Bhavin Patel

Yes, Odoo v15 uses the JSON-RPC 2.0 protocol for remote procedure calls, including CRUD operations. Here is an example of the JSON-RPC 2.0 request structure for a basic CRUD operation (in this example, we'll use the res.partner model):

Let's break down this example request:

jsonrpc: The JSON-RPC protocol version. In this case, it's set to "2.0".
method: The remote method to be called. In this case, we're using the call method.
params: The parameters for the remote method. In this case, we're specifying:
model: The name of the Odoo model to interact with. In this case, it's res.partner.
method: The method to be called on the model. In this case, it's create, which will create a new record.
args: An array of arguments to be passed to the method. In this case, we're passing a dictionary of field values for the new res.partner record.
id: An identifier for the request. This can be any JSON value and is used to match requests to responses.

For other CRUD operations, such as read, update, and delete, you would simply change the method parameter to the appropriate method (read, write, or unlink, respectively) and adjust the args parameter accordingly.

Note that you'll need to authenticate with the Odoo server before making any requests. Odoo supports several authentication methods, including session-based authentication and OAuth 2.0. You can find more information on authentication in the Odoo documentation.

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Registrácia
Related Posts Replies Zobrazenia Aktivita
No Buy Route in Odoo 18 Solved
route
Avatar
Avatar
1
okt 25
1808
Changing route on confirmed sale order Solved
route
Avatar
Avatar
Avatar
3
máj 21
5152
How to configure Advanced Routes
route
Avatar
Avatar
Avatar
4
máj 18
4835
Odoo object.access_toke
token
Avatar
0
aug 16
5354
Allocate the Warehouse to a SO based on the product category Solved
warehouse route
Avatar
Avatar
1
jan 25
1606
Komunita
  • Tutoriály
  • Dokumentácia
  • Fórum
Open Source
  • Stiahnuť
  • Github
  • Runbot
  • Preklady
Služby
  • Odoo.sh hosting
  • Podpora
  • Vyššia verzia
  • Custom Developments
  • Vzdelávanie
  • Nájdite účtovníka
  • Nájdite partnera
  • Staň sa partnerom
O nás
  • Naša spoločnosť
  • Majetok značky
  • Kontaktujte nás
  • Pracovné ponuky
  • Eventy
  • Podcast
  • Blog
  • Zákazníci
  • Právne dokumenty • Súkromie
  • Bezpečnosť
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo je sada podnikových aplikácií s otvoreným zdrojovým kódom, ktoré pokrývajú všetky potreby vašej spoločnosti: CRM, e-shop, účtovníctvo, skladové hospodárstvo, miesto predaja, projektový manažment atď.

Odoo prináša vysokú pridanú hodnotu v jednoduchom použití a súčasne plne integrovanými biznis aplikáciami.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now