curl --request GET \
--url https://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/campaigns \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/campaigns"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/campaigns', 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://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/campaigns",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>"
],
]);
$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://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/campaigns"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/campaigns")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("https://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/campaigns")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body"{ \"object\": \"List\", \"data\": [ { \"object\": \"Campaign\", \"id\": \"TestFromREST\", \"vid\": \"30b7590565f5bfbaaa97073616895058f56a27c5\", \"name\": \"TestFromREST\", \"description\": \"Campaign test from REST post\", \"state\": \"Active\", \"offer_start_date\": \"2021-01-16T00:00:00+00:00\", \"offer_end_date\": \"2022-01-16T00:00:00+00:00\", \"type\": \"Promotion\", \"percentage_discount\": 2, \"apply_discount_per_item\": false, \"number_of_periods\": 5, \"promotion_code\": null, \"stackability\": \"Stackable\" }, { \"object\": \"Campaign\", \"id\": \"CampaignsTest\", \"vid\": \"0d5ea80c7792156ec92364e30d18d19ab6b4032a\", \"name\": \"SUMMER50\", \"description\": \"Campaign test from REST post\", \"state\": \"Active\", \"offer_start_date\": \"2021-01-17T08:00:00+00:00\", \"offer_end_date\": \"2023-01-16T08:00:00+00:00\", \"type\": \"Coupon\", \"percentage_discount\": 50, \"apply_discount_per_item\": false, \"number_of_periods\": 5, \"max_redemptions\": 1, \"coupon_code_quantity\": 10, \"coupon_code_prefix\": \"HOT\", \"coupon_code_separator\": \"-\", \"coupon_code_requires_activation\": true, \"on_demand_codes_allowed\": true, \"stackability\": \"Stackable\", \"total_code_marked_used\": 0 }, { \"object\": \"Campaign\", \"id\": \"TestFromREST_NEW\", \"vid\": \"60e15a876b4f44ca3f030007275163abd8c87cc2\", \"name\": \"TestFromREST_NEW\", \"description\": \"Campaign test from REST post\", \"state\": \"Active\", \"offer_start_date\": \"2021-01-16T00:00:00+00:00\", \"offer_end_date\": \"2023-01-16T00:00:00+00:00\", \"type\": \"Promotion\", \"percentage_discount\": 2, \"apply_discount_per_item\": false, \"number_of_periods\": 5, \"promotion_code\": null, \"stackability\": \"Stackable\" } ], \"total_count\": 3, \"url\": \"/campaigns\", \"next\": \"/campaigns?starting_after=TestFromREST_NEW\", \"previous\": \"/campaigns?ending_before=TestFromREST\" }"{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}"{ \"object\": \"Error\", \"message\": \"This endpoint does not exist. Check our API docs.\" }"List All Campaigns
Retrieves all Campaigns.
curl --request GET \
--url https://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/campaigns \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/campaigns"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/campaigns', 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://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/campaigns",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>"
],
]);
$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://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/campaigns"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/campaigns")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("https://virtserver.swaggerhub.com/Amdocs_Media/Subscribe_API_WIP/2024.09/campaigns")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body"{ \"object\": \"List\", \"data\": [ { \"object\": \"Campaign\", \"id\": \"TestFromREST\", \"vid\": \"30b7590565f5bfbaaa97073616895058f56a27c5\", \"name\": \"TestFromREST\", \"description\": \"Campaign test from REST post\", \"state\": \"Active\", \"offer_start_date\": \"2021-01-16T00:00:00+00:00\", \"offer_end_date\": \"2022-01-16T00:00:00+00:00\", \"type\": \"Promotion\", \"percentage_discount\": 2, \"apply_discount_per_item\": false, \"number_of_periods\": 5, \"promotion_code\": null, \"stackability\": \"Stackable\" }, { \"object\": \"Campaign\", \"id\": \"CampaignsTest\", \"vid\": \"0d5ea80c7792156ec92364e30d18d19ab6b4032a\", \"name\": \"SUMMER50\", \"description\": \"Campaign test from REST post\", \"state\": \"Active\", \"offer_start_date\": \"2021-01-17T08:00:00+00:00\", \"offer_end_date\": \"2023-01-16T08:00:00+00:00\", \"type\": \"Coupon\", \"percentage_discount\": 50, \"apply_discount_per_item\": false, \"number_of_periods\": 5, \"max_redemptions\": 1, \"coupon_code_quantity\": 10, \"coupon_code_prefix\": \"HOT\", \"coupon_code_separator\": \"-\", \"coupon_code_requires_activation\": true, \"on_demand_codes_allowed\": true, \"stackability\": \"Stackable\", \"total_code_marked_used\": 0 }, { \"object\": \"Campaign\", \"id\": \"TestFromREST_NEW\", \"vid\": \"60e15a876b4f44ca3f030007275163abd8c87cc2\", \"name\": \"TestFromREST_NEW\", \"description\": \"Campaign test from REST post\", \"state\": \"Active\", \"offer_start_date\": \"2021-01-16T00:00:00+00:00\", \"offer_end_date\": \"2023-01-16T00:00:00+00:00\", \"type\": \"Promotion\", \"percentage_discount\": 2, \"apply_discount_per_item\": false, \"number_of_periods\": 5, \"promotion_code\": null, \"stackability\": \"Stackable\" } ], \"total_count\": 3, \"url\": \"/campaigns\", \"next\": \"/campaigns?starting_after=TestFromREST_NEW\", \"previous\": \"/campaigns?ending_before=TestFromREST\" }"{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}"{ \"object\": \"Error\", \"message\": \"This endpoint does not exist. Check our API docs.\" }"Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Query Parameters
A limit on the number of objects to be returned, between 1 and 100.
1 <= x <= 100A cursor for use in pagination. starting_after is an object id that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include starting_after=obj_foo in order to fetch the next page of the list.
A cursor for use in pagination. ending_before is an object id that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_bar, your subsequent call can include ending_before=obj_bar in order to fetch the previous page of the list.
Can be Active, Canceled, Complete, Inactive, MatchAnyState, Pending, Undefined
Response
JSON A list array of Campaigns. Each entry in the array is a full CCampaigns object. If no more objects are available, the resulting array will be empty. This request should never throw an error. A list of Campaigns objects matching the query. Also:
- "total_count": Integer count of the number of Campaigns objects in the returned list.
- "url": The query string provided in the request
- "next": The route (partial URL) to the next Campaigns object (string to select the “next”); included id should match that of the last object returned here
- "previous": The route (partial URL) to the previous Campaigns object (string to select the “previous”); included id should match that of the first object returned here
List Show child attributes
Show child attributes
Integer count of the number of items in the returned list.
The query string provided in the request
The route (partial URL) to the next CancelFeePolicy object (string to select the "next"); included id should match that of the last object returned here.
The route (partial URL) to the previous CancelFeePolicy object (string to select the "previous"); included id should match that of the first object returned here.
"{ \"object\": \"List\", \"data\": [ { \"object\": \"Campaign\", \"id\": \"TestFromREST\", \"vid\": \"30b7590565f5bfbaaa97073616895058f56a27c5\", \"name\": \"TestFromREST\", \"description\": \"Campaign test from REST post\", \"state\": \"Active\", \"offer_start_date\": \"2021-01-16T00:00:00+00:00\", \"offer_end_date\": \"2022-01-16T00:00:00+00:00\", \"type\": \"Promotion\", \"percentage_discount\": 2, \"apply_discount_per_item\": false, \"number_of_periods\": 5, \"promotion_code\": null, \"stackability\": \"Stackable\" }, { \"object\": \"Campaign\", \"id\": \"CampaignsTest\", \"vid\": \"0d5ea80c7792156ec92364e30d18d19ab6b4032a\", \"name\": \"SUMMER50\", \"description\": \"Campaign test from REST post\", \"state\": \"Active\", \"offer_start_date\": \"2021-01-17T08:00:00+00:00\", \"offer_end_date\": \"2023-01-16T08:00:00+00:00\", \"type\": \"Coupon\", \"percentage_discount\": 50, \"apply_discount_per_item\": false, \"number_of_periods\": 5, \"max_redemptions\": 1, \"coupon_code_quantity\": 10, \"coupon_code_prefix\": \"HOT\", \"coupon_code_separator\": \"-\", \"coupon_code_requires_activation\": true, \"on_demand_codes_allowed\": true, \"stackability\": \"Stackable\", \"total_code_marked_used\": 0 }, { \"object\": \"Campaign\", \"id\": \"TestFromREST_NEW\", \"vid\": \"60e15a876b4f44ca3f030007275163abd8c87cc2\", \"name\": \"TestFromREST_NEW\", \"description\": \"Campaign test from REST post\", \"state\": \"Active\", \"offer_start_date\": \"2021-01-16T00:00:00+00:00\", \"offer_end_date\": \"2023-01-16T00:00:00+00:00\", \"type\": \"Promotion\", \"percentage_discount\": 2, \"apply_discount_per_item\": false, \"number_of_periods\": 5, \"promotion_code\": null, \"stackability\": \"Stackable\" } ], \"total_count\": 3, \"url\": \"/campaigns\", \"next\": \"/campaigns?starting_after=TestFromREST_NEW\", \"previous\": \"/campaigns?ending_before=TestFromREST\" }"

