curl \
-H "Authorization: Bearer API_KEY" \
-H "Content-Type: application/json" \
-X POST https://api.ayrshare.com/api/ads/reddit/audiences/ca.129482487242828/users \
-d '{"accountId": "a2_abcdefg", "schema": ["EMAIL"], "data": [["5f4dcc3b5aa765d61d8327deb882cf99b8f0e2e1f6b0d3c0a9b3b2f1e0d9c8b7"]]}'
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/ads/reddit/audiences/ca.129482487242828/users", {
method: "POST",
headers: {
"Authorization": `Bearer ${API_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"accountId": "a2_abcdefg",
"schema": [
"EMAIL"
],
"data": [
[
"5f4dcc3b5aa765d61d8327deb882cf99b8f0e2e1f6b0d3c0a9b3b2f1e0d9c8b7"
]
]
})
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
import requests
headers = {'Authorization': 'Bearer API_KEY', 'Content-Type': 'application/json'}
payload = {
"accountId": "a2_abcdefg",
"schema": [
"EMAIL"
],
"data": [
[
"5f4dcc3b5aa765d61d8327deb882cf99b8f0e2e1f6b0d3c0a9b3b2f1e0d9c8b7"
]
]
}
r = requests.post('https://api.ayrshare.com/api/ads/reddit/audiences/ca.129482487242828/users', json=payload, headers=headers)
print(r.json())
{
"status": "success",
"id": "ca.129482487242828",
"received": 1,
"invalid": 0,
"batches": 1
}
{
"action": "request",
"status": "error",
"code": 101,
"message": "Missing or incorrect parameters. Please verify with the docs. https://www.ayrshare.com/docs/apis",
"details": "data[0][0] (EMAIL) is not a hash: expected 64 lowercase hex characters."
}
{
"action": "request",
"status": "error",
"code": 101,
"message": "Missing or incorrect parameters. Please verify with the docs. https://www.ayrshare.com/docs/apis",
"details": "id ca.129482487242999 is a website audience; members can be added to or removed from a customer-list audience only."
}
{
"action": "request",
"status": "error",
"code": 525,
"message": "The request body is too large. Please reduce the size of the request."
}
Reddit Ads
Audience Members
Reddit customer-list audience में लोगों को जोड़ें या हटाएँ, उनके email या mobile advertising ID के SHA-256 hashes भेजकर।
POST
/
ads
/
reddit
/
audiences
/
{id}
/
users
curl \
-H "Authorization: Bearer API_KEY" \
-H "Content-Type: application/json" \
-X POST https://api.ayrshare.com/api/ads/reddit/audiences/ca.129482487242828/users \
-d '{"accountId": "a2_abcdefg", "schema": ["EMAIL"], "data": [["5f4dcc3b5aa765d61d8327deb882cf99b8f0e2e1f6b0d3c0a9b3b2f1e0d9c8b7"]]}'
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/ads/reddit/audiences/ca.129482487242828/users", {
method: "POST",
headers: {
"Authorization": `Bearer ${API_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"accountId": "a2_abcdefg",
"schema": [
"EMAIL"
],
"data": [
[
"5f4dcc3b5aa765d61d8327deb882cf99b8f0e2e1f6b0d3c0a9b3b2f1e0d9c8b7"
]
]
})
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
import requests
headers = {'Authorization': 'Bearer API_KEY', 'Content-Type': 'application/json'}
payload = {
"accountId": "a2_abcdefg",
"schema": [
"EMAIL"
],
"data": [
[
"5f4dcc3b5aa765d61d8327deb882cf99b8f0e2e1f6b0d3c0a9b3b2f1e0d9c8b7"
]
]
}
r = requests.post('https://api.ayrshare.com/api/ads/reddit/audiences/ca.129482487242828/users', json=payload, headers=headers)
print(r.json())
{
"status": "success",
"id": "ca.129482487242828",
"received": 1,
"invalid": 0,
"batches": 1
}
{
"action": "request",
"status": "error",
"code": 101,
"message": "Missing or incorrect parameters. Please verify with the docs. https://www.ayrshare.com/docs/apis",
"details": "data[0][0] (EMAIL) is not a hash: expected 64 lowercase hex characters."
}
{
"action": "request",
"status": "error",
"code": 101,
"message": "Missing or incorrect parameters. Please verify with the docs. https://www.ayrshare.com/docs/apis",
"details": "id ca.129482487242999 is a website audience; members can be added to or removed from a customer-list audience only."
}
{
"action": "request",
"status": "error",
"code": 525,
"message": "The request body is too large. Please reduce the size of the request."
}
Audience बनाएँ से बनाई गई customer-list audience (
type: customerList) में लोगों को जोड़ें, या उन्हें हटाएँ। आप हर व्यक्ति को उसके normalized identifiers के SHA-256 hashes के रूप में भेजते हैं; Reddit hashes का accounts से मिलान करता है; raw मान कभी आपके सिस्टम से बाहर नहीं जाते।
DELETE /ads/reddit/audiences/{id}/users वही body लेता है और इसके बजाय लोगों को हटाता है।
- Reddit के कम से कम 1,000 लोगों का मिलान करने पर सूची boost में उपयोग की जा सकती है। ऐसा होने पर Audiences
status.readyदिखाता है। - हर request में अधिकतम 10,000 rows और अधिकतम 10 MiB की body होती है। बड़ी सूची कई requests में भेजें।
- अगर कोई request बीच में विफल हो जाता है, तो विफलता से पहले भेजी गई rows audience में बनी रहती हैं। पूरा request दोबारा भेजें: सूची में पहले से मौजूद व्यक्ति को जोड़ने से कुछ नहीं बदलता।
- Id,
accountIdसे बताए गए ad account की customer-list audience होनी चाहिए। कोई भी अन्य idcode: 101वाला400लौटाता है।
Hashed identifiers personal data हैं
Hashed email या advertising ID फिर भी GDPR और इसी तरह के कानूनों के तहत personal data है। जब आप सूची upload करते हैं:- आप data controller हैं। विज्ञापन के लिए लोगों का डेटा उपयोग करने के लिए आपको एक कानूनी आधार चाहिए, आमतौर पर सूची के लोगों की सहमति, जैसा आपकी privacy policy और Reddit की advertising policies माँगती हैं।
- Ayrshare एक processor है। हम hashes को Reddit तक पहुँचाते हैं और counts के अलावा कुछ नहीं रखते: body की कोई row log, cache या store नहीं की जाती, और response कभी कोई row नहीं दोहराता।
- भेजने से पहले hash आप करते हैं। Ayrshare कभी आपके लिए hash नहीं करता। जो मान hash नहीं है, उसे Reddit को कुछ भी भेजे जाने से पहले अस्वीकार कर दिया जाता है।
Hash कैसे करें
हर मान को Reddit की customer list guide के अनुसार normalize करें, फिर उसे SHA-256 से hash करें और परिणाम को 64 lowercase hex characters के रूप में भेजें। संक्षेप में:EMAIL: spaces हटाएँ और lowercase करें, उदाहरण के लिएjane@example.com।MADID: डिवाइस की mobile advertising ID (Google की GAID या Apple की IDFA)।
हैडर पैरामीटर
पाथ पैरामीटर
Customer-list audience id, Audience बनाएँ या Audiences से।
बॉडी पैरामीटर
हर column में identifier, क्रम से:
EMAIL, MADID, या दोनों। ये वही नाम हैं जो Facebook audiences उपयोग करती हैं। अन्य keys code: 101 वाला 400 लौटाती हैं।हर व्यक्ति के लिए एक row: एक array जिसमें हर
schema column के लिए एक SHA-256 hash हो, 64 lowercase hex characters के रूप में। अधिकतम 10,000 rows।ऐसा cell जो इस तरह का hash नहीं है, गलत width वाली row, या असमर्थित key, Reddit को कुछ भी भेजे जाने से पहले code: 101 वाला 400 लौटाती है। Message में row और column बताए जाते हैं, मान कभी नहीं, उदाहरण के लिए data[1][0] (EMAIL) is not a hash: expected 64 lowercase hex characters.Response
सिर्फ़ counts:received: Reddit द्वारा ली गई rows।invalid: Reddit पर हमेशा0। Reddit उन rows की report नहीं करता जिनका वह मिलान नहीं कर सका। मिलान बाद में Audiences में audience केsizeऔरstatusमें दिखते हैं।batches: rows कितने uploads में भेजी गईं। Reddit हर upload में 2,500 rows लेता है।
curl \
-H "Authorization: Bearer API_KEY" \
-H "Content-Type: application/json" \
-X POST https://api.ayrshare.com/api/ads/reddit/audiences/ca.129482487242828/users \
-d '{"accountId": "a2_abcdefg", "schema": ["EMAIL"], "data": [["5f4dcc3b5aa765d61d8327deb882cf99b8f0e2e1f6b0d3c0a9b3b2f1e0d9c8b7"]]}'
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/ads/reddit/audiences/ca.129482487242828/users", {
method: "POST",
headers: {
"Authorization": `Bearer ${API_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"accountId": "a2_abcdefg",
"schema": [
"EMAIL"
],
"data": [
[
"5f4dcc3b5aa765d61d8327deb882cf99b8f0e2e1f6b0d3c0a9b3b2f1e0d9c8b7"
]
]
})
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
import requests
headers = {'Authorization': 'Bearer API_KEY', 'Content-Type': 'application/json'}
payload = {
"accountId": "a2_abcdefg",
"schema": [
"EMAIL"
],
"data": [
[
"5f4dcc3b5aa765d61d8327deb882cf99b8f0e2e1f6b0d3c0a9b3b2f1e0d9c8b7"
]
]
}
r = requests.post('https://api.ayrshare.com/api/ads/reddit/audiences/ca.129482487242828/users', json=payload, headers=headers)
print(r.json())
{
"status": "success",
"id": "ca.129482487242828",
"received": 1,
"invalid": 0,
"batches": 1
}
{
"action": "request",
"status": "error",
"code": 101,
"message": "Missing or incorrect parameters. Please verify with the docs. https://www.ayrshare.com/docs/apis",
"details": "data[0][0] (EMAIL) is not a hash: expected 64 lowercase hex characters."
}
{
"action": "request",
"status": "error",
"code": 101,
"message": "Missing or incorrect parameters. Please verify with the docs. https://www.ayrshare.com/docs/apis",
"details": "id ca.129482487242999 is a website audience; members can be added to or removed from a customer-list audience only."
}
{
"action": "request",
"status": "error",
"code": 525,
"message": "The request body is too large. Please reduce the size of the request."
}