Voice Campaign Update
Aktualizacja kampanii głosowej
PUT /voice_campaign/{voice_campaign_id}
URL Parameters
Nazwa | Rodzaj | Opcjonalne | Opis |
---|---|---|---|
voice_campaign_id | <STRING> |
5b7c389fe8df7b60af688989 | Identyfikator systemowy Kampanii głosowej |
Body
{
"data": <VoiceCampaign>
}
Nazwa | Rodzaj | Opcjonalne | Opis |
---|---|---|---|
data | <VoiceCampaign> |
NIE | Dane Kampanii głosowej |
Response Body
{
"data": <VoiceCampaign>
}
Response Code
Status | Opis |
---|---|
200 | Żądanie przyjęte do realizacji |
403 | Nie można wykonać takiej akcji |
404 | Nie znaleziono zasobu |
Example
curl -X PUT \
$CONPEEK_URL/voice_campaign/5b7c389fe8df7b60af688989 \
-H 'Authorization: '$CONPEEK_KEY \
-H 'Content-Type: application/json' \
-d '{"data": {
"name": "May 2020 C1",
"project_id": 5,
"dialing_method": "PREVIEW"
}}'
import requests
import json
import os
from urllib import parse
url = parse.urljoin(os.environ["CONPEEK_URL"], "/voice_campaign/%(voice_campaign_id)s" % {
"voice_campaign_id": "5b7c389fe8df7b60af688989"
})
payload = {
"data": {
"name": "May 2020 C1",
"dialing_method": "PREVIEW"
}
}
headers = {
'Content-Type': "application/json",
'Authorization': os.environ["CONPEEK_KEY"]
}
response = requests.request("PUT", url, data=json.dumps(payload), headers=headers)
print(response.text)
<?php
$curl = curl_init();
$payload = array(
"data" => array(
"name" => "May 2020 C1",
"dialing_method" => "PREVIEW"
)
);
$voice_campaign_id = "5b7c389fe8df7b60af688989";
curl_setopt_array($curl, array(
CURLOPT_URL => getenv("CONPEEK_URL")."/voice_campaign/$voice_campaign_id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode($payload),
CURLOPT_HTTPHEADER => array(
"Authorization: ".getenv("CONPEEK_KEY"),
"Content-Type: application/json"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
Response
200 Accepted
{
"data": {
"name": "May 2020 C1",
"dialing_method": "PREVIEW",
...
}
}