diff --git a/.gitignore b/.gitignore index 3102d0c..ad869d5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,7 @@ +# Sensitive files config.py +*.JSON +*.json # ---> Python # Byte-compiled / optimized / DLL files diff --git a/config-sample.py b/config-sample.py index e69de29..f14a8e2 100644 --- a/config-sample.py +++ b/config-sample.py @@ -0,0 +1,6 @@ +# Openbravo API parameters + +ob_api_url = "http://[your-openbravo-domain]/openbravo/org.openbravo.service.json.jsonrest/" +#client_id = "7B75C13C21B945AB9DA2B32DD993FE70" +#client_identifier = "Grupo Acme Companies" +userpass_b64 = "cm9ib3RhcGk6S2kxMzAxa28j" diff --git a/extract-invoice.py b/extract-invoice.py new file mode 100644 index 0000000..6f6e6ad --- /dev/null +++ b/extract-invoice.py @@ -0,0 +1,14 @@ +import requests +from config import * + +url = ob_api_url+"Invoice?_where=documentNo='1001649'&_noActiveFilter=false" + +payload = {} +headers = { + 'Authorization': 'Basic '+userpass_b64 +} + +response = requests.request("GET", url, headers=headers, data=payload) + +print(response.text) +