Defect #25793
closedCannot update a jounral from REST api
0%
Description
I can get the journal from the REST api. But I cannot update it.
Here I'll demonstrate it (specifically I'm updating notes).
curl -v http://server/pm/journals/327.json -H "Content-Type: application/json" -H "X-Redmine-API-Key: <my key>" -X PUT --data-binary "@put.note.json"
I don't get any response from the server and the server log shows it's not authorized:
Started PUT "/pm/journals/327.json" for 192.168.1.6 at 2017-05-08 21:46:21 -0700 Processing by JournalsController#update as JSON Parameters: {"notes"=>"update note", "id"=>"327"} Current user: anonymous Filter chain halted as :check_if_login_required rendered or redirected Completed 401 Unauthorized in 6ms (ActiveRecord: 1.8ms)
Given that I can update that from the website, and also given that I can use the same api key to get the issues and other information in the REST api, it seems like that JournalsController#update doesn't check the authorization correctly for TEST api.
Updated by Toshi MARUYAMA over 7 years ago
- Status changed from New to Closed
- Resolution set to Invalid
Please use forum for question.
Updated by Mao H over 7 years ago
- Status changed from Closed to Reopened
I believe it's a bug in the product. I pasted the log from the server. It doesn't check authorization correctly.
Updated by Toshi MARUYAMA over 7 years ago
- Status changed from Reopened to Closed
Because JournalsController#update does not provide API.
Updated by Mao H over 7 years ago
- Status changed from Closed to Reopened
Since it doesn't provide the api, can I ask for this feature?
Updated by Toshi MARUYAMA over 7 years ago
- Status changed from Reopened to Closed
Please use forum for question.
Updated by Mao H over 7 years ago
- Status changed from Closed to Reopened
I must miss something. Please tell me how the forum help?
Toshi MARUYAMA wrote:
Because JournalsController#update does not provide API.
It looks like the way to solve it is to have JournalsController#update to provide this API. This is a new feature I'm asking for or a bug we need to fix.
Thanks,
Updated by Toshi MARUYAMA over 7 years ago
- Status changed from Reopened to Closed
Mao H wrote:
I must miss something. Please tell me how the forum help?
Because your subject is question.
Toshi MARUYAMA wrote:
Because JournalsController#update does not provide API.
It looks like the way to solve it is to have JournalsController#update to provide this API. This is a new feature I'm asking for or a bug we need to fix.
Why do you need jounral REST api?
You can use issue REST api to edit journal.
Updated by Mao H over 7 years ago
Sorry. I didn't mean to be a question in the title. I thought I was summarizing the issue.
I'll use the forum then. I don't find how to use issue REST api to edit a journal from Developer's Guide. I only find how to get the journals with an issue.
Thanks,
Toshi MARUYAMA wrote:
Mao H wrote:
I must miss something. Please tell me how the forum help?
Because your subject is question.
Toshi MARUYAMA wrote:
Because JournalsController#update does not provide API.
It looks like the way to solve it is to have JournalsController#update to provide this API. This is a new feature I'm asking for or a bug we need to fix.
Why do you need jounral REST api?
You can use issue REST api to edit journal.