Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

REQUEST

This API is used to delete the User. You have to put the User_ID into API as the parameter. Based on this ID, DNL System will detect the User and delete them.

The structure of API as below:

DELETE/user/{user_id}

HEADER

The request requires you given the Admin Token in headers because onlyadminhas the permission deleting the User. To get the Token, please refer Authenticate User for more details.

Code Block
{
	"accept": "application/json",
	"X-Auth-Token": "Admin Token"
}

 

If you call API without header, the system will return the message as below:

Code Block
{
  	"error_type": "unauthenticated_error",
   	"success": false,
   	"error":    {
      	"message": "No header X-Auth-Token present",
      	"code": 110,
      	"reason": "auth_token_not_provided"
   	}
}

JSON RESPONSE

There is message return as JSON format. It will return the result of API and the related information as well.

If successful, the server will return code 200 with the message as below:

Code Block
{
   	"success": true
}

 

If the Token wrong, it will return code 401 with a message as below:

Code Block
{
 	"error_type": "unauthenticated_error",
  	"success": false,
  	"error": {
    	"message": "No header X-Auth-Token present",
    	"code": 110,
    	"reason": "auth_token_not_provided"
  	}
}

 

If you provide the wrong User_id, the server will return code 404 with a message as below:

Code Block
{
  "error_type": "Object not found error",
  "success": false
}
Panel

On this page:

Table of Contents

EXAMPLE

We will know more about the API through the example below:

Request

I will call API to Delete the User_ID = 1975:

Code Block
curl \
-H "X-Auth-Token: eyaskjksadkasd9.9123kjsadhkj123jhasdjajsjsdhKS.IH5uHASSJsadnbads980asTHo9dhljM" \
-X DELETE "http://88.99.175.131:8000/v1/user/1795"
 

Response

Code Block
{
	"success": true
}

...