> For a complete documentation index, fetch https://docs.voximplant.ai/llms.txt # AppendToCallList POST https://api.voximplant.com/platform_api/AppendToCallList Content-Type: multipart/form-data Appends a new task to the existing call list. This method accepts CSV files with custom delimiters, such a commas (,), semicolons (;) and other. To specify a delimiter, pass it to the **delimiter** parameter. Allowed roles: `Owner`, `Admin`, `Developer`, `Call list manager`. Reference: https://docs.voximplant.ai/api-reference/management-api/reference/call-lists/append-to-call-list ## Authentication - `Authorization` header (bearer token, required) — Voximplant Management API uses signed JWT tokens generated from your service-account private key. Pass the token in the `Authorization` header as a Bearer value: ``` Authorization: Bearer $VOXIMPLANT_TOKEN ``` See [Authorization](/api-reference/management-api/authorization) for ready-to-copy snippets in bash, Python, Node.js and Go that turn your `credentials.json` into a token. ## Request ### Query parameters - `list_id` (integer, optional) — Call list ID. **Required** unless **list_name** is provided. - `encoding` (string, optional) — Encoding file. The default value is UTF-8 - `escape` (string, optional) — Escape character for parsing csv - `delimiter` (string, optional) — Separator values. The default value is ';' ### Body (multipart/form-data) This endpoint expects a multipart form containing a file. - `file_content` (file, required) — Send as the request body or multiform ## Response ### 200 Successful response - `result` (boolean, optional) — Whether the request completed successfully - `count` (integer, optional) — Number of stored records - `list_id` (integer, optional) — List ID - `batch_id` (AppendToCallListPostResponsesContentApplicationJsonSchemaBatchId, optional) — Batch UUID ## Types ### AppendToCallListPostResponsesContentApplicationJsonSchemaBatchId Batch UUID ## Examples **Request** ```json { "file_content": "" } ``` **Response** ```json { "result": true, "count": 25, "list_id": 42, "batch_id": "a3f1c9d2-7b4e-4f8a-9c3d-2e5f7b8a9c01" } ``` **SDK Code** ```python Example 1 import requests url = "https://api.voximplant.com/platform_api/AppendToCallList" files = { "file_content": "open('contacts_upload.csv', 'rb')" } headers = {"Authorization": "Bearer "} response = requests.post(url, files=files, headers=headers) print(response.json()) ``` ```javascript Example 1 const url = 'https://api.voximplant.com/platform_api/AppendToCallList'; const form = new FormData(); form.append('file_content', 'contacts_upload.csv'); const options = {method: 'POST', headers: {Authorization: 'Bearer '}}; options.body = form; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Example 1 package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.voximplant.com/platform_api/AppendToCallList" payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file_content\"; filename=\"contacts_upload.csv\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001--\r\n") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Example 1 require 'uri' require 'net/http' url = URI("https://api.voximplant.com/platform_api/AppendToCallList") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = 'Bearer ' request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file_content\"; filename=\"contacts_upload.csv\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001--\r\n" response = http.request(request) puts response.read_body ``` ```java Example 1 import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.voximplant.com/platform_api/AppendToCallList") .header("Authorization", "Bearer ") .body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file_content\"; filename=\"contacts_upload.csv\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001--\r\n") .asString(); ``` ```php Example 1 request('POST', 'https://api.voximplant.com/platform_api/AppendToCallList', [ 'multipart' => [ [ 'name' => 'file_content', 'filename' => 'contacts_upload.csv', 'contents' => null ] ] 'headers' => [ 'Authorization' => 'Bearer ', ], ]); echo $response->getBody(); ``` ```csharp Example 1 using RestSharp; var client = new RestClient("https://api.voximplant.com/platform_api/AppendToCallList"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "Bearer "); request.AddParameter("undefined", "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file_content\"; filename=\"contacts_upload.csv\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001--\r\n", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Example 1 import Foundation let headers = ["Authorization": "Bearer "] let parameters = [ [ "name": "file_content", "fileName": "contacts_upload.csv" ] ] let boundary = "---011000010111000001101001" var body = "" var error: NSError? = nil for param in parameters { let paramName = param["name"]! body += "--\(boundary)\r\n" body += "Content-Disposition:form-data; name=\"\(paramName)\"" if let filename = param["fileName"] { let contentType = param["content-type"]! let fileContent = String(contentsOfFile: filename, encoding: String.Encoding.utf8) if (error != nil) { print(error as Any) } body += "; filename=\"\(filename)\"\r\n" body += "Content-Type: \(contentType)\r\n\r\n" body += fileContent } else if let paramValue = param["value"] { body += "\r\n\r\n\(paramValue)" } } let request = NSMutableURLRequest(url: NSURL(string: "https://api.voximplant.com/platform_api/AppendToCallList")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```