/v1/accounts/{accountId}/blackLists/{blackListId}/numbers/uploadAdds the numbers of a CSV (comma-separated values) file, encoded as UTF-8, to a black list. This is the most efficient way to add a large number of numbers, for example when importing a Do Not Call registry.
Each row of the file must have exactly two columns: the number, and an optional description, which can be empty. For example:
+18005550101,Customer request
+18005550102,
+18005550103,Asked not to be called again
Invalid numbers are skipped, and reported in the response. Numbers that are already in the black list are skipped too. A row with a wrong number of columns makes the whole request fail with 400 Bad Request, indicating the line with the problem.
ID of your SIP Caller account. See Account ID.
ID of the black list.
Whether the first row of the file contains column names, and must be skipped. Defaults to false.
A multipart/form-data body with the file. Several files can be uploaded in the same request.
Returns an array with one result for each file uploaded:
Name of the uploaded file.
Number of rows read from the file.
Number of numbers added.
Number of rows skipped, because the number was invalid or duplicated.
Up to 10 of the invalid numbers found in the file, to help you find the problem.
/v1/accounts/ACCOUNT_ID/blackLists/BLACK_LIST_ID/numbers/upload
curl -X POST 'https://api.sipcaller.com/v1/accounts/ACCOUNT_ID/blackLists/BLACK_LIST_ID/numbers/upload?firstRowIsHeader=false' \
-H 'Authorization: Bearer API_KEY_TOKEN' \
-F 'file=@black-list-numbers.csv;type=text/csv'Response
200 OK
[
{
"fileName": "black-list-numbers.csv",
"totalNumbers": 18452,
"numbersAdded": 18449,
"numbersSkipped": 3,
"firstInvalidNumbers": [
"N/A",
"12"
]
}
]