diff options
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 |
