Knowledgebase

Delete User

Method: DELETE
Endpoint: /api/deleteUser/{idOrEmail}/{type}

Parameters

Parameter Type Required

Description 

idOrEmail id or email Yes Id or email of use which you want to delete
type soft, hard  (Default: soft) No soft = soft delete
hard = hard delete


Response Parameters

Parameter Type Description
status JSON Success or Error
result JSON Result of the operation
response JSON Output of the operation
 

Example Request (CURL)

<?php

// Authentication
$api_token	=	'API_KEY'; // Mumara API Key (can be found in Settings -> API Key)
$domain		=	'http://www.anydomain.com'; // Your Mumara Domain Name

// API Endpoint
$endpoint	=	'/api/deleteUser/';

//user id
$user_id = 24;

//flag
$type = '/hard';

// Defining cURL Request
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$domain.$endpoint.$user_id.$type);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_setopt($ch, CURLOPT_HTTPHEADER,
    array('Content-Type: application/json', 'Authorization: Bearer ' . $api_token));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

// Executing cURL
$output = curl_exec ($ch);

// Printing Output
echo "<pre>";
echo json_encode(json_decode($output),JSON_PRETTY_PRINT);

// Closing cURL
curl_close ($ch);
?>

 

Example Response (JSON)

{
    "status": "success",
    "result": "User has been successfully deleted."
}
Status value of the success response will be "success"

 

Example Error Response (JSON)

{
    "status": "error",
    "result": "Error: User doesn`t exist"
}

 

Possible Errors

  • Error: User doesn`t exist
  • Invalid type.
DELETE
/api/deleteUser/{idOrEmail}/{type}
Try it out