Defect #9375


Creating new time entries using REST API returns 404

Added by Robert Nürnberg almost 12 years ago. Updated almost 12 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:
Affected version:


I am using redmine 1.2.1.stable with mysql and am having an issue using the REST API to create new time entries.

I am using key authentication and the PHP ActiveResource implementation. Loading Projects, Issues and time entries using the API works without any problems. However, when I try to create a new time entry i get a 404 response.

I execute a POST to
with the following data

<?xml version="1.0" encoding="UTF-8"?><time_entrie>
<comments>Comment text</comments>

The server responds with:

HTTP/1.1 404 Not Found
Date: Wed, 05 Oct 2011 07:07:35 GMT
Server: Mongrel 1.1.5
Status: 404
X-Runtime: 3
Content-Type: application/xml; charset=utf-8
Content-Length: 1
Cache-Control: no-cache
Set-Cookie: _redmine_session=BAh7BjoPc2Vzc2lvbl9pZCIlNDUwMmM3MjlkZGM1OGIzZmQzYmNiOWU5MGU1OTE3Y2Y%3D--2f3124386282fbb78a29f4b4ae58020f9ea13c43; path=/; HttpOnly

Calling the URL directly will output

<?xml version="1.0" encoding="UTF-8"?><time_entries type="array" limit="25" total_count="0" offset="0"></time_entries>

And again, fetching a time entry via GET works without problems.

Here you can find the code i used to reproduce the issue (load time entry id 1 works, then creating a new entry fails with 404):

Any help would be greatly appreciated

Files (5.41 KB) Robert Nürnberg, 2011-10-05 09:37
Actions #1

Updated by Robert Nürnberg almost 12 years ago

Note: you must change the URL in the sample file since there is an additional htaccess protection on the site (this however is not the issue, since i am calling the API from an IP that is not presented with the htaccess protection. You will also obviously have to change the API key :)

Actions #2

Updated by Etienne Massip almost 12 years ago

Try with time_entry instead of time_entrie?

Actions #3

Updated by Etienne Massip almost 12 years ago

  • Assignee deleted (Jean-Philippe Lang)

Please do not assign issues directly.

Actions #4

Updated by Robert Nürnberg almost 12 years ago

  • Status changed from New to Resolved

Sorry for the direct assign...

ActiveResource ( causes the Problem. It changes time_entry in time_entries to get the plural form - but instead of keeping the original it tries to convert back to the singular by simply cutting the "s" from the plural form. Since the forward conversion worked it did not check/see the error in the other direction.

I edited the wiki page of the php rest api so that others can patch their version as well.

I patched the file - now it works. Sorry for troubling you and thank you very much for the quick response!

Actions #5

Updated by Etienne Massip almost 12 years ago

  • Status changed from Resolved to Closed
  • Resolution set to Invalid

Also available in: Atom PDF