REST API to import a custom user list

Prev Next

You can use this REST API call to send a request to create or override an existing custom user list.

POST request URL

https://<epo_server_name:port>/rest/dlp/definitions/customUserList/import

Where, epo_server_name:port is the server IP address and port number.

Request Parameters

Parameter name

Description

Required

Values

Authorization

User credentials for ePO - On-prem.

Required

Form Parameters (multipart/form-data)

Parameter name

Description

Required

Values

name

If the name of the definition exists, the current properties are overridden. Otherwise a new definition is created.

Required

String

description

Description of the definition.

Optional

String

override

True: Overrides the existing definition.

False: If the definition name exists, the operation fails.

Required

Boolean

body

CSV file containing records to be imported.

Required

File



Sample POST request URL

https://xx.xxx.xx.xxx:8443/rest/dlp/definitions/customUserList/import

Sample cURL command

curl -k -v -X POST 'https:// xx.xxx.xx.xxx:8443/rest/dlp/definitions/customUserList/import' -u '<user>:<password>' -F 'name="MyList"' -F 'description="No desc."' -F 'override="false"' -F 'body=@"/path/to/file/fileName.csv"'

Sample request parameters (multipart/form-data)

{
      "name": "MyList",
      "description": "No desc.",
      "override": false,
      "body": the CSV file 
}

Sample response

Import completed

Status and error codes

List of HTTP status codes returned for the query.

Code

Description

200 OK

The web user list was imported successfully.

400 Bad Request

Returns a bad request if:

  • Name is missing or empty

  • Length of the user list name is greater than or equal to 100

  • Description length is greater than or equal to 100

  • Override is missing or empty

  • Body is missing or empty

  • Catalog item name already exists or is not unique

  • CSV headers do not match or are incorrect

  • Number of records in CSV greater than 20000

404 Not Found

Incorrect ePO - On-prem URL.

500 Internal Server Error

An error on the server side that caused the request to fail. See the ePO - On-prem orion.log file for more details about the error.