# How to use REST API in tryton

**URL:** https://discuss.tryton.org/t/how-to-use-rest-api-in-tryton/2780
**Category:** Developer
**Created:** [May 26, 2020, 11:50pm UTC](https://discuss.tryton.org/t/how-to-use-rest-api-in-tryton/2780 "2020-05-26T23:50:26Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![iehoshia](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/iehoshia/32/243_2.png) [@iehoshia](https://discuss.tryton.org/u/iehoshia)
#### Post date: [May 26, 2020, 11:50pm UTC](https://discuss.tryton.org/t/how-to-use-rest-api-in-tryton/2780/1 "2020-05-26T23:50:26Z")

</div>

Hi,

Is there somo examples of how to use API REST.

I was reading [User Application — Tryton server](https://docs.tryton.org/projects/server/en/latest/topics/user_application.html?highlight=app.route#user-application)

And the example in timesheet module

> <https://github.com/tryton/timesheet/blob/99666d5c45241c9cf0a4606b1e7e28434a94d56a/routes.py#L16>

But when I call to the route I receive the follow message.

```
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>405 Method Not Allowed</title>
<h1>Method Not Allowed</h1>
<p>The method is not allowed for the requested URL.</p>

```

I’m not sure if I need some king of auth to access the route.

Thanks in advance.

---

<div class="post-metadata">

### Author: ![pokoli](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/pokoli/32/22_2.png) [@pokoli](https://discuss.tryton.org/u/pokoli)
#### Post date: [May 27, 2020, 6:22am UTC](https://discuss.tryton.org/t/how-to-use-rest-api-in-tryton/2780/2 "2020-05-27T06:22:02Z")

</div>

As the route is decorated with an user application you should generate a token on the Applications tab of the user, accepet it and send it in authentication headers.  
Otherwise the system does not know how to authentificate the user for the application an the requests are rejected.

---

<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: [May 27, 2020, 7:54am UTC](https://discuss.tryton.org/t/how-to-use-rest-api-in-tryton/2780/3 "2020-05-27T07:54:46Z")

</div>

This status is not returned when the authentication is missing.  
Indeed it is sent when the method of the request is not one of those allowed by the route. For example if you do a POST on the `timesheet_employees`.

---

<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: [June 26, 2020, 7:54am UTC](https://discuss.tryton.org/t/how-to-use-rest-api-in-tryton/2780/4 "2020-06-26T07:54:51Z")

</div>

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