Project

General

Profile

API: "GET /issues/ID.json returns" 404 Not Found error

Added by m a 9 months ago

I am using Postman to access Redmine via the REST API.

What I want: reading the journal and the attachments of tickets.

Does not work:
  • Using GET {{redmineUrl}}/projects/{{redmineProjectName}}/issues/{{ID}}.json returns status 404 not found.
  • So also GET /issues/[id].json?include=journals is returning the 404.
Works:
  • Using GET {{redmineUrl}}/projects/{{redmineProjectName}}/issues.json?issue_id={{ID}} returns the issue and its details.
  • Using GET {{redmineUrl}}/projects/{{redmineProjectName}}/issues.json?issue_id={{ID}}&include=attachments additionally returns the attachments.
Does not work:
  • Using GET {{redmineUrl}}/projects/{{redmineProjectName}}/issues.json?issue_id={{ID}}&include=journals. No journals are returned.

Has anyone an idea how to resolve this?

Also I am using Postman just for debugging purpose. The final software is using C#/.NET

Thanks!


Replies (2)

RE: API: "GET /issues/ID.json returns" 404 Not Found error - Added by Holger Just 9 months ago

The responses for individual issues, i.e. /issues/123.json always contain the journals. Thus, there is no need to specify the include there (in fact, it is ignored).

As for why exactly you get the 404 there is not clear. If you have access to the the logs of the Redmine server (i.e. the file in log/production.log), there may be some additional hints logged there. Usually, when you get a 404 for a valid request, the issue is actually absent or you have not send any authentication (username/password or API key) when requesting a non-public issue.

Possibilities are thus: you are sending an invalid request (e.g. using wrong encoding of some characters in the URL), or more likely, you did not send suitable credentials along with your non-working requests.

If everything is correct is may also be that some required associated data can not be found. Here, Redmine may sometimes also reply with a 404. This may be confirmed from the server logs.

RE: API: "GET /issues/ID.json returns" 404 Not Found error - Added by m a 9 months ago

Thank you for your reply!

I am just exchanging issues/123.json for /issues.json?issue_id=123 and it works. (But no journals are returned)
So I would rule out faulty authentication.

I will check the server logs.

    (1-2/2)