User API \ Delete a user PHP SDK
| Resource/URI | GET | POST | PUT | DELETE |
|---|---|---|---|---|
Users /users.json
|
List all users | – | Import access token | – |
User /users/<user_token>.json
|
Retrieve user details | – | – | Delete user |
User /users/<user_token>/contacts.json
|
Read contacts | – | – | – |
User /users/<user_token>/publish.json
|
– | Publish on social networks | – | – |
Workflow
Request: the code to send to the API
Send a DELETE request to the resource /users/<user_token>.json to immediately delete an existing user
and the linked identities.
The <user_token> has to be replaced by the unique token of an existing user.
To prevent you from unintentionally deleting a user by mixing up the DELETE/GET methods
you have to include the url parameter confirm_deletion=true in your DELETE requests.
If you omit this parameter, the user will not be deleted and an error will be thrown.
Please note that deleting a user and his identities is a definitive and irrevocable action.
Result: the code returned by the API
If the user has been deleted successfully, the API will return a HTTP status code 200 and the list
of identities that have been removed.
If the user could not be deleted, the API will return an appropriate message body with further details on the error that occured.
Example Resultset
{
"response": {
"request": {
"date": "Mon, 08 Jul 2019 16:28:08 +0200",
"resource": "/users/2c0f08e4-c02a-44f9-bf05-33d817054095.json?confirm_deletion=true",
"status": {
"flag": "success",
"code": 200,
"info": "Your request has been processed successfully"
}
},
"result": {
"status": {
"flag": "success",
"code": 200,
"info": "The specified user has been removed successfully"
},
"data": {
"user": {
"user_token": "2c0f08e4-c02a-44f9-bf05-33d817054095",
"identities": [
{
"identity_token": "44ede4ef-dd25-4fc3-96f5-19877bb996be",
"provider": "facebook"
},
{
"identity_token": "a9b696d8-0937-40a7-ac32-a9f02078fd3e",
"provider": "twitter"
}
]
}
}
}
}
}