Skip to content

Instantly share code, notes, and snippets.

@waltervargas
Created February 18, 2015 06:41
Show Gist options
  • Save waltervargas/90d973b73f21a6cb9e08 to your computer and use it in GitHub Desktop.
Save waltervargas/90d973b73f21a6cb9e08 to your computer and use it in GitHub Desktop.
Create a user on Odoo/openerp from curl
curl --data 'login=walter&name=walter&password=test&confirm_password=test' http://192.168.0.103:8069/web/signup -H 'Content-Type: application/x-www-form-urlencoded' -H 'Cookie: instance0|ab=%22c%22; session_id=c763117e73c328eea1affa841d87d7d94d9b7e6d'
@pvanthony
Copy link

I am trying to get some data from odoo version 8 using curl. Looks like I can login using curl, but my next line of curl does not seem to be logged in and gives me the data for a non login user. I hope you can give some advice. Here is my current code.

curl -b cookies.txt -c cookies.txt
-X POST
https://odoo.domain.com/web/session/authenticate
-H 'cache-control: no-cache'
-H 'content-type: application/json'
-H 'x-requested-with: XMLHttpRequest'
-d '{"jsonrpc":"2.0","method":"call","params":{"login":"username","password":"the_password","db":"database_name"}}'

curl -X POST
https://odoo.domain.com/url/with/data
-H 'cache-control: no-cache'
-H 'content-type: application/json'
-H 'x-requested-with: XMLHttpRequest'
-d '{"jsonrpc":"2.0","method":"call","params":{"start":"2019-05-28 00:00:00","end":"2019-05-28 23:00:00","tz":-480,"domain":[["place_id","=",1]]}}'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment