Query all network ads and settings
curl --request GET \
--url https://apix.us.amity.co/api/v1/ads/me \
--header 'Authorization: Bearer <token>'import requests
url = "https://apix.us.amity.co/api/v1/ads/me"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://apix.us.amity.co/api/v1/ads/me', 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://apix.us.amity.co/api/v1/ads/me",
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: 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://apix.us.amity.co/api/v1/ads/me"
req, _ := http.NewRequest("GET", 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.get("https://apix.us.amity.co/api/v1/ads/me")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://apix.us.amity.co/api/v1/ads/me")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"ads": [
{
"adId": "<string>",
"advertiserId": "<string>",
"name": "<string>",
"placements": [],
"headline": "<string>",
"description": "<string>",
"body": "<string>",
"image1_1": "<string>",
"image9_16": "<string>",
"callToAction": "<string>",
"callToActionUrl": "<string>",
"targets": {
"communityIds": [
"<string>"
]
},
"startAt": "2023-11-07T05:31:56Z",
"endAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"advertisers": [
{
"advertiserId": "<string>",
"name": "<string>",
"companyName": "<string>",
"avatarFileId": "<string>",
"adsCount": 0,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"files": [
{
"fileId": "<string>",
"fileUrl": "<string>",
"accessType": "public",
"altText": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"attributes": {
"name": "<string>",
"extension": "<string>",
"size": 123,
"mimeType": "<string>",
"metadata": {
"exif": {},
"gps": {},
"height": 123,
"width": 123,
"isFull": true
}
}
}
],
"settings": {
"enabled": true,
"maxActiveAds": 500,
"frequency": {
"feed": {
"value": 5
},
"story": {
"value": 4
},
"comment": {
"value": 10
}
}
}
}Ads
Query all network ads and settings
GET
/
api
/
v1
/
ads
/
me
Query all network ads and settings
curl --request GET \
--url https://apix.us.amity.co/api/v1/ads/me \
--header 'Authorization: Bearer <token>'import requests
url = "https://apix.us.amity.co/api/v1/ads/me"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://apix.us.amity.co/api/v1/ads/me', 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://apix.us.amity.co/api/v1/ads/me",
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: 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://apix.us.amity.co/api/v1/ads/me"
req, _ := http.NewRequest("GET", 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.get("https://apix.us.amity.co/api/v1/ads/me")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://apix.us.amity.co/api/v1/ads/me")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"ads": [
{
"adId": "<string>",
"advertiserId": "<string>",
"name": "<string>",
"placements": [],
"headline": "<string>",
"description": "<string>",
"body": "<string>",
"image1_1": "<string>",
"image9_16": "<string>",
"callToAction": "<string>",
"callToActionUrl": "<string>",
"targets": {
"communityIds": [
"<string>"
]
},
"startAt": "2023-11-07T05:31:56Z",
"endAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"advertisers": [
{
"advertiserId": "<string>",
"name": "<string>",
"companyName": "<string>",
"avatarFileId": "<string>",
"adsCount": 0,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"files": [
{
"fileId": "<string>",
"fileUrl": "<string>",
"accessType": "public",
"altText": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"attributes": {
"name": "<string>",
"extension": "<string>",
"size": 123,
"mimeType": "<string>",
"metadata": {
"exif": {},
"gps": {},
"height": 123,
"width": 123,
"isFull": true
}
}
}
],
"settings": {
"enabled": true,
"maxActiveAds": 500,
"frequency": {
"feed": {
"value": 5
},
"story": {
"value": 4
},
"comment": {
"value": 10
}
}
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
⌘I