Site users management - Remove users from a site
OVERVIEW
This method can be used to remove user(s) from a site.
Request URI
DELETE /api/3/sites/{siteid}/users
URI Parameters
Request Parameters | Value | Description |
siteid | integer | The ID for the site. 1) To get site id use following API Get site list. |
Request Body
A list of user ids to be removed from the site.
Send a transaction id's object to get a list of user id's. To get the user id's, first call the get all site users API, which is used to get site users email id's and other details.
Response
The server will respond with 200 OK http response if there is a success , and a (4xx/5xx) response if there is a partial success (which means some of the records were not removed) or a complete failure.
The response body will contain transaction status information for each user.
Notes :
1) User Id must be integer. If it is not, a message will display stating "User ID provided is invalid."
2) Same user id pass in transaction id's list for multiple times then for the first time it will remove user and for next time it will give message like "User with the specified User ID was already removed from the site"
3) User must be a participant of a given site. If they are not a participant, a message will display stating "User with the specified User ID does not exist in the site"
4) If the user is a member of admin then they can remove the user which has been added by them. If they are not a member of admin, a message will display stating "You do not have rights to remove the specified user."
5) You can remove a maximum of 100 users at a time.
Hi Tony Fleming, I took a look at the Swagger for this endpoint, which (for once) provided more accurate details. The forrmat for JSON is actually:
{ "transactionid": ["990","991","992"] }
I've tested this and it works, NOTE: the array elements have to be strings. Integer array values won't work.
Andrew Quinn When I tried this, I'm getting 404 error. Getting the following response {
"transaction": [
{
"transactionid": "",
"statuscode": "400",
"reason": "Request resource or xml is not valid",
"receivertype": null
}
]
}
I would imagine it depends on what data format you are providing in the request payload. If XML then as specified above. If JSON, then it will be an array of user ID's (integers), e.g.
{ "transactionids": { "transactionid": [ 900, 901, 902, 903, ...etc ] } }
What format should the userid list be in?
Comments
4 Comments