Need Help with Rest Api

Added by Sukrit Jain 3 months ago

Moderator edit on 2021-08-25:
This thread is a continuation of the (now locked) thread Need Help with Rest Api:

Sukrit Jain wrote in Need Help with Rest Api:

1. We want to retrieve all issues with all information i.e. journals, relations, children in 1 go. Please can you let us know which api can we use for the same.

2. We also want to get details about the custom fields particularly we want to retrieve custom fields by specifying name of the field. Please help with the api. Also when i try to get the details using http://ramsytesting.m.redmine.org/custom_fields.xml, It just keeps popping up asking for credentials

Please note for this implementation i am using http://ramsytesting.m.redmine.org/projects/ramsyproject2 with version 2.5

Lorenzo Meneghetti replied in RE: Need Help with Rest Api:

Hi, first read https://www.redmine.org/projects/redmine/wiki/Rest_Issues and then someone will assist you in case of problems.
Any test is very easy to do since you can type the api GET in browser address bar with .json or .xml extension.
Thanks,
Lorenzo

Please refer to Need Help with Rest Api. I am not able to reply to my message. So created a new message.

Hi, I tried to use it. But, the issues.xml is not returning journals for the issues even if I put the include=journals in the address bar.
I am getting the values for all issues with url http://ramsytesting.m.redmine.org/issues.xml?include=journals,children.
Attached is the result in "allissues.txt" file

Also, attached is the output for issue no 20 with the url ramsytesting.m.redmine.org/issues/20.xml?include=journals,children
If I get journal and children per information that will be performance overhead.

Please can you let me know the api which will return information for all issues along with journals, children and relations.
Please can you let me know ASAP as my development is blocked.

Thanks,
Sukrit

allissues.txt Magnifier (18.1 KB)

Issue no20.txt Magnifier (1.65 KB)

Replies (3)

RE: Need Help with Rest Api - Added by Mischa The Evil 3 months ago

Sukrit Jain wrote:

I am not able to reply to my message. So created a new message.

You should try to use the 'Reply' button at the bottom of the post.

[...] But, the issues.xml is not returning journals for the issues even if I put the include=journals in the address bar.

That's correct and expected. The journals argument for the include parameter is not supported by the GET /issues.[format] API end-point. This is conform as currently documented at Rest_Issues.

Also, attached is the output for issue no 20 with the url ramsytesting.m.redmine.org/issues/20.xml?include=journals,children

Contrary to the GET /issues.[format] API end-point, the GET /issues/[id].[format] API end-point does support the fetching of associated journals if used with the journals argument for the include parameter. Again, this is conform as documented at Rest_Issues.

Please can you let me know the api which will return information for all issues along with journals, children and relations.

Redmine does not provide such an API end-point at the moment.

2. We also want to get details about the custom fields [...] Also when i try to get the details using http://ramsytesting.m.redmine.org/custom_fields.xml, It just keeps popping up asking for credentials

This too is expected. The GET /custom_fields.[format] API end-point requires administrator privileges. As such, you'll need to be authenticated as a user with such authorizations to be able to retrieve any information from this end-point. This is roughly equal to the "HTML version" of this view which is only accessible via the "admin panel" under host.redmine.tld/admin/.

RE: Need Help with Rest Api - Added by Mischa The Evil 3 months ago

Moderator edit on 2021-08-29:

Sukrit Jain wrote in Need Help with Rest Api:

I am adding a new message as I am getting an error message on replying to my previous message as attached in "screenshot10".

Hi, thanks for your reply.

I am trying to retrieve issue for id 33 and 19 using rest api http://ramsytesting.m.redmine.org/issues.xml?issue_id=33,19, but getting all the information for all the ids as attached the output in "issue_id".

Please can you let me know which rest api to be used to get information for specific issue id.

Thanks,
Sukrit

Sukrit Jain wrote:

I am adding a new message as I am getting an error message on replying to my previous message as attached in "screenshot10".

That is just a server error that occurred when you submitted your reply. That shouldn't be a reason to open another new thread...

I am trying to retrieve issue for id 33 and 19 using rest api http://ramsytesting.m.redmine.org/issues.xml?issue_id=33,19, but getting all the information for all the ids as attached the output in "issue_id".

The issue_id filter is implemented in Redmine 3.3.0 (issue #4806) and, given that m.redmine.org runs on Redmine 2.5.x (as you've mentioned explicitly in your previous posts), isn't supported by your test environment on *.m.redmine.org.

issue_id.txt Magnifier - Transported from message#65987. (16.3 KB)

screenshot10.JPG - Transported from message#65987. (68.4 KB)

RE: Need Help with Rest Api - Added by Sukrit Jain 3 months ago

Mischa The Evil wrote:

Moderator edit on 2021-08-29:

Sukrit Jain wrote in Need Help with Rest Api:

I am adding a new message as I am getting an error message on replying to my previous message as attached in "screenshot10".

Hi, thanks for your reply.

I am trying to retrieve issue for id 33 and 19 using rest api http://ramsytesting.m.redmine.org/issues.xml?issue_id=33,19, but getting all the information for all the ids as attached the output in "issue_id".

Please can you let me know which rest api to be used to get information for specific issue id.

Thanks,
Sukrit

Sukrit Jain wrote:

I am adding a new message as I am getting an error message on replying to my previous message as attached in "screenshot10".

That is just a server error that occurred when you submitted your reply. That shouldn't be a reason to open another new thread...

I am trying to retrieve issue for id 33 and 19 using rest api http://ramsytesting.m.redmine.org/issues.xml?issue_id=33,19, but getting all the information for all the ids as attached the output in "issue_id".

The issue_id filter is implemented in Redmine 3.3.0 (issue #4806) and, given that m.redmine.org runs on Redmine 2.5.x (as you've mentioned explicitly in your previous posts), isn't supported by your test environment on *.m.redmine.org.

Hi,
Thank you for your reply.

When we will be getting the privilege of accessing the users by email ids using rest api?
How can we update the children using rest api?

Thanks,
Sukrit

(1-3/3)