# Send information to Tryton using API

**URL:** <https://discuss.tryton.org/t/send-information-to-tryton-using-api/5572>\
**Category:** Developer\
**Created:** [September 30, 2022, 5:57pm UTC](https://discuss.tryton.org/t/send-information-to-tryton-using-api/5572 "2022-09-30T17:57:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![EnergyDeveloper](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/energydeveloper/32/2030_2.png) [@EnergyDeveloper](https://discuss.tryton.org/u/EnergyDeveloper)\
**Post date:** [September 30, 2022, 5:57pm UTC](https://discuss.tryton.org/t/send-information-to-tryton-using-api/5572/1 "2022-09-30T17:57:56Z")

</div>

Hello !  
I was reading the Tryton documentation for the API, I found some fields, like Many2Many or One2One, but I don’t know how represent it when I’m sending the information using the API.  
Example  
Many2One can be represented in the API like

```auto
{
 "model_name":"string"
}

```

One2Many can be represented like

```auto
{
"model_name":[ 
   {"field1":"string1"},
   {"field2":"string2"},
  ]
}

```

Can you help me with examples of Many2Many and One2One?

---

<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:** [October 1, 2022, 7:17am UTC](https://discuss.tryton.org/t/send-information-to-tryton-using-api/5572/2 "2022-10-01T07:17:23Z")

</div>

Indeed the documentation is not clear about the low level types of those fields. So I filled [Document low level type of relational fields (#11754) · Issues · Tryton / Tryton · GitLab](https://bugs.tryton.org/issue11754)

For `Many2One` it is an `int` and for `One2Many` it is a `tuple` of `int` (but see the documentation remark about the value for `create` and `write` calls).

---

<div class="post-metadata">

**Author:** ![system](https://discuss-cdn.tryton.org/uploads/default/original/1X/c6f8ec0a40525cdcd50058c734283450a4b3d38b.png) [@system](https://discuss.tryton.org/u/system)\
**Post date:** [October 31, 2022, 7:17am UTC](https://discuss.tryton.org/t/send-information-to-tryton-using-api/5572/3 "2022-10-31T07:17:32Z")

</div>

Closed on October 31, 2022, 7:17am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
