How to use REST API in tryton


Is there somo examples of how to use API REST.

I was reading User Application — trytond 5.7 documentation

And the example in timesheet module

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

<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.

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.

1 Like

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.

1 Like

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