-
Notifications
You must be signed in to change notification settings - Fork 4
MemberRequests
Nandhinni edited this page Jul 17, 2017
·
25 revisions
Method | API | Desc |
---|---|---|
GET | /memberrequests/:domain | Get all invites and join requests of specified community |
POST | /memberrequests/:domain/type/:type | Register invite or join request for a specified community |
PATCH | /memberrequests/request/:domain/person/:person | Update the status,member and role when the type is request |
PATCH | /memberrequests/invite/:domain/person/:person | Update the status when the type is invite |
DELETE | /memberrequests/:domain/person/:person | Delete the person if he rejected the request or invite |
HTTP GET /memberrequests/:domain
domain[text]
None
{
"domain": "art.wipro.blr",
"requests": [{
"domain": "ge",
"person": "[email protected]",
"createdon": "2017-06-21T05:03:52.449Z",
"role": "moderator",
"invitedBy": "sandy",
"status": "accepted",
"type": "invite",
"updatedon": "2017-06-21T05:10:53.556Z"
}, {
"domain": "ge",
"person": "[email protected]",
"createdon": "2017-06-21T05:03:52.449Z",
"role": "moderator",
"invitedBy": "sandy",
"status": "accepted",
"type": "invite",
"updatedon": "2017-06-21T05:10:53.556Z"
}]
}
Code : 404 NOT FOUND
Content : {error: 'please enter valid domain name!!'}
OR
Code : 505 Internal Server error
Content : {error: 'Unexpected error occurred, please try again...!' }
HTTP POST /memberrequests/:domain/type/:type
/:domain/type/:type
Valid types are 'invite', 'request'
{
"invitee": [{
"email": "[email protected]",
"role": "moderator"
},
{
"email": "[email protected]",
"role": "admin"
}],
"invitedby": "sandy",
}
Code : 201
Content : { message : Inserted }
Code : 400
Content : {error: 'Please enter valid values!!'}
Content : {error: 'Please enter valid type values!!'}
Content : {error: 'Please select role when inviting!!'}
Content : {error: 'Please enter email id when inviting!!'}
Content : {error: 'Please enter the name who is inviting!!'}
Content : {error: 'Given role is not applicable for particular community!!}
Content : {error: 'Member is already in community!!'}
OR
Code : 505 Internal Server error
Content : {error: 'Unexpected error occurred, please try again...!' }
HTTP PATCH /memberrequests/request/:domain/person/:person
domain[text]/person/:person[text]
{
"invitedby": "sandy",
"role" : "admin"
}
Code : 201
Content : {message : "Updated" }
Code : 400
Content : {error: 'Not updated due to invalid values'}
OR
Code : 505 Internal Server error
Content : {error: 'Unexpected error occurred, please try again...!' }
HTTP PATCH /memberrequests/invite/:domain/person/:person
domain[text]/person/:person[text]
None
Code : 201
Content : {message : "Updated" }
Code : 400
Content : {error: 'Not updated due to invalid values'}
OR
Code : 505 Internal Server error
Content : {error: 'Unexpected error occurred, please try again...!' }
HTTP DELETE /memberrequests/:domain/person/:person
domain[text]/person/:person[text]
Code : 200
Content : {message : "Deleted" }
Code : 404 NOT Found
Content : {error: 'Unable to delete the domain and person'}
OR
Code : 505 Internal Server error
Content : {error: 'Unexpected error occurred, please try again...!'