Community mailing list archives

community@mail.odoo.com

Re: API Integration exemple

by
Ygol InternetWork, Yves Goldberg
- 08/15/2015 03:41:26
Thank you Daniel
 
--
Yves Goldberg
odooOfficial Partner

Phone+972 (0)3 720.8818

Skype: ygol_support
Raanana [ISRAEL]
Belgium:+32.2.588.2500
--
 
 
----- Original message -----
From: Daniel Blanco <daniel@blancomartin.cl>
To: Community <community@mail.odoo.com>
Subject: Re: API Integration exemple
Date: Wed, 29 Jul 2015 16:23:26 -0000
 
Hi
You should create a module with a function inside a class, which will inherit from the model you attempt to update with the provided api. You can call the updater function using a button defined in the same class, or you can call it from a cron job. As a first approach, you can hardcode the url inside your module, and later you can write a new model containing the url and all the parameters neeeded, so you can configure it using a wizard, or a configuration menu.
 
Take a look to this as the first approach:
 
 
It updates some currencies quotations, using an api. The api is hardcoded in a .py file.
 
This other piece of code, is another example with lot of components, but not finished yet:
 
 
 
 


Quedo atento a sus comentarios. Saludos:
 

 
Ing. Daniel Blanco
Director
Blanco Martín & Asociados
Móvil: +56 9 73880409 / +54 9 351 228-0893
Skype: hdanielb
Twitter: hdanielb
 
Chile: 
Blanco Martín EIRL
Apoquindo 6410 Of 212
+56 2 2840 0990 / +56 2 2979 0208
Las Condes - Región Metropolitana
 
Argentina:
BMyA S.A.
Nicasio 6970. Córdoba
+54 351 5694621 / +54 351 5691933
Argüello - Córdoba
 
 
 
 
2015-07-29 11:18 GMT-03:00 <info@ygol.com>:
I am looking for some example about how to integrate an external application that provides an API.
 
i.e. I get a json object from that external application after a request in the form of:
 
 
GET ONE: curl -u username:password http://server.com:2222/api/user/1234
 
 
TIA
 
 
--
Yves Goldberg
odooOfficial Partner

Phone+972 (0)3 720.8818

Skype: ygol_support
Raanana [ISRAEL]
--
 

_______________________________________________
Post to: mailto:community@mail.odoo.com

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe