Skip to Content
Odoo Menu
  • Zaloguj się
  • Wypróbuj za darmo
  • Aplikacje
    Finanse
    • Księgowość
    • Fakturowanie
    • Wydatki
    • Arkusz kalkulacyjny (BI)
    • Dokumenty
    • Podpisy
    Sprzedaż
    • CRM
    • Sprzedaż
    • PoS Sklep
    • PoS Restauracja
    • Subskrypcje
    • Wypożyczalnia
    Strony Internetowe
    • Kreator Stron Internetowych
    • eCommerce
    • Blog
    • Forum
    • Czat na Żywo
    • eLearning
    Łańcuch dostaw
    • Magazyn
    • Produkcja
    • PLM
    • Zakupy
    • Konserwacja
    • Jakość
    Zasoby Ludzkie
    • Pracownicy
    • Rekrutacja
    • Urlopy
    • Ocena pracy
    • Polecenia Pracownicze
    • Flota
    Marketing
    • Marketing Społecznościowy
    • E-mail Marketing
    • SMS Marketing
    • Wydarzenia
    • Automatyzacja Marketingu
    • Ankiety
    Usługi
    • Projekt
    • Ewidencja czasu pracy
    • Usługi Terenowe
    • Helpdesk
    • Planowanie
    • Spotkania
    Produktywność
    • Dyskusje
    • Zatwierdzenia
    • IoT
    • VoIP
    • Baza wiedzy
    • WhatsApp
    Aplikacje trzecich stron Studio Odoo Odoo Cloud Platform
  • Branże
    Sprzedaż detaliczna
    • Księgarnia
    • Sklep odzieżowy
    • Sklep meblowy
    • Sklep spożywczy
    • Sklep z narzędziami
    • Sklep z zabawkami
    Żywienie i hotelarstwo
    • Bar i Pub
    • Restauracja
    • Fast Food
    • Pensjonat
    • Dystrybutor napojów
    • Hotel
    Agencja nieruchomości
    • Agencja nieruchomości
    • Biuro architektoniczne
    • Budowa
    • Zarządzanie nieruchomościami
    • Ogrodnictwo
    • Stowarzyszenie właścicieli nieruchomości
    Doradztwo
    • Biuro księgowe
    • Partner Odoo
    • Agencja marketingowa
    • Kancelaria prawna
    • Agencja rekrutacyjna
    • Audyt i certyfikacja
    Produkcja
    • Tekstylia
    • Metal
    • Meble
    • Jedzenie
    • Browar
    • Prezenty firmowe
    Zdrowie & Fitness
    • Klub sportowy
    • Salon optyczny
    • Centrum fitness
    • Praktycy Wellness
    • Apteka
    • Salon fryzjerski
    Transakcje
    • Złota rączka
    • Wsparcie Sprzętu IT
    • Systemy energii słonecznej
    • Szewc
    • Firma sprzątająca
    • Usługi HVAC
    Inne
    • Organizacja non-profit
    • Agencja Środowiskowa
    • Wynajem billboardów
    • Fotografia
    • Leasing rowerów
    • Sprzedawca oprogramowania
    Przeglądaj wszystkie branże
  • Community
    Ucz się
    • Samouczki
    • Dokumentacja
    • Certyfikacje
    • Szkolenie
    • Blog
    • Podcast
    Pomóż w nauce innym
    • Program Edukacyjny
    • Scale Up! Gra biznesowa
    • Odwiedź Odoo
    Skorzystaj z oprogramowania
    • Pobierz
    • Porównaj edycje
    • Wydania
    Współpracuj
    • Github
    • Forum
    • Wydarzenia
    • Tłumaczenia
    • Zostań partnerem
    • Usługi dla partnerów
    • Zarejestruj swoją firmę rachunkową
    Skorzystaj z usług
    • Znajdź partnera
    • Znajdź księgowego
    • Spotkaj się z doradcą
    • Usługi wdrożenia
    • Opinie klientów
    • Wsparcie
    • Aktualizacje
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Zaplanuj demo
  • Cennik
  • Pomoc

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

  • CRM
  • e-Commerce
  • Księgowość
  • Zapasy
  • PoS
  • Projekt
  • MRP
All apps
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Pomoc

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

Zaprenumeruj

Otrzymaj powiadomienie o aktywności w tym poście

To pytanie dostało ostrzeżenie
restfultokenroute
1 Odpowiedz
14498 Widoki
Awatar
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
Awatar
Odrzuć
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,

Awatar
Bhavin Patel
Najlepsza odpowiedź

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
Awatar
Odrzuć
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.

Podoba Ci się ta dyskusja? Dołącz do niej!

Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!

Zarejestruj się
Powiązane posty Odpowiedzi Widoki Czynność
No Buy Route in Odoo 18 Rozwiązane
route
Awatar
Awatar
1
paź 25
1806
Changing route on confirmed sale order Rozwiązane
route
Awatar
Awatar
Awatar
3
maj 21
5151
How to configure Advanced Routes
route
Awatar
Awatar
Awatar
4
maj 18
4834
Odoo object.access_toke
token
Awatar
0
sie 16
5353
Allocate the Warehouse to a SO based on the product category Rozwiązane
warehouse route
Awatar
Awatar
1
sty 25
1606
Społeczność
  • Samouczki
  • Dokumentacja
  • Forum
Open Source
  • Pobierz
  • Github
  • Runbot
  • Tłumaczenia
Usługi
  • Hosting Odoo.sh
  • Wsparcie
  • Aktualizacja
  • Indywidualne rozwiązania
  • Edukacja
  • Znajdź księgowego
  • Znajdź partnera
  • Zostań partnerem
O nas
  • Nasza firma
  • Zasoby marki
  • Skontaktuj się z nami
  • Oferty pracy
  • Wydarzenia
  • Podcast
  • Blog
  • Klienci
  • Informacje prawne • Prywatność
  • Bezpieczeństwo Odoo
الْعَرَبيّة 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 to pakiet aplikacji biznesowych typu open source, które zaspokoją wszystkie potrzeby Twojej firmy: CRM, eCommerce, księgowość, inwentaryzacja, punkt sprzedaży, zarządzanie projektami itp.

Unikalną wartością Odoo jest to, że jest jednocześnie bardzo łatwe w użyciu i w pełni zintegrowane.

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