curl -X POST "https://api-sandbox.whitelabel.com/v1/campaigns" \
-H "Content-Type: application/json" \
-H "public-api-key: <public-api-key>" \
-H "private-secret-key: <private-secret-key>" \
-d '{
"name": "string",
"account_id": "string",
"organization_code": "string",
"country": "string",
"channel": "WHATSAPP_MESSAGE",
"focus": "string",
"schedule": {
"daily_start_time": "string",
"daily_end_time": "string",
"time_zone": "string"
},
"duration": {
"start_at": "string",
"end_at": "string"
}
}'
const response = await fetch(`https://api-sandbox.whitelabel.com/v1/campaigns`, {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'public-api-key': '<public-api-key>', 'private-secret-key': '<private-secret-key>' },
body: JSON.stringify({
"name": "string",
"account_id": "string",
"organization_code": "string",
"country": "string",
"channel": "WHATSAPP_MESSAGE",
"focus": "string",
"schedule": {
"daily_start_time": "string",
"daily_end_time": "string",
"time_zone": "string"
},
"duration": {
"start_at": "string",
"end_at": "string"
}
})
});
const data = await response.json();
import requests
response = requests.request(
"POST",
"https://api-sandbox.whitelabel.com/v1/campaigns",
headers={ "public-api-key": "<public-api-key>", "private-secret-key": "<private-secret-key>" },
json={
"name": "string",
"account_id": "string",
"organization_code": "string",
"country": "string",
"channel": "WHATSAPP_MESSAGE",
"focus": "string",
"schedule": {
"daily_start_time": "string",
"daily_end_time": "string",
"time_zone": "string"
},
"duration": {
"start_at": "string",
"end_at": "string"
}
},
)
data = response.json()
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api-sandbox.whitelabel.com/v1/campaigns");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_HTTPHEADER, ["Content-Type: application/json", "public-api-key: <public-api-key>", "private-secret-key: <private-secret-key>"]);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{
"name": "string",
"account_id": "string",
"organization_code": "string",
"country": "string",
"channel": "WHATSAPP_MESSAGE",
"focus": "string",
"schedule": {
"daily_start_time": "string",
"daily_end_time": "string",
"time_zone": "string"
},
"duration": {
"start_at": "string",
"end_at": "string"
}
}');
$response = curl_exec($ch);
curl_close($ch);
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
req, _ := http.NewRequest("POST", "https://api-sandbox.whitelabel.com/v1/campaigns", strings.NewReader(`{
"name": "string",
"account_id": "string",
"organization_code": "string",
"country": "string",
"channel": "WHATSAPP_MESSAGE",
"focus": "string",
"schedule": {
"daily_start_time": "string",
"daily_end_time": "string",
"time_zone": "string"
},
"duration": {
"start_at": "string",
"end_at": "string"
}
}`))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("public-api-key", "<public-api-key>")
req.Header.Set("private-secret-key", "<private-secret-key>")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
data, _ := io.ReadAll(resp.Body)
fmt.Println(string(data))
}
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api-sandbox.whitelabel.com/v1/campaigns"))
.header("Content-Type", "application/json")
.header("public-api-key", "<public-api-key>")
.header("private-secret-key", "<private-secret-key>")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"name\": \"string\",\n \"account_id\": \"string\",\n \"organization_code\": \"string\",\n \"country\": \"string\",\n \"channel\": \"WHATSAPP_MESSAGE\",\n \"focus\": \"string\",\n \"schedule\": {\n \"daily_start_time\": \"string\",\n \"daily_end_time\": \"string\",\n \"time_zone\": \"string\"\n },\n \"duration\": {\n \"start_at\": \"string\",\n \"end_at\": \"string\"\n }\n}"))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
require "net/http"
require "uri"
uri = URI("https://api-sandbox.whitelabel.com/v1/campaigns")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
request = Net::HTTP::Post.new(uri)
request["Content-Type"] = "application/json"
request["public-api-key"] = "<public-api-key>"
request["private-secret-key"] = "<private-secret-key>"
request.body = "{\n \"name\": \"string\",\n \"account_id\": \"string\",\n \"organization_code\": \"string\",\n \"country\": \"string\",\n \"channel\": \"WHATSAPP_MESSAGE\",\n \"focus\": \"string\",\n \"schedule\": {\n \"daily_start_time\": \"string\",\n \"daily_end_time\": \"string\",\n \"time_zone\": \"string\"\n },\n \"duration\": {\n \"start_at\": \"string\",\n \"end_at\": \"string\"\n }\n}"
response = http.request(request)
puts response.body