Ir al contenido
Odoo Menú
  • Identificarse
  • Pruébalo gratis
  • Aplicaciones
    Finanzas
    • Contabilidad
    • Facturación
    • Gastos
    • Hoja de cálculo (BI)
    • Documentos
    • Firma electrónica
    Ventas
    • CRM
    • Ventas
    • TPV para tiendas
    • TPV para restaurantes
    • Suscripciones
    • Alquiler
    Sitios web
    • Creador de sitios web
    • Comercio electrónico
    • Blog
    • Foro
    • Chat en directo
    • e-learning
    Cadena de suministro
    • Inventario
    • Fabricación
    • PLM
    • Compra
    • Mantenimiento
    • Calidad
    Recursos Humanos
    • Empleados
    • Reclutamiento
    • Ausencias
    • Evaluación
    • Referencias
    • Flota
    Marketing
    • Marketing social
    • Marketing por correo electrónico
    • Marketing por SMS
    • Eventos
    • Automatización de marketing
    • Encuestas
    Servicios
    • Proyecto
    • Partes de horas
    • Servicio de campo
    • Servicio de asistencia
    • Planificación
    • Citas
    Productividad
    • Conversaciones
    • Aprobaciones
    • IoT
    • VoIP
    • Conocimientos
    • WhatsApp
    Aplicaciones de terceros Studio de Odoo Plataforma de Odoo Cloud
  • Industrias
    Comercio al por menor
    • Librería
    • Tienda de ropa
    • Tienda de muebles
    • Tienda de ultramarinos
    • Ferretería
    • Juguetería
    Alimentación y hostelería
    • Bar y pub
    • Restaurante
    • Comida rápida
    • Casa de huéspedes
    • Distribuidor de bebidas
    • Hotel
    Inmueble
    • Agencia inmobiliaria
    • Estudio de arquitectura
    • Construcción
    • Gestión inmobiliaria
    • Jardinería
    • Asociación de propietarios
    Consultoría
    • Empresa contable
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Fabricación
    • Textil
    • Metal
    • Muebles
    • Alimentos
    • Cervecería
    • Regalos de empresas
    Salud y bienestar
    • Club deportivo
    • Óptica
    • Gimnasio
    • Terapeutas
    • Farmacia
    • Peluquería
    Oficios
    • Handyman
    • Hardware y soporte técnico
    • Sistemas de energía solar
    • Zapatero
    • Servicios de limpieza
    • Servicios de calefacción, ventilación y aire acondicionado
    Otros
    • Organización sin ánimo de lucro
    • Agencia de protección del medio ambiente
    • Alquiler de paneles publicitarios
    • Estudio fotográfico
    • Alquiler de bicicletas
    • Distribuidor de software
    Explorar todos los sectores
  • Comunidad
    Aprender
    • Tutoriales
    • Documentación
    • Certificaciones
    • Formación
    • Blog
    • Podcast
    Potenciar la educación
    • Programa de formación
    • Scale Up! El juego empresarial
    • Visita Odoo
    Obtener el software
    • Descargar
    • Comparar ediciones
    • Versiones
    Colaborar
    • GitHub
    • Foro
    • Eventos
    • Traducciones
    • Convertirse en partner
    • Servicios para partners
    • Registrar tu empresa contable
    Obtener servicios
    • Encontrar un partner
    • Encontrar un asesor fiscal
    • Contacta con un experto
    • Servicios de implementación
    • Referencias de clientes
    • Ayuda
    • Actualizaciones
    GitHub YouTube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicitar una demostración
  • Precios
  • Ayuda

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

  • CRM
  • e-Commerce
  • Contabilidad
  • Inventario
  • PoS
  • Proyecto
  • MRP
All apps
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Ayuda

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

Suscribirse

Reciba una notificación cuando haya actividad en esta publicación

Se marcó esta pregunta
restfultokenroute
1 Responder
14519 Vistas
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
Descartar
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
Mejor respuesta

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
Descartar
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.

¿Le interesa esta conversación? ¡Participe en ella!

Cree una cuenta para poder utilizar funciones exclusivas e interactuar con la comunidad.

Inscribirse
Publicaciones relacionadas Respuestas Vistas Actividad
No Buy Route in Odoo 18 Resuelto
route
Avatar
Avatar
1
oct 25
1814
Changing route on confirmed sale order Resuelto
route
Avatar
Avatar
Avatar
3
may 21
5154
How to configure Advanced Routes
route
Avatar
Avatar
Avatar
4
may 18
4838
Odoo object.access_toke
token
Avatar
0
ago 16
5356
Allocate the Warehouse to a SO based on the product category Resuelto
warehouse route
Avatar
Avatar
1
ene 25
1608
Comunidad
  • Tutoriales
  • Documentación
  • Foro
Código abierto
  • Descargar
  • GitHub
  • Runbot
  • Traducciones
Servicios
  • Alojamiento Odoo.sh
  • Ayuda
  • Actualizar
  • Desarrollos personalizados
  • Educación
  • Encontrar un asesor fiscal
  • Encontrar un partner
  • Convertirse en partner
Sobre nosotros
  • Nuestra empresa
  • Activos de marca
  • Contacta con nosotros
  • Puestos de trabajo
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Información legal • Privacidad
  • Seguridad
الْعَرَبيّة 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 es un conjunto de aplicaciones de código abierto que cubren todas las necesidades de tu empresa: CRM, comercio electrónico, contabilidad, inventario, punto de venta, gestión de proyectos, etc.

La propuesta única de valor de Odoo es ser muy fácil de usar y totalmente integrado.

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