# Recherche de API tryton

**URL:** https://discuss.tryton.org/t/recherche-de-api-tryton/1077
**Category:** Developer
**Created:** [January 25, 2019, 4:37am UTC](https://discuss.tryton.org/t/recherche-de-api-tryton/1077 "2019-01-25T04:37:20Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![fabrice](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/f/5fc32e/32.png) [@fabrice](https://discuss.tryton.org/u/fabrice)
#### Post date: [January 25, 2019, 4:37am UTC](https://discuss.tryton.org/t/recherche-de-api-tryton/1077/1 "2019-01-25T04:37:20Z")

</div>

bonjour cher tous ,  
je travaille sur un projet qui consiste a creer un client gnu health sur mobile .  
j’aimerais savoir comment trouver les API de tryton

---

<div class="post-metadata">

### Author: ![fmorato](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/fmorato/32/109_2.png) [@fmorato](https://discuss.tryton.org/u/fmorato)
#### Post date: [January 25, 2019, 8:38am UTC](https://discuss.tryton.org/t/recherche-de-api-tryton/1077/2 "2019-01-25T08:38:17Z")

</div>

The easiest way I’ve found is to watch the tryton client sao network activities to understand how methods are being called and such, as well as reading the source code.

Tryton uses RPC with XML or JSON, and creates read, write, delete methods automatically for each model.

Another way is to create user\_application to create own api.

---

<div class="post-metadata">

### Author: ![nicoe](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/nicoe/32/2880_2.png) [@nicoe](https://discuss.tryton.org/u/nicoe)
#### Post date: [January 25, 2019, 10:28am UTC](https://discuss.tryton.org/t/recherche-de-api-tryton/1077/3 "2019-01-25T10:28:06Z")

</div>

> [@fabrice](#):
>
> je travaille sur un projet qui consiste a creer un client gnu health sur mobile .

Est-ce que le but est d’offrir toutes les possibilités qu’offre un client Tryton ou d’exposer juste quelques écrans pour un encodage plus facile.

Dans le premier cas, sache qu’il a existé un client pour android développé par BioEcoForest, j’en ai retrouvé la trace là:

> **[GitHub - lampmantech/tryton\_android: Tryton client for android](https://github.com/lampmantech/tryton_android)**
>
> Tryton client for android

C’est assez vieux et non maintenu mais ça pourrait t’aider.  
Mais bon à choisir, je pense qu’il vaut mieux rendre le client web encore meilleur au niveau ‘responsive’ que de partir dans un développement pareil.

Par contre si tu veux plutôt faire des écrans spécifiques, alors tu peux voir tryton comme un serveur web classique (la couche web étant [werkzeug](http://werkzeug.pocoo.org/)), sur lequel tu peux créer ton application. La solution que suggère @fmorato est une solution qui permet de gérer l’identification de l’utilisateur. Plus d’info dans la doc:

[http://doc.tryton.org/projects/server/en/latest/topics/user\_application.html](http://doc.tryton.org/projects/server/en/latest/topics/user_application.html)

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [January 25, 2019, 12:00pm UTC](https://discuss.tryton.org/t/recherche-de-api-tryton/1077/4 "2019-01-25T12:00:17Z")

</div>

> [@fmorato](#):
>
> The easiest way I’ve found is to watch the tryton client sao network activities to understand how methods are being called and such, as well as reading the source code.

There is also the RPC call: `system.listMethods` and `system.methodHelp` but it is probably no as easy as reading the code.  
The available methods for RPC are declared on each object in the [attribute ` __rpc__ `](http://docs.tryton.org/projects/server/en/latest/ref/models/models.html#trytond.model.Model. __rpc__ ).

---

<div class="post-metadata">

### Author: ![resteve](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/resteve/32/823_2.png) [@resteve](https://discuss.tryton.org/u/resteve)
#### Post date: [April 15, 2020, 10:34am UTC](https://discuss.tryton.org/t/recherche-de-api-tryton/1077/5 "2020-04-15T10:34:22Z")

</div>

> [@ced](#):
>
> There is also the RPC call: `system.listMethods` and `system.methodHelp` but it is probably no as easy as reading the code.

I try to connect to methodHelp [1] and I think are a mistake because “request.rpc\_method” is “system.methodHelp” [2] and not the object that like to get doc (example: model.party.party.search).

IMHO is missing a parameter in methodHelp to pass the model to get the getdoc.

What do you think or how to call methodHelp?

[1] [trytond/trytond/protocols/dispatcher.py at develop · tryton/trytond · GitHub](https://github.com/tryton/trytond/blob/develop/trytond/protocols/dispatcher.py#L135)  
[2] [trytond/trytond/protocols/dispatcher.py at develop · tryton/trytond · GitHub](https://github.com/tryton/trytond/blob/develop/trytond/protocols/dispatcher.py#L126)

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [April 15, 2020, 10:50am UTC](https://discuss.tryton.org/t/recherche-de-api-tryton/1077/6 "2020-04-15T10:50:09Z")

</div>

Indeed as this method comes from [XML-RPC](http://xmlrpc-c.sourceforge.net/introspection.html), it should take a parameter containing the RPC method name.

---

<div class="post-metadata">

### Author: ![resteve](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/resteve/32/823_2.png) [@resteve](https://discuss.tryton.org/u/resteve)
#### Post date: [April 15, 2020, 11:13am UTC](https://discuss.tryton.org/t/recherche-de-api-tryton/1077/7 "2020-04-15T11:13:06Z")

</div>

> [@ced](#):
>
> Indeed as this method comes from [XML-RPC](http://xmlrpc-c.sourceforge.net/introspection.html), it should take a parameter containing the RPC method name.

```
    <methodCall>
  <methodName>system.methodHelp</methodName>
  <params>
    <param><value>
      <string>sample.add</string>
      </value></param>
    </params>
  </methodCall>

```

Ok, but I think the mistake is get model from request.rpc\_method [2] and not the parameter.

Example to call:

```
data = {'method': 'system.listMethods', 'params': []} # ok
data = {'method': 'system.methodHelp', 'params': ['model.party.party.search']} # ko because 

```

[2] [trytond/trytond/protocols/dispatcher.py at develop · tryton/trytond · GitHub](https://github.com/tryton/trytond/blob/develop/trytond/protocols/dispatcher.py#L126)
