Update Campaign API
This endpoint allows you to update an existing campaign by providing the necessary details like title, voice, language, script, etc.
Endpoint
POST https://www.toingg.com/api/v3/update_campaign
Headers
accept: application/json
Authorization: Bearer YOUR_ACCESS_TOKEN
Content-Type: application/json
Request Body
{
"campaignModelData": {
"title": "1477",
"voice": "string",
"language": "string",
"script": "string",
"purpose": "string",
"knowledgeBase": "string",
"calendar": "string",
"firstLine": "string",
"tone": "string",
"postCallAnalysis": false,
"postCallAnalysisSchema": {}
},
"campId": "668bd4e8a620ac9172c8d08b"
}
Example Code
Python
import requests
url = "https://www.toingg.com/api/v3/update_campaign"
payload = {
"campaignModelData": {
"title": "1477",
"voice": "string",
"language": "string",
"script": "string",
"purpose": "string",
"knowledgeBase": "string",
"calendar": "string",
"firstLine": "string",
"tone": "string",
"postCallAnalysis": False,
"postCallAnalysisSchema": {}
},
"campId": "668bd4e8a620ac9172c8d08b"
}
headers = {
"accept": "application/json",
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
JavaScript
const fetch = require('node-fetch');
const url = 'https://www.toingg.com/api/v3/update_campaign';
const payload = {
campaignModelData: {
title: '1477',
voice: 'string',
language: 'string',
script: 'string',
purpose: 'string',
knowledgeBase: 'string',
calendar: 'string',
firstLine: 'string',
tone: 'string',
postCallAnalysis: false,
postCallAnalysisSchema: {}
},
campId: '668bd4e8a620ac9172c8d08b'
};
const headers = {
'accept': 'application/json',
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json'
};
fetch(url, {
method: 'POST',
headers: headers,
body: JSON.stringify(payload)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
Responses
Code | Description | Links |
---|---|---|
200 | Successful Response | No links |
422 | Validation Error | No links |
Response Details
200 - Successful Response
- Media type: application/json
- Example Value:
"string"
422 - Validation Error
- Media type: application/json
- Example Value:
{
"detail": [
{
"loc": [
"string",
0
],
"msg": "string",
"type": "string"
}
]
}