close
The Wayback Machine - https://web.archive.org/web/20210731235400/https://github.com/kevinpapst/kimai2/issues/1602
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get user preferences - hourly rate via API #1602

Open
amanzone opened this issue Mar 31, 2020 · 5 comments
Open

Get user preferences - hourly rate via API #1602

amanzone opened this issue Mar 31, 2020 · 5 comments

Comments

@amanzone
Copy link

@amanzone amanzone commented Mar 31, 2020

I would need to get each user's hourly rate using the API (this should be one of the user preferences): how should I do it?

I'm not sure if it's already feasible (and I just cannot find it) or if this is missing.

Thanks in advance for your help.

Ciao,
Alberto

@paconte
Copy link

@paconte paconte commented Mar 31, 2020

Hello,

I am not an expert of Kimai2 however I am currently testing the API.

The hourly rate is available via the Timesheet. You can access it with the REST API call to /api/timesheets/{id}. For more info check the API documentation at https://demo.kimai.org/api/doc. Remember to login first at the demo to be able to see the documentation.

@kevinpapst
Copy link
Owner

@kevinpapst kevinpapst commented Mar 31, 2020

Please note that the rate system will soon change and rate specific methods will be added:
#1591

The users own hourly rate is afaik not available via API.
You might be able to set it, but I believe you can't read it.

@kevinpapst kevinpapst added the API label Mar 31, 2020
@amanzone
Copy link
Author

@amanzone amanzone commented Mar 31, 2020

Yes, I also believe it's not accessible via API. Of course you can get it via timesheets, but that might be different and also you may not yet have a timesheet.

Anyway, with the coming changes, do you think the user own rate will still be present?
Currently, as it's not accessible via API, we get it directly from the db (I'm not too comfortamble with this, I know). But if you believe this user rate might be moved to a different table or even simply be removed, that's something I need to plan for.

@kevinpapst
Copy link
Owner

@kevinpapst kevinpapst commented Mar 31, 2020

The users own rate will stay where it is. It is still used as fallback, if you don't use eg. project specific rates.

You can also add an API call as plugin, which will return that value (the DemoBundle has examples for new API calls).

@kevinpapst
Copy link
Owner

@kevinpapst kevinpapst commented Apr 7, 2020

@amanzone are you willing to provide a PR with a new API route to fetch the users hourly rate? Should be only a couple of lines and I can help...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants