I can Make Rest API using odoo controller if we don't want authentication i.e using public controller.
Anyone have idea how i can make rest api with authentication using odoo controller.
I tried using controller auth="user" but not able to authenticate using username and password.
If this is not possible using odoo controller then please suggest easiest possible way to make rest api in odoo.
Thanks in advance
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- إدارة علاقات العملاء
- e-Commerce
- المحاسبة
- المخزون
- PoS
- Project
- MRP
لقد تم الإبلاغ عن هذا السؤال
1
الرد
20860
أدوات العرض
Hi,
Use the existing controller, /web/session/authenticate for the authentication purpose.
@http.route('/web/session/authenticate', type='json', auth="none")
def authenticate(self, db, login, password, base_location=None):
request.session.authenticate(db, login, password)
return request.env['ir.http'].session_info()
For creating API's, see this tutorials: How to Build API in Odoo
Thanks
هل أعجبك النقاش؟ لا تكن مستمعاً فقط. شاركنا!
أنشئ حساباً اليوم لتستمتع بالخصائص الحصرية، وتفاعل مع مجتمعنا الرائع!
تسجيل