diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-02-22 15:52:47 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-02-22 15:52:47 +0700 |
| commit | 73f5869798fc5ec69d84306139de55acaca06489 (patch) | |
| tree | a3436043447db0619bba3fa854b95474f9a3f463 /indoteknik_api/controllers/api_v1/wati.py | |
| parent | 2a5d4886d2924ef9dae451c841dc3bae9478f9ab (diff) | |
| parent | b9eddb17ac8eeed2b8af734844bb1149ec4184eb (diff) | |
Merge branch 'staging' of bitbucket.org:altafixco/indoteknik-addons into staging
Diffstat (limited to 'indoteknik_api/controllers/api_v1/wati.py')
| -rw-r--r-- | indoteknik_api/controllers/api_v1/wati.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/indoteknik_api/controllers/api_v1/wati.py b/indoteknik_api/controllers/api_v1/wati.py new file mode 100644 index 00000000..68ff1640 --- /dev/null +++ b/indoteknik_api/controllers/api_v1/wati.py @@ -0,0 +1,20 @@ +from .. import controller +from odoo import http +from odoo.http import request +import json + + +class Wati(controller.Controller): + prefix = '/api/v1/' + + @http.route(prefix + 'wati/notification', auth='none', type='json', csrf=False, cors='*', methods=['POST', 'OPTIONS']) + def notification(self, **kw): + json_raw = json.loads(request.httprequest.data) + json_dump = json.dumps(json_raw, indent=4, sort_keys=True) + + request.env['wati.notification'].create([{ + 'json_raw': json_dump, + 'is_lead': False + }]) + + return |
