tanqoryExtMarketingCampaign
- Query
- Discounts and marketing
One campaign of the store, or null.
Arguments
| Argument | Type | Required | Default |
|---|---|---|---|
id | ID! | Required |
Returns
| Field | Type | Description |
|---|---|---|
activities | [MarketingActivity!]! | The marketing activities assigned to this campaign. |
createdAt | DateTime! | |
handle | String! | The campaign's ID as the merchant sees it: the utm_campaign value of its shareable link. |
id | ID! | |
landingPath | String! | The landing URL path and query the shareable link opens: "/?utm_campaign=<handle>&utm_source=shareable_link". |
links | [TanqoryExtMarketingCampaignLink!]! | |
matchRules | [TanqoryExtMarketingCampaignMatchRule!]! | The auto-match rules, oldest first. The field / operator rules of |
name | String! | |
observedActivities | [TanqoryExtMarketingObservedActivity!]! | Observed traffic assigned to this campaign by hand. |
rules | [TanqoryExtMarketingCampaignRule!]! | |
shareablePath | String! | "/s/<handle>": the shareable link path (it opens the storefront with the campaign's UTM parameters). |
shortLinks | [TanqoryExtMarketingCampaignShortLink!]! | The shareable links, newest first; the default one (/s/<ID>) last unless deleted. |
updatedAt | DateTime! |
Example request
A starting point: required arguments as variables and a few fields of the result. Replace the placeholders.
Set STORE_ID and TANQORY_ACCESS_TOKEN in your environment first (Make your first API call).
curl -X POST "https://api.tanqory.com/admin/2026-10/stores/$STORE_ID/graphql" \
-H "Authorization: Bearer $TANQORY_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
--data '{"query":"query TanqoryExtMarketingCampaign($id: ID!) {\n tanqoryExtMarketingCampaign(id: $id) {\n activities { id }\n createdAt\n handle\n id\n landingPath\n links { id }\n matchRules { id }\n name\n shareablePath\n shortLinks { id }\n }\n}","variables":{"id":"gid://tanqory/Type/id"}}'// Node.js 18 or later (fetch is built in). Save as request.mjs and run: node request.mjs
const query = `query TanqoryExtMarketingCampaign(\$id: ID!) {
tanqoryExtMarketingCampaign(id: \$id) {
activities { id }
createdAt
handle
id
landingPath
links { id }
matchRules { id }
name
shareablePath
shortLinks { id }
}
}`;
const variables = {
"id": "gid://tanqory/Type/id"
};
const res = await fetch(`https://api.tanqory.com/admin/2026-10/stores/${process.env.STORE_ID}/graphql`, {
method: 'POST',
headers: {
'Authorization': 'Bearer ' + process.env.TANQORY_ACCESS_TOKEN,
'Content-Type': 'application/json',
},
body: JSON.stringify({ query, variables }),
});
console.log(res.status, JSON.stringify(await res.json(), null, 2));# Python 3, standard library only. Save as request.py and run: python3 request.py
import json, os, urllib.request
query = """query TanqoryExtMarketingCampaign($id: ID!) {
tanqoryExtMarketingCampaign(id: $id) {
activities { id }
createdAt
handle
id
landingPath
links { id }
matchRules { id }
name
shareablePath
shortLinks { id }
}
}"""
variables = json.loads("""{
"id": "gid://tanqory/Type/id"
}""")
req = urllib.request.Request(
"https://api.tanqory.com/admin/2026-10/stores/" + os.environ["STORE_ID"] + "/graphql",
data=json.dumps({"query": query, "variables": variables}).encode(),
headers={
"Authorization": "Bearer " + os.environ["TANQORY_ACCESS_TOKEN"],
"Content-Type": "application/json",
},
)
with urllib.request.urlopen(req) as res:
print(res.status, json.dumps(json.load(res), indent=2))