Campaigns
Retry import
Run a campaign’s failed contacts import again. It resumes after the last line saved, so no contact is added twice.
POST
/
v2
/
campaign
/
{id}
/
import
/
retry
Retry import
curl --request POST \
--url https://api.verbeo.ai/v2/campaign/{id}/import/retry \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.verbeo.ai/v2/campaign/{id}/import/retry"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.verbeo.ai/v2/campaign/{id}/import/retry', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.verbeo.ai/v2/campaign/{id}/import/retry",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.verbeo.ai/v2/campaign/{id}/import/retry"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.verbeo.ai/v2/campaign/{id}/import/retry")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.verbeo.ai/v2/campaign/{id}/import/retry")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyQueues a
And the errors every route can give.
failed import again, with five more tries. It resumes after the last line it saved, so the contacts already imported are not added twice. Read import.error_message first: a file over the limit fails the same way again, and needs a new campaign with a smaller file.
Only a draft’s import runs again. A campaign cancelled during its import has to be created again.
Who may call it: any API key of the workspace; in the dashboard, an owner, admin or developer.
Path
Request
curl -X POST "https://api.verbeo.ai/v2/campaign/0175091d-2c3b-4aef-8c45-dbbe24f7b3ff/import/retry" \
-H "Authorization: Bearer YOUR_API_KEY"
Response
200 OK with the campaign object, its import queued again. Follow it with Get campaign.
{
"success": true,
"data": {
"id": "0175091d-2c3b-4aef-8c45-dbbe24f7b3ff",
"status": "draft",
"import": {
"id": "9b2f5c1e-4d3a-4e8b-a1f0-6c7d8e9f0a1b",
"status": "queued",
"lines_read": 20000,
"contacts_added": 19998,
"error_message": null,
"attempts": 0,
"…": "the rest of the import object"
},
"…": "the rest of the campaign object"
}
}
Errors
| Code | Status | When |
|---|---|---|
CONFLICT | 409 | The import has not failed: Only a failed import can be retried; this one is importing. (with its status). If it stopped failing meanwhile: Only a failed import can be retried; this one is no longer failed. |
CONFLICT | 409 | The campaign is no longer a draft, so its import cannot run again. |
CONFLICT | 409 | This campaign has no contacts file to import again.: a campaign made without one, before version 2 or through version 1. |
NOT_FOUND | 404 | Campaign not found. |
FORBIDDEN | 403 | A dashboard member below developer: Retrying an import requires the developer, admin or owner role. An API key acts as the owner and never gets it. |
Was this page helpful?
⌘I
Retry import
curl --request POST \
--url https://api.verbeo.ai/v2/campaign/{id}/import/retry \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.verbeo.ai/v2/campaign/{id}/import/retry"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.verbeo.ai/v2/campaign/{id}/import/retry', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.verbeo.ai/v2/campaign/{id}/import/retry",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.verbeo.ai/v2/campaign/{id}/import/retry"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.verbeo.ai/v2/campaign/{id}/import/retry")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.verbeo.ai/v2/campaign/{id}/import/retry")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body