I have an instance of Odoo in SH and with it I created webhooks and automated quite a few processes. Now I am trying to do the same with an on-premise Odoo instance installed on a non-Odoo server.
First I tried something simple like this:
import requests
import json
URL = "server-url"
headers = {"Content-Type": "application/json"}
payload = {
"name": "Registro usando webhook y python",
"email_from": "[email protected]",
"phone": "32733888",
"partner_id": 2,
"user_id": 2,
}
json_data = json.dumps(payload)
response = requests.post(URL, headers=headers, data=json_data)
print(response.status_code)
print(response.text)
But I get this error:
404
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>404 Not Found</title>
<h1>Not Found</h1>
<p>The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.</p>
Obviously the url I am sending is not the one I put in the example, it is just for security.