Endpoint: /rpc/sites/{siteid}/users/{userid}
Returns, updates, and deletes user account details.
-
POST
Method & URL
POST https://[server URL]:[port]/admin/v2/rpc/sites/{siteId}/users/{userid}/
POST Body Sample
Copy
@Usersid = {{usersList.response.body.$.data[0].id}}
###
#### USER OPERATION (KICK, RESETPASSWORD, UNLOCK) ####
POST https://{{host}}/admin/v2/rpc/sites/{{Siteid}}/users/{{Usersid}}/ HTTP/1.1
Authorization: EFTAdminAuthToken {{AuthToken}}
{
"data": {
"type": "userOperation",
"id": "0",
"attributes": {
"operation": "resetPassword"
}
}
}
POST Response Body Sample
Copy
{
"data": {
"type": "userOperation",
"id": "0",
"attributes": {
"status": "success"
}
}
}
POST PowerShell Sample
Copy
########################################################################################################
$userid = $userList.data[0].id
Write-Output "Update user data - Reset Password"
Write-Output "-----"
$update =
'{
"data": {
"type": "userOperation",
"id": "0",
"attributes": {
"operation": "resetPassword"
}
}
}'
$update = $update | ConvertFrom-Json
$update = $update | ConvertTo-Json -Depth 10
$PatchReturn = Invoke-RestMethod -Uri "$baseURL/v2/rpc/sites/$siteID/users/$userid" -Method 'POST' -Headers $authHeader -Body $update
###