DeleteUser (Site-Level)
This method is used to delete an existing user under the site associated with the request.
Authentication
Site-level methods always requires an authentication token. In addition to authentication token, these methods also requires the request IP to be whitelisted. For more information about whitelisting an IP, see API Whitelisting.
Request
Target Endpoint
POST /Api/Sites/DeleteUser
Parameters
Property Name |
Type |
Is Required? |
Description |
---|---|---|---|
UserName | String | Required | Username of the user to be deleted |
SiteId | Int | Required | The identifier of the target site |
Request Sample
Headers
POST /Api/Sites/DeleteUser HTTP/1.1 Authorization: Bearer Do3l_2l3uLdmYX76u-BufLzuuhFPOE-nRZDyU0adiFk1 Content-Type: application/json Host: dev7.pagos.com
Body (formatted)
{ "UserName": "testUserApi", "SiteId": 1 }
Response
Property Name |
Type |
Description |
---|---|---|
Success | Boolean | Indicated whether or not the request passed the whitelisting and authentication based on the provided token and Site Id. |
InvalidToken | Boolean | If the request is unsuccessful, indicates whether or not the failure was due to token. |
Messages | Array of String | A list of messages, which can be used or captured for diagnostics. When requests are unsuccessful, the reason for the failure will be documented in the Messages list. |
UserId | String | If the request was successful, ID assigned to the created user. |
MethodResponse | String | If the user deletion failed due to provided user information, the reason for the failure will be documented, otherwise Null |
Response Sample (Success)
Headers
HTTP/1.1 200 OK Cache-Control: no-cache, no-store Content-Type: application/json; charset=utf-8
Body (formatted)
{ "UserId": null, "MethodResponse": "User removed successfuly.", "Success": true, "InvalidToken": false, "Messages": [] }
Response Sample (Authentication Failure)
Headers
HTTP/1.1 200 OK Cache-Control: no-cache, no-store Content-Type: application/json; charset=utf-8
Body (formatted)
{ "UserId": null, "MethodResponse": null, "Success": false, "InvalidToken": false, "Messages": [ "The requested resource is restricted and your request did not provide a valid token." ] }
Response Sample (Method Failure)
Headers
HTTP/1.1 200 OK Cache-Control: no-cache, no-store Content-Type: application/json; charset=utf-8
Body (formatted)
{ "UserId": null, "MethodResponse": "An error has occurred. Please try again!", "Success": true, "InvalidToken": false, "Messages": [] }