Community mailing list archives

Re: API Integration exemple

Blanco Martin y Asociados , Daniel Blanco
- 07/29/2015 12:12:04

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
Blanco Martín & Asociados
Móvil: +56 9 73880409 / +54 9 351 228-0893
Skype: hdanielb
Twitter: hdanielb

Blanco Martín EIRL
Apoquindo 6410 Of 212
+56 2 2840 0990 / +56 2 2979 0208
Las Condes - Región Metropolitana

Nicasio 6970. Córdoba
+54 351 5694621 / +54 351 5691933
Argüello - Córdoba

2015-07-29 11:18 GMT-03:00 <>:
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
Yves Goldberg
odooOfficial Partner

Phone+972 (0)3 720.8818

Skype: ygol_support
Raanana [ISRAEL]

Post to: