/v1/api/list/dns/{domainListId}/attachFile (POST) - BlueCat DNS Edge

DNS Edge API Guide

Product name
BlueCat DNS Edge
Uploads a CSV file containing a list of domain names to an existing DNS list.
Note: The client device from which you log in to the DNS Edge web application must allow multipart/form-data uploads.
POST https://api-<DNS.Edge.URL>/v1/api/list/dns/{domainListId}/attachfile
Authorization: Bearer authorization token
Content-type: multipart/form-data
File that contains the domains

Python example

import requests Headers = {"Authorization": "<token>"} Dict = {'file':('myFile.txt', 
open('myFile.txt', 'rb'), 'text/plain')} response = requests.post("https://<DNSEdge FQDN>
/v1/api/list/dns/<domain list id>/attachfile", files=Dict, headers=Headers) print(response.content)

Curl example

`curl -X POST https://<DNSEdge FQDN>/v1/api/list/dns/<id>/attachfile -d @<path to file>
 -H "Content-Type: multipart/form-data" -H "Authorization: Bearer <token>"`

Successful response

200 OK
"numOfValidDomains": "validDomains",
"numOfInvalidDomains": "invalidDomains",
"numOfDuplicateDomains": "duplicateDomains",
"errors": {
   "lineNumber": "lineNumber" 
   "lineContents": "lineContents" 
Possible error codes
  • UNAUTHORIZED - Missing or invalid token
  • FORBIDDEN - You are not authorized to perform this action
  • DOMAINLIST_ATTACHED_TO_NAMESPACE_EXCEED_100K_DOMAINS - Domain lists associated with namespaces can't exceed 100,000 domains
  • FAILED_TO_GET_ASSOCIATED_NAMESPACE - Error retrieving associated namespace