Include project members in project API response
I am creating Chrome Extension to Redmine and need some informations from API.
I want to get one project data (/projects/project.xml) with associated users.
I have checked the source of show.api.rsb and as I understand this - there is only
posibility to get project data with associated trackers.
#2 Updated by Jakub Wolny about 9 years ago
I have improved it a little bit:
api.array :members do @project.members.each do |member| member.roles do |role| api.role(:role => role.id) end api.member(:id => member.id, :name => member.name, :user => member.user_id, :login => member.user.login, :mail => member.user.mail, :roles => member.roles) end end if include_in_api_response?('members') api.array :memberroles do @users_by_role.keys.sort.each do |role| api.memberroles(:id => role.id, :name => role.name, :users => @users_by_role[role].sort) end end if include_in_api_response?('memberroles') api.array :roles do @users_by_role.keys.sort.each do |role| api.roles(:id => role.id, :name => role.name) end end if include_in_api_response?('roles')
So you can fetch members, roles and combined. I only do not know how to "in proper way" show only neccessary user fields (without e.g. password hash and salt)
#4 Updated by Jakub Wolny about 9 years ago
@Edward Subraman: you can create a new project by making POST request, as it described here: