{ "info": { "_postman_id": "e2108654-7ccc-4e18-a02f-a94f798e76b2", "name": "Twitter Ads API", "description": "This is a Postman collection for the Twitter Ads API endpoints. Please see the following documentation for more details:\nhttps://developer.twitter.com/en/docs/ads/general/overview\n\nIn case you have an API-related question, you can also go to the [community forum](https://twittercommunity.com/c/advertiser-api) and search/ask with [required information](https://twittercommunity.com/t/what-information-do-i-need-to-provide-in-order-to-get-help-on-the-forums-as-quickly-as-possible/58097).\n\n\n## Installation\n\n### Quick install\n\nMake sure you installed the [Postman client](https://www.getpostman.com/downloads/) on your machine then just click `Run in Postman` button at the right-top. Or, you could also install this collection from your Postman client directly by opening `New` => `Template` then search \"Twitter Ads API\".\n\n### Manual install\n\nYou can also download this collection files from GitHub repo here: \nhttps://github.com/twitterdev/postman-twitter-ads-api\n\n## Environment\n\nThis collection includes a pre-configured environment setting. You will be needing to set up below variables in order to run each request:\n\n|Name|Description|\n|---|---|\n|`account_id`|Your Ads Account ID.|\n|`version`|Please use the [latest version](https://developer.twitter.com/en/docs/ads/general/overview/versions).|\n|`consumer_key`||\n|`consumer_secret`||\n|`access_token`||\n|`token_secret`||\n\n## Authentication\n\nAs mentioned above, you need to configure your credentials. To get those, please see the following information:\n\n- [Authentication](https://developer.twitter.com/en/docs/basics/authentication/overview)\n- [Obtaining Ads Account credentials\n](https://developer.twitter.com/en/docs/ads/general/guides/obtaining-ads-account-access)\n\nPlease be noted that the Ads API currently only supports OAuth 1.0a.", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" }, "item": [ { "name": "Analytics", "item": [ { "name": "Active Entities", "item": [ { "name": "stats/accounts/:account_id/active_entities", "event": [ { "listen": "prerequest", "script": { "id": "ff0f2831-a045-4156-947b-1b123eed2754", "exec": [ "/*", " * This is a Pre-request script for Postman client to remediate OAuth 1.0a issue", " * where certain request fails if the query parameter includes some specific characters.", " * https://tools.ietf.org/html/rfc3986#section-2.2 (rfc3986, gen-delims reserved characters)", " *", " * NOTE: This Pre-script is intended to use with \"GET\" request but might be able to", " * work with other methods that have no request body.", " * For \"POST\" request, there's another workaround.", " * See: https://github.com/twitterdev/postman-twitter-ads-api/issues/2", " * ", " * In order to use this Pre-request script, you need to change your \"Authorization\" type to", " * \"No Auth\" only for the target request and do not apply to the top-level object.", " */", "", "const sdk = require('postman-collection');", "", "function toArray(object) {", " let array = [];", " Object.keys(object).forEach(key => {", " array.push(`${key}=${object[key]}`);", " });", " return array", "}", "", "// fetch all env variables that are currently defined", "const env_variables = pm.environment.toObject({", " excludeDisabled: true", "});", "", "const oauth_consumer_key = env_variables.consumer_key;", "const oauth_consumer_secret = env_variables.consumer_secret;", "const oauth_token = env_variables.access_token;", "const oauth_secret = env_variables.token_secret;", "const oauth_signing_key = `${oauth_consumer_secret}&${oauth_secret}`;", "", "// create random oauth_nonce string", "const random_source = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';", "var oauth_nonce = '';", "for (var i = 0; i < 32; i++) {", " oauth_nonce += random_source.charAt(Math.floor(Math.random() * random_source.length));", "}", "", "const oauth_parameter_string_object = {};", "oauth_parameter_string_object.oauth_consumer_key = oauth_consumer_key;", "oauth_parameter_string_object.oauth_token = oauth_token;", "const oauth_nonce_array = CryptoJS.enc.Utf8.parse(oauth_nonce);", "oauth_parameter_string_object.oauth_nonce = encodeURIComponent(CryptoJS.enc.Base64.stringify(oauth_nonce_array));", "oauth_parameter_string_object.oauth_signature_method = 'HMAC-SHA1';", "oauth_parameter_string_object.oauth_version = '1.0';", "oauth_parameter_string_object.oauth_timestamp = Math.round((new Date()).getTime() / 1000);", "", "// for Authorization request header (copy object)", "const oauth_authorization_header_object = Object.assign({}, oauth_parameter_string_object);", "", "// convert query string into object (+ encode)", "const url_query_string_object = {};", "", "const url_query_string_object_array = sdk.QueryParam.parse(", " pm.request.url.getQueryString({", " ignoreDisabled: true", " })", ");", "", "url_query_string_object_array.forEach(item => {", " url_query_string_object[item.key] = encodeURIComponent(item.value);", "});", "", "// merge query parameter", "Object.assign(oauth_parameter_string_object, url_query_string_object);", "", "// sort object by key", "const oauth_parameter_string_object_ordered = {};", "Object.keys(oauth_parameter_string_object).sort().forEach(function(key) {", " oauth_parameter_string_object_ordered[key] = oauth_parameter_string_object[key];", "});", "", "// generate parameter string", "const oauth_parameter_string = toArray(oauth_parameter_string_object_ordered).join('&');", "", "// replace dynamic variables", "let base_host = pm.request.url.getOAuth1BaseUrl();", "let regexp = /{{(.*?)}}/g;", "while (result = regexp.exec(base_host)) {", " let value = env_variables[result[1]];", " base_host = base_host.replace(new RegExp(`{{${result[1]}}}`, 'g'), value);", "}", "", "// generate base string", "const oauth_base_string = `${pm.request.method}&${encodeURIComponent(base_host)}&${encodeURIComponent(oauth_parameter_string)}`;", "", "// generate signature", "const oauth_signature = CryptoJS.enc.Base64.stringify(CryptoJS.HmacSHA1(oauth_base_string, oauth_signing_key));", "", "oauth_authorization_header_object.oauth_signature = encodeURIComponent(oauth_signature);", "", "// generate Authorization header string", "const oauth_authorization_header = toArray(oauth_authorization_header_object).join(', ');", "", "// generate Authorization header", "pm.request.headers.add({", " key: 'Authorization',", " value: `OAuth ${oauth_authorization_header}`", "});", "", "// Escape URI parameters using encodeURIComponent => RFC3986", "if (Object.keys(url_query_string_object).length !== 0) {", " // generate query parameter string", " const request_parameter_string = toArray(url_query_string_object).join('&');", "", " pm.request.url = `${pm.request.url.getOAuth1BaseUrl()}?${request_parameter_string}`;", "}" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "noauth" }, "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/stats/accounts/{{account_id}}/active_entities?end_time=&entity=&start_time=", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "stats", "accounts", "{{account_id}}", "active_entities" ], "query": [ { "key": "end_time", "value": "", "description": "required" }, { "key": "entity", "value": "", "description": "required" }, { "key": "start_time", "value": "", "description": "required" }, { "key": "campaign_ids", "value": "", "description": "optional", "disabled": true }, { "key": "funding_instrument_ids", "value": "", "description": "optional", "disabled": true }, { "key": "line_item_ids", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] } ], "description": "https://developer.twitter.com/en/docs/ads/analytics/api-reference/active-entities", "event": [ { "listen": "prerequest", "script": { "id": "271f619e-4579-4dd9-a3c3-8126f44bc0e1", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "73eab28c-24ca-4b88-981f-4eb89a93aa70", "type": "text/javascript", "exec": [ "" ] } } ], "_postman_isSubFolder": true }, { "name": "Asynchronous Analytics", "item": [ { "name": "stats/jobs/accounts/:account_id", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/stats/jobs/accounts/{{account_id}}?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "stats", "jobs", "accounts", "{{account_id}}" ], "query": [ { "key": "count", "value": "", "description": "optional", "disabled": true }, { "key": "cursor", "value": "", "description": "optional", "disabled": true }, { "key": "job_ids", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "stats/jobs/accounts/:account_id", "event": [ { "listen": "prerequest", "script": { "id": "b3c3fcbe-dc0e-4581-a4c2-25e4df0f1c2d", "exec": [ "/*", " * This is a Pre-request script for Postman client to remediate OAuth 1.0a issue", " * where certain request fails if the query parameter includes some specific characters.", " * https://tools.ietf.org/html/rfc3986#section-2.2 (rfc3986, gen-delims reserved characters)", " *", " * NOTE: This Pre-script is intended to use with \"GET\" request but might be able to", " * work with other methods that have no request body.", " * For \"POST\" request, there's another workaround.", " * See: https://github.com/twitterdev/postman-twitter-ads-api/issues/2", " * ", " * In order to use this Pre-request script, you need to change your \"Authorization\" type to", " * \"No Auth\" only for the target request and do not apply to the top-level object.", " */", "", "const sdk = require('postman-collection');", "", "function toArray(object) {", " let array = [];", " Object.keys(object).forEach(key => {", " array.push(`${key}=${object[key]}`);", " });", " return array", "}", "", "// fetch all env variables that are currently defined", "const env_variables = pm.environment.toObject({", " excludeDisabled: true", "});", "", "const oauth_consumer_key = env_variables.consumer_key;", "const oauth_consumer_secret = env_variables.consumer_secret;", "const oauth_token = env_variables.access_token;", "const oauth_secret = env_variables.token_secret;", "const oauth_signing_key = `${oauth_consumer_secret}&${oauth_secret}`;", "", "// create random oauth_nonce string", "const random_source = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';", "var oauth_nonce = '';", "for (var i = 0; i < 32; i++) {", " oauth_nonce += random_source.charAt(Math.floor(Math.random() * random_source.length));", "}", "", "const oauth_parameter_string_object = {};", "oauth_parameter_string_object.oauth_consumer_key = oauth_consumer_key;", "oauth_parameter_string_object.oauth_token = oauth_token;", "const oauth_nonce_array = CryptoJS.enc.Utf8.parse(oauth_nonce);", "oauth_parameter_string_object.oauth_nonce = encodeURIComponent(CryptoJS.enc.Base64.stringify(oauth_nonce_array));", "oauth_parameter_string_object.oauth_signature_method = 'HMAC-SHA1';", "oauth_parameter_string_object.oauth_version = '1.0';", "oauth_parameter_string_object.oauth_timestamp = Math.round((new Date()).getTime() / 1000);", "", "// for Authorization request header (copy object)", "const oauth_authorization_header_object = Object.assign({}, oauth_parameter_string_object);", "", "// convert query string into object (+ encode)", "const url_query_string_object = {};", "", "const url_query_string_object_array = sdk.QueryParam.parse(", " pm.request.url.getQueryString({", " ignoreDisabled: true", " })", ");", "", "url_query_string_object_array.forEach(item => {", " url_query_string_object[item.key] = encodeURIComponent(item.value);", "});", "", "// merge query parameter", "Object.assign(oauth_parameter_string_object, url_query_string_object);", "", "// sort object by key", "const oauth_parameter_string_object_ordered = {};", "Object.keys(oauth_parameter_string_object).sort().forEach(function(key) {", " oauth_parameter_string_object_ordered[key] = oauth_parameter_string_object[key];", "});", "", "// generate parameter string", "const oauth_parameter_string = toArray(oauth_parameter_string_object_ordered).join('&');", "", "// replace dynamic variables", "let base_host = pm.request.url.getOAuth1BaseUrl();", "let regexp = /{{(.*?)}}/g;", "while (result = regexp.exec(base_host)) {", " let value = env_variables[result[1]];", " base_host = base_host.replace(new RegExp(`{{${result[1]}}}`, 'g'), value);", "}", "", "// generate base string", "const oauth_base_string = `${pm.request.method}&${encodeURIComponent(base_host)}&${encodeURIComponent(oauth_parameter_string)}`;", "", "// generate signature", "const oauth_signature = CryptoJS.enc.Base64.stringify(CryptoJS.HmacSHA1(oauth_base_string, oauth_signing_key));", "", "oauth_authorization_header_object.oauth_signature = encodeURIComponent(oauth_signature);", "", "// generate Authorization header string", "const oauth_authorization_header = toArray(oauth_authorization_header_object).join(', ');", "", "// generate Authorization header", "pm.request.headers.add({", " key: 'Authorization',", " value: `OAuth ${oauth_authorization_header}`", "});", "", "// Escape URI parameters using encodeURIComponent => RFC3986", "if (Object.keys(url_query_string_object).length !== 0) {", " // generate query parameter string", " const request_parameter_string = toArray(url_query_string_object).join('&');", "", " pm.request.url = `${pm.request.url.getOAuth1BaseUrl()}?${request_parameter_string}`;", "}" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "noauth" }, "method": "POST", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/stats/jobs/accounts/{{account_id}}?end_time=&entity=&entity_ids=&granularity=&metric_groups=&placement=&start_time=", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "stats", "jobs", "accounts", "{{account_id}}" ], "query": [ { "key": "end_time", "value": "", "description": "required" }, { "key": "entity", "value": "", "description": "required" }, { "key": "entity_ids", "value": "", "description": "required" }, { "key": "granularity", "value": "", "description": "required" }, { "key": "metric_groups", "value": "", "description": "required" }, { "key": "placement", "value": "", "description": "required" }, { "key": "start_time", "value": "", "description": "required" }, { "key": "country", "value": "", "description": "sometimes required", "disabled": true }, { "key": "platform", "value": "", "description": "sometimes required", "disabled": true }, { "key": "segmentation_type", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "stats/jobs/accounts/:account_id/:job_id", "request": { "method": "DELETE", "header": [], "body": { "mode": "raw", "raw": "" }, "url": { "raw": "https://ads-api.twitter.com/{{version}}/stats/jobs/accounts/{{account_id}}/:job_id", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "stats", "jobs", "accounts", "{{account_id}}", ":job_id" ], "variable": [ { "id": "128ec6cf-7d0f-4b45-ab81-3d5d47cfd105", "key": "job_id", "type": "any" } ] } }, "response": [] } ], "description": "https://developer.twitter.com/en/docs/ads/analytics/api-reference/asynchronous", "event": [ { "listen": "prerequest", "script": { "id": "29f239d9-dc0b-4617-81b0-bc9f6921ea07", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "b48fccb8-42fb-4189-beb0-48974e89e66c", "type": "text/javascript", "exec": [ "" ] } } ], "_postman_isSubFolder": true }, { "name": "Auction Insights", "item": [ { "name": "accounts/:account_id/auction_insights", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/auction_insights?end_time=&granularity=&line_item_ids=&placement=&start_time=", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "auction_insights" ], "query": [ { "key": "end_time", "value": "", "description": "required" }, { "key": "granularity", "value": "", "description": "required" }, { "key": "line_item_ids", "value": "", "description": "required" }, { "key": "placement", "value": "", "description": "required" }, { "key": "start_time", "value": "", "description": "required" } ] } }, "response": [] } ], "description": "https://developer.twitter.com/en/docs/ads/analytics/api-reference/auction-insights", "event": [ { "listen": "prerequest", "script": { "id": "d08c4cb5-64bb-47fa-9614-f07c9a2922e9", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "218b451c-c86f-4860-88a8-ddd60ed1b102", "type": "text/javascript", "exec": [ "" ] } } ], "_postman_isSubFolder": true }, { "name": "Reach and Average Frequency", "item": [ { "name": "stats/accounts/:account_id/reach/campaigns", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/stats/accounts/{{account_id}}/reach/campaigns?campaign_ids=&end_time=&start_time=", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "stats", "accounts", "{{account_id}}", "reach", "campaigns" ], "query": [ { "key": "campaign_ids", "value": "", "description": "required" }, { "key": "end_time", "value": "", "description": "required" }, { "key": "start_time", "value": "", "description": "required" } ] } }, "response": [] }, { "name": "stats/accounts/:account_id/reach/funding_instruments", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/stats/accounts/{{account_id}}/reach/funding_instruments?funding_instrument_ids=&end_time=&start_time=", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "stats", "accounts", "{{account_id}}", "reach", "funding_instruments" ], "query": [ { "key": "funding_instrument_ids", "value": "", "description": "required" }, { "key": "end_time", "value": "", "description": "required" }, { "key": "start_time", "value": "", "description": "required" } ] } }, "response": [] } ], "description": "https://developer.twitter.com/en/docs/ads/analytics/api-reference/reach", "event": [ { "listen": "prerequest", "script": { "id": "5737dc42-892b-4459-b5a3-0b220d8d4060", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "04fbe8d2-80af-4bcf-af97-db9d3982660b", "type": "text/javascript", "exec": [ "" ] } } ], "_postman_isSubFolder": true }, { "name": "Synchronous Analytics", "item": [ { "name": "stats/accounts/:account_id", "event": [ { "listen": "prerequest", "script": { "id": "6dfdd7e4-fb84-4021-bec5-6a8a4f68666a", "exec": [ "/*", " * This is a Pre-request script for Postman client to remediate OAuth 1.0a issue", " * where certain request fails if the query parameter includes some specific characters.", " * https://tools.ietf.org/html/rfc3986#section-2.2 (rfc3986, gen-delims reserved characters)", " *", " * NOTE: This Pre-script is intended to use with \"GET\" request but might be able to", " * work with other methods that have no request body.", " * For \"POST\" request, there's another workaround.", " * See: https://github.com/twitterdev/postman-twitter-ads-api/issues/2", " * ", " * In order to use this Pre-request script, you need to change your \"Authorization\" type to", " * \"No Auth\" only for the target request and do not apply to the top-level object.", " */", "", "const sdk = require('postman-collection');", "", "function toArray(object) {", " let array = [];", " Object.keys(object).forEach(key => {", " array.push(`${key}=${object[key]}`);", " });", " return array", "}", "", "// fetch all env variables that are currently defined", "const env_variables = pm.environment.toObject({", " excludeDisabled: true", "});", "", "const oauth_consumer_key = env_variables.consumer_key;", "const oauth_consumer_secret = env_variables.consumer_secret;", "const oauth_token = env_variables.access_token;", "const oauth_secret = env_variables.token_secret;", "const oauth_signing_key = `${oauth_consumer_secret}&${oauth_secret}`;", "", "// create random oauth_nonce string", "const random_source = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';", "var oauth_nonce = '';", "for (var i = 0; i < 32; i++) {", " oauth_nonce += random_source.charAt(Math.floor(Math.random() * random_source.length));", "}", "", "const oauth_parameter_string_object = {};", "oauth_parameter_string_object.oauth_consumer_key = oauth_consumer_key;", "oauth_parameter_string_object.oauth_token = oauth_token;", "const oauth_nonce_array = CryptoJS.enc.Utf8.parse(oauth_nonce);", "oauth_parameter_string_object.oauth_nonce = encodeURIComponent(CryptoJS.enc.Base64.stringify(oauth_nonce_array));", "oauth_parameter_string_object.oauth_signature_method = 'HMAC-SHA1';", "oauth_parameter_string_object.oauth_version = '1.0';", "oauth_parameter_string_object.oauth_timestamp = Math.round((new Date()).getTime() / 1000);", "", "// for Authorization request header (copy object)", "const oauth_authorization_header_object = Object.assign({}, oauth_parameter_string_object);", "", "// convert query string into object (+ encode)", "const url_query_string_object = {};", "", "const url_query_string_object_array = sdk.QueryParam.parse(", " pm.request.url.getQueryString({", " ignoreDisabled: true", " })", ");", "", "url_query_string_object_array.forEach(item => {", " url_query_string_object[item.key] = encodeURIComponent(item.value);", "});", "", "// merge query parameter", "Object.assign(oauth_parameter_string_object, url_query_string_object);", "", "// sort object by key", "const oauth_parameter_string_object_ordered = {};", "Object.keys(oauth_parameter_string_object).sort().forEach(function(key) {", " oauth_parameter_string_object_ordered[key] = oauth_parameter_string_object[key];", "});", "", "// generate parameter string", "const oauth_parameter_string = toArray(oauth_parameter_string_object_ordered).join('&');", "", "// replace dynamic variables", "let base_host = pm.request.url.getOAuth1BaseUrl();", "let regexp = /{{(.*?)}}/g;", "while (result = regexp.exec(base_host)) {", " let value = env_variables[result[1]];", " base_host = base_host.replace(new RegExp(`{{${result[1]}}}`, 'g'), value);", "}", "", "// generate base string", "const oauth_base_string = `${pm.request.method}&${encodeURIComponent(base_host)}&${encodeURIComponent(oauth_parameter_string)}`;", "", "// generate signature", "const oauth_signature = CryptoJS.enc.Base64.stringify(CryptoJS.HmacSHA1(oauth_base_string, oauth_signing_key));", "", "oauth_authorization_header_object.oauth_signature = encodeURIComponent(oauth_signature);", "", "// generate Authorization header string", "const oauth_authorization_header = toArray(oauth_authorization_header_object).join(', ');", "", "// generate Authorization header", "pm.request.headers.add({", " key: 'Authorization',", " value: `OAuth ${oauth_authorization_header}`", "});", "", "// Escape URI parameters using encodeURIComponent => RFC3986", "if (Object.keys(url_query_string_object).length !== 0) {", " // generate query parameter string", " const request_parameter_string = toArray(url_query_string_object).join('&');", "", " pm.request.url = `${pm.request.url.getOAuth1BaseUrl()}?${request_parameter_string}`;", "}" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "noauth" }, "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/stats/accounts/{{account_id}}?end_time=&entity=&entity_ids=&granularity=&metric_groups=&placement=&start_time=", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "stats", "accounts", "{{account_id}}" ], "query": [ { "key": "end_time", "value": "", "description": "required" }, { "key": "entity", "value": "", "description": "required" }, { "key": "entity_ids", "value": "", "description": "required" }, { "key": "granularity", "value": "", "description": "required" }, { "key": "metric_groups", "value": "", "description": "required" }, { "key": "placement", "value": "", "description": "required" }, { "key": "start_time", "value": "", "description": "required" } ] } }, "response": [] } ], "description": "https://developer.twitter.com/en/docs/ads/analytics/api-reference/synchronous", "event": [ { "listen": "prerequest", "script": { "id": "6b646455-8a0e-480b-963e-fe2e25d4e42e", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "2df11bc9-8be2-4efd-b88f-1b57d5659ac7", "type": "text/javascript", "exec": [ "" ] } } ], "_postman_isSubFolder": true } ], "description": "https://developer.twitter.com/en/docs/ads/analytics/overview", "event": [ { "listen": "prerequest", "script": { "id": "6a6dccc7-fd53-406e-b1e6-21b5ef957d46", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "9fe3821d-675c-4d4c-8138-5618b2f129d1", "type": "text/javascript", "exec": [ "" ] } } ] }, { "name": "Audience", "item": [ { "name": "Insights", "item": [ { "name": "insights/accounts/:account_id", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/insights/accounts/{{account_id}}?audience_type=", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "insights", "accounts", "{{account_id}}" ], "query": [ { "key": "audience_type", "value": "", "description": "required" }, { "key": "audience_value", "value": "", "description": "sometimes required", "disabled": true }, { "key": "interaction_type", "value": "", "description": "sometimes required", "disabled": true } ] } }, "response": [] }, { "name": "insights/accounts/:account_id/available_audiences", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/insights/accounts/{{account_id}}/available_audiences", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "insights", "accounts", "{{account_id}}", "available_audiences" ] } }, "response": [] } ], "description": "https://developer.twitter.com/en/docs/ads/audiences/api-reference/insights", "event": [ { "listen": "prerequest", "script": { "id": "caf58e62-a918-4c25-9793-4e790bbf9f33", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "27a1d5a0-565a-48bb-94b1-7db75c4b41d5", "type": "text/javascript", "exec": [ "" ] } } ], "_postman_isSubFolder": true }, { "name": "Keyword Insights", "item": [ { "name": "insights/keywords/search", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/insights/keywords/search?granularity=&keywords=&start_time=", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "insights", "keywords", "search" ], "query": [ { "key": "granularity", "value": "", "description": "required" }, { "key": "keywords", "value": "", "description": "required" }, { "key": "start_time", "value": "", "description": "required" }, { "key": "end_time", "value": "", "description": "optional", "disabled": true }, { "key": "location", "value": "", "description": "optional", "disabled": true }, { "key": "negative_keywords", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] } ], "description": "https://developer.twitter.com/en/docs/ads/audiences/api-reference/keyword-insights", "event": [ { "listen": "prerequest", "script": { "id": "45222482-ecf2-4f8e-a83a-dee35e3e2a9d", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "f3ca6aaa-5605-4246-94ef-3c32dbeafe38", "type": "text/javascript", "exec": [ "" ] } } ], "_postman_isSubFolder": true }, { "name": "Tailored Audience Permissions", "item": [ { "name": "accounts/:account_id/tailored_audiences/:tailored_audience_id/permissions", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/tailored_audiences/:tailored_audience_id/permissions?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "tailored_audiences", ":tailored_audience_id", "permissions" ], "query": [ { "key": "count", "value": "", "description": "optional", "disabled": true }, { "key": "cursor", "value": "", "description": "optional", "disabled": true }, { "key": "granted_account_ids", "value": "", "description": "optional", "disabled": true }, { "key": "sort_by", "value": "", "description": "optional", "disabled": true }, { "key": "tailored_audience_permission_ids", "value": "", "description": "optional", "disabled": true }, { "key": "with_total_count", "value": "", "description": "optional", "disabled": true } ], "variable": [ { "id": "bcde5dae-6735-43ba-a453-417c0d47b2f4", "key": "tailored_audience_id", "type": "any" } ] } }, "response": [] }, { "name": "accounts/:account_id/tailored_audiences/:tailored_audience_id/permissions", "request": { "method": "POST", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/tailored_audiences/:tailored_audience_id/permissions?granted_account_id=&permission_level=", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "tailored_audiences", ":tailored_audience_id", "permissions" ], "query": [ { "key": "granted_account_id", "value": "", "description": "required" }, { "key": "permission_level", "value": "", "description": "required" } ], "variable": [ { "id": "a336d7b3-410c-4d76-a3eb-1ed091572b0e", "key": "tailored_audience_id", "type": "any" } ] } }, "response": [] }, { "name": "accounts/:account_id/tailored_audiences/:tailored_audience_id/permissions/:tailored_audience_permission_id", "request": { "method": "DELETE", "header": [], "body": { "mode": "raw", "raw": "" }, "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/tailored_audiences/:tailored_audience_id/permissions/:tailored_audience_permission_id?tailored_audience_permission_id=", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "tailored_audiences", ":tailored_audience_id", "permissions", ":tailored_audience_permission_id" ], "query": [ { "key": "tailored_audience_permission_id", "value": "", "description": "required" } ], "variable": [ { "id": "623c2373-69a3-457c-8e5a-4d03408029b3", "key": "tailored_audience_id", "type": "any" }, { "id": "095b161b-c394-46ce-bc15-2b1c96d3ad1c", "key": "tailored_audience_permission_id", "type": "any" } ] } }, "response": [] } ], "description": "https://developer.twitter.com/en/docs/ads/audiences/api-reference/tailored-audience-permissions", "event": [ { "listen": "prerequest", "script": { "id": "a72c0b3d-f36f-4d53-a04c-0408de872cea", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "371b0695-4db9-4aea-b819-bc15b421ed3f", "type": "text/javascript", "exec": [ "" ] } } ], "_postman_isSubFolder": true }, { "name": "Tailored Audiences", "item": [ { "name": "accounts/:account_id/tailored_audiences", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/tailored_audiences?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "tailored_audiences" ], "query": [ { "key": "count", "value": "", "description": "optional", "disabled": true }, { "key": "cursor", "value": "", "description": "optional", "disabled": true }, { "key": "permission_scope", "value": "", "description": "optional", "disabled": true }, { "key": "q", "value": "", "description": "optional", "disabled": true }, { "key": "sort_by", "value": "", "description": "optional", "disabled": true }, { "key": "tailored_audience_ids", "value": "", "description": "optional", "disabled": true }, { "key": "with_deleted", "value": "", "description": "optional", "disabled": true }, { "key": "with_total_count", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "accounts/:account_id/tailored_audiences/:tailored_audience_id", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/tailored_audiences/:tailored_audience_id?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "tailored_audiences", ":tailored_audience_id" ], "query": [ { "key": "with_deleted", "value": "", "description": "optional", "disabled": true } ], "variable": [ { "id": "150940c1-9fed-4508-8537-823b87d6c4e9", "key": "tailored_audience_id", "type": "any" } ] } }, "response": [] }, { "name": "accounts/:account_id/tailored_audiences", "request": { "method": "POST", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/tailored_audiences?name=", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "tailored_audiences" ], "query": [ { "key": "name", "value": "", "description": "required" } ] } }, "response": [] }, { "name": "batch/accounts/:account_id/tailored_audiences", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json" } ], "url": { "raw": "https://ads-api.twitter.com/{{version}}/batch/accounts/{{account_id}}/tailored_audiences?audience_type=&child_segments=&name=&operation_type=¶ms=", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "batch", "accounts", "{{account_id}}", "tailored_audiences" ], "query": [ { "key": "audience_type", "value": "", "description": "required" }, { "key": "child_segments", "value": "", "description": "required" }, { "key": "name", "value": "", "description": "required" }, { "key": "operation_type", "value": "", "description": "required" }, { "key": "params", "value": "", "description": "required" }, { "key": "boolean_operator", "value": "", "description": "sometimes required", "disabled": true }, { "key": "lookback_window", "value": "", "description": "sometimes required", "disabled": true }, { "key": "segments", "value": "", "description": "sometimes required", "disabled": true }, { "key": "tailored_audience_id", "value": "", "description": "sometimes required", "disabled": true }, { "key": "frequency", "value": "", "description": "optional", "disabled": true }, { "key": "frequency_comparator", "value": "", "description": "optional", "disabled": true }, { "key": "negate", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "accounts/:account_id/tailored_audiences/:tailored_audience_id", "request": { "method": "DELETE", "header": [], "body": { "mode": "raw", "raw": "" }, "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/tailored_audiences/:tailored_audience_id", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "tailored_audiences", ":tailored_audience_id" ], "variable": [ { "id": "fae98da5-bcaa-402f-929e-ca0acef77764", "key": "tailored_audience_id", "type": "any" } ] } }, "response": [] } ], "description": "https://developer.twitter.com/en/docs/ads/audiences/api-reference/tailored-audiences", "event": [ { "listen": "prerequest", "script": { "id": "5ab092b0-5e3b-4320-a078-3242329d1b32", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "cc28c29e-e61f-436f-b2ab-45738b3cf4b9", "type": "text/javascript", "exec": [ "" ] } } ], "_postman_isSubFolder": true }, { "name": "Tailored Audiences Users", "item": [ { "name": "accounts/:account_id/tailored_audiences/:tailored_audience_id/users", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json" } ], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/tailored_audiences/:tailored_audience_id/users?operation_type=¶ms=&users=", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "tailored_audiences", ":tailored_audience_id", "users" ], "query": [ { "key": "operation_type", "value": "", "description": "required" }, { "key": "params", "value": "", "description": "required" }, { "key": "users", "value": "", "description": "required" }, { "key": "effective_at", "value": "", "description": "optional", "disabled": true }, { "key": "expires_at", "value": "", "description": "optional", "disabled": true } ], "variable": [ { "id": "0c6b748f-48a4-441a-9b64-b48fe3698b6a", "key": "tailored_audience_id", "value": "", "type": "string" } ] } }, "response": [] } ], "description": "https://developer.twitter.com/en/docs/ads/audiences/api-reference/audience", "event": [ { "listen": "prerequest", "script": { "id": "6f3d2796-c846-4568-a6bb-e04cb4f03539", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "b20e6d9b-cf31-452b-955f-f566c261a389", "type": "text/javascript", "exec": [ "" ] } } ], "_postman_isSubFolder": true } ], "description": "https://developer.twitter.com/en/docs/ads/audiences/overview", "event": [ { "listen": "prerequest", "script": { "id": "61995182-a0bc-4d1b-aeaf-e1bca6133f57", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "36a431f8-d67c-47c5-92df-d28150b9f608", "type": "text/javascript", "exec": [ "" ] } } ] }, { "name": "Campaign Management", "item": [ { "name": "Accounts", "item": [ { "name": "accounts", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts" ], "query": [ { "key": "account_ids", "value": "", "description": "optional", "disabled": true }, { "key": "count", "value": "", "description": "optional", "disabled": true }, { "key": "cursor", "value": "", "description": "optional", "disabled": true }, { "key": "q", "value": "", "description": "optional", "disabled": true }, { "key": "sort_by", "value": "", "description": "optional", "disabled": true }, { "key": "with_deleted", "value": "", "description": "optional", "disabled": true }, { "key": "with_total_count", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "accounts/:account_id", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}" ], "query": [ { "key": "with_deleted", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "accounts", "request": { "method": "POST", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts" ] } }, "response": [] }, { "name": "accounts/:account_id", "request": { "method": "PUT", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}" ], "query": [ { "key": "name", "value": "", "description": "optional", "disabled": true }, { "key": "industry_type", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "accounts/:account_id", "request": { "method": "DELETE", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}" ] } }, "response": [] } ], "description": "https://developer.twitter.com/en/docs/ads/campaign-management/api-reference/accounts", "event": [ { "listen": "prerequest", "script": { "id": "bd0cba57-6384-4133-bd34-29c3cfe4f834", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "36068e61-8414-4e00-af3d-3c7f7eadf73b", "type": "text/javascript", "exec": [ "" ] } } ], "_postman_isSubFolder": true }, { "name": "Authenticated User Access", "item": [ { "name": "accounts/:account_id/authenticated_user_access", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/authenticated_user_access", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "authenticated_user_access" ] } }, "response": [] } ], "description": "https://developer.twitter.com/en/docs/ads/campaign-management/api-reference/authenticated-user-access", "event": [ { "listen": "prerequest", "script": { "id": "7b3928ac-d691-4316-b9e6-ffadaf3c2de7", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "e159e03b-8e0c-4eae-8154-fc627972ed14", "type": "text/javascript", "exec": [ "" ] } } ], "_postman_isSubFolder": true }, { "name": "Bidding Rules", "item": [ { "name": "bidding_rules", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/bidding_rules?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "bidding_rules" ], "query": [ { "key": "currency", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] } ], "description": "https://developer.twitter.com/en/docs/ads/campaign-management/api-reference/bidding-rules", "event": [ { "listen": "prerequest", "script": { "id": "ecee7ba4-2626-4a90-bf74-326f6a3132ed", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "0d44b98a-a80e-4e49-a5fb-88682fb5c9f4", "type": "text/javascript", "exec": [ "" ] } } ], "_postman_isSubFolder": true }, { "name": "Campaigns", "item": [ { "name": "accounts/:account_id/campaigns", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/campaigns?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "campaigns" ], "query": [ { "key": "campaign_ids", "value": "", "description": "optional", "disabled": true }, { "key": "count", "value": "", "description": "optional", "disabled": true }, { "key": "cursor", "value": "", "description": "optional", "disabled": true }, { "key": "funding_instrument_ids", "value": "", "description": "optional", "disabled": true }, { "key": "q", "value": "", "description": "optional", "disabled": true }, { "key": "sort_by", "value": "", "description": "optional", "disabled": true }, { "key": "with_deleted", "value": "", "description": "optional", "disabled": true }, { "key": "with_draft", "value": "", "description": "optional", "disabled": true }, { "key": "with_total_count", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "accounts/:account_id/campaigns/:campaign_id", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/campaigns/:campaign_id?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "campaigns", ":campaign_id" ], "query": [ { "key": "with_deleted", "value": "", "description": "optional", "disabled": true } ], "variable": [ { "id": "aa228a00-5091-45f5-988f-ff4922614b5d", "key": "campaign_id", "type": "any" } ] } }, "response": [] }, { "name": "accounts/:account_id/campaigns", "request": { "method": "POST", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/campaigns?funding_instrument_id=&name=&start_time=", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "campaigns" ], "query": [ { "key": "funding_instrument_id", "value": "", "description": "required" }, { "key": "name", "value": "", "description": "required" }, { "key": "start_time", "value": "", "description": "required" }, { "key": "daily_budget_amount_local_micro", "value": "", "description": "optional", "disabled": true }, { "key": "duration_in_days", "value": "", "description": "optional", "disabled": true }, { "key": "end_time", "value": "", "description": "optional", "disabled": true }, { "key": "entity_status", "value": "", "description": "optional", "disabled": true }, { "key": "frequency_cap", "value": "", "description": "optional", "disabled": true }, { "key": "standard_delivery", "value": "", "description": "optional", "disabled": true }, { "key": "total_budget_amount_local_micro", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "batch/accounts/:account_id/campaigns", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json" } ], "url": { "raw": "https://ads-api.twitter.com/{{version}}/batch/accounts/{{account_id}}/campaigns?operation_type=¶ms=", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "batch", "accounts", "{{account_id}}", "campaigns" ], "query": [ { "key": "operation_type", "value": "", "description": "required" }, { "key": "params", "value": "", "description": "required" } ] } }, "response": [] }, { "name": "accounts/:account_id/campaigns/:campaign_id", "request": { "method": "PUT", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/campaigns/:campaign_id?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "campaigns", ":campaign_id" ], "query": [ { "key": "daily_budget_amount_local_micro", "value": "", "description": "optional", "disabled": true }, { "key": "end_time", "value": "", "description": "optional", "disabled": true }, { "key": "entity_status", "value": "", "description": "optional", "disabled": true }, { "key": "duration_in_days", "value": "", "description": "optional", "disabled": true }, { "key": "frequency_cap", "value": "", "description": "optional", "disabled": true }, { "key": "name", "value": "", "description": "optional", "disabled": true }, { "key": "standard_delivery", "value": "", "description": "optional", "disabled": true }, { "key": "start_time", "value": "", "description": "optional", "disabled": true }, { "key": "total_budget_amount_local_micro", "value": "", "description": "optional", "disabled": true } ], "variable": [ { "id": "5fac1847-895c-442f-b525-425380c740f6", "key": "campaign_id", "type": "any" } ] } }, "response": [] }, { "name": "accounts/:account_id/campaigns/:campaign_id", "request": { "method": "DELETE", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/campaigns/:campaign_id", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "campaigns", ":campaign_id" ], "variable": [ { "id": "3da9e1cc-e482-434e-99fc-49edcac07997", "key": "campaign_id", "type": "any" } ] } }, "response": [] } ], "description": "https://developer.twitter.com/en/docs/ads/campaign-management/api-reference/campaigns", "event": [ { "listen": "prerequest", "script": { "id": "6013e9f2-9e85-41ce-b5ec-993f7d3a94d7", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "e765082a-637a-464d-a00c-17f618a36056", "type": "text/javascript", "exec": [ "" ] } } ], "_postman_isSubFolder": true }, { "name": "Content Categories", "item": [ { "name": "content_categories", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/content_categories", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "content_categories" ] } }, "response": [] } ], "description": "https://developer.twitter.com/en/docs/ads/campaign-management/api-reference/content-categories", "event": [ { "listen": "prerequest", "script": { "id": "9e926754-b956-4e55-93db-53a275a483d1", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "0be718e5-bd61-4525-8892-c736ab537c4c", "type": "text/javascript", "exec": [ "" ] } } ], "_postman_isSubFolder": true }, { "name": "Features", "item": [ { "name": "accounts/:account_id/features", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/features?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "features" ], "query": [ { "key": "feature_keys", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "accounts/:account_id/features", "request": { "method": "POST", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/features?feature_keys=", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "features" ], "query": [ { "key": "feature_keys", "value": "", "description": "required" } ] } }, "response": [] }, { "name": "accounts/:account_id/features", "request": { "method": "DELETE", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/features?feature_keys=", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "features" ], "query": [ { "key": "feature_keys", "value": "", "description": "required" } ] } }, "response": [] } ], "description": "https://developer.twitter.com/en/docs/ads/campaign-management/api-reference/features", "event": [ { "listen": "prerequest", "script": { "id": "8904f227-5081-405a-ba9e-8e47a109ea1d", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "b30482ee-4690-44e9-a667-9f33cb3999e4", "type": "text/javascript", "exec": [ "" ] } } ], "_postman_isSubFolder": true }, { "name": "Funding Instruments", "item": [ { "name": "accounts/:account_id/funding_instruments", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/funding_instruments?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "funding_instruments" ], "query": [ { "key": "count", "value": "", "description": "optional", "disabled": true }, { "key": "cursor", "value": "", "description": "optional", "disabled": true }, { "key": "funding_instrument_ids", "value": "", "description": "optional", "disabled": true }, { "key": "sort_by", "value": "", "description": "optional", "disabled": true }, { "key": "with_deleted", "value": "", "description": "optional", "disabled": true }, { "key": "with_total_count", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "accounts/:account_id/funding_instruments/:funding_instrument_id", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/funding_instruments/:funding_instrument_id?funding_instrument_id=", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "funding_instruments", ":funding_instrument_id" ], "query": [ { "key": "funding_instrument_id", "value": "", "description": "required" }, { "key": "with_deleted", "value": "", "description": "optional", "disabled": true } ], "variable": [ { "id": "1aa7d603-e82b-475d-89b1-6853db4625e7", "key": "funding_instrument_id", "type": "any" } ] } }, "response": [] }, { "name": "accounts/:account_id/funding_instruments", "request": { "method": "POST", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/funding_instruments?currency=&start_time=&type=", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "funding_instruments" ], "query": [ { "key": "currency", "value": "", "description": "required" }, { "key": "start_time", "value": "", "description": "required" }, { "key": "type", "value": "", "description": "required" }, { "key": "end_time", "value": "", "description": "sometimes required", "disabled": true }, { "key": "credit_limit_local_micro", "value": "", "description": "optional", "disabled": true }, { "key": "funded_amount_local_micro", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "accounts/:account_id/funding_instruments/:funding_instrument_id", "request": { "method": "PUT", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/funding_instruments/:funding_instrument_id?funding_instrument_id=", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "funding_instruments", ":funding_instrument_id" ], "query": [ { "key": "funding_instrument_id", "value": "", "description": "required" }, { "key": "funded_amount_local_micro", "value": "", "description": "optional", "disabled": true }, { "key": "paused", "value": "", "description": "optional", "disabled": true } ], "variable": [ { "id": "9fc9e466-2c7a-48d9-9ed0-8b0e8371ab8b", "key": "funding_instrument_id", "type": "any" } ] } }, "response": [] }, { "name": "accounts/:account_id/funding_instruments/:funding_instrument_id", "request": { "method": "DELETE", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/funding_instruments/:funding_instrument_id?funding_instrument_id=", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "funding_instruments", ":funding_instrument_id" ], "query": [ { "key": "funding_instrument_id", "value": "", "description": "required" } ], "variable": [ { "id": "4c7a6545-731f-4cf6-b22b-726bf9263d41", "key": "funding_instrument_id", "type": "any" } ] } }, "response": [] } ], "description": "https://developer.twitter.com/en/docs/ads/campaign-management/api-reference/funding-instruments", "event": [ { "listen": "prerequest", "script": { "id": "d8a914bd-c32a-485a-8b54-e2bd2497d807", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "de88205b-37ba-4100-a0c4-ebec764696be", "type": "text/javascript", "exec": [ "" ] } } ], "_postman_isSubFolder": true }, { "name": "IAB Categories", "item": [ { "name": "iab_categories", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/iab_categories?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "iab_categories" ], "query": [ { "key": "count", "value": "", "description": "optional", "disabled": true }, { "key": "cursor", "value": "", "description": "optional", "disabled": true }, { "key": "with_total_count", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] } ], "description": "https://developer.twitter.com/en/docs/ads/campaign-management/api-reference/iab-categories", "event": [ { "listen": "prerequest", "script": { "id": "8c1c7101-46be-4bbc-8384-4fb90c7c715c", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "f9f3e8b6-8e8e-4032-8e6b-c6b689b32da3", "type": "text/javascript", "exec": [ "" ] } } ], "_postman_isSubFolder": true }, { "name": "Line Items", "item": [ { "name": "accounts/:account_id/line_items", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/line_items?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "line_items" ], "query": [ { "key": "campaign_ids", "value": "", "description": "optional", "disabled": true }, { "key": "count", "value": "", "description": "optional", "disabled": true }, { "key": "cursor", "value": "", "description": "optional", "disabled": true }, { "key": "funding_instrument_ids", "value": "", "description": "optional", "disabled": true }, { "key": "line_item_ids", "value": "", "description": "optional", "disabled": true }, { "key": "q", "value": "", "description": "optional", "disabled": true }, { "key": "sort_by", "value": "", "description": "optional", "disabled": true }, { "key": "with_deleted", "value": "", "description": "optional", "disabled": true }, { "key": "with_draft", "value": "", "description": "optional", "disabled": true }, { "key": "with_total_count", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "accounts/:account_id/line_items/:line_item_id", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/line_items/:line_item_id?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "line_items", ":line_item_id" ], "query": [ { "key": "with_deleted", "value": "", "description": "optional", "disabled": true } ], "variable": [ { "id": "56a0866b-6d3e-4c88-96aa-1f5624562c6d", "key": "line_item_id", "type": "any" } ] } }, "response": [] }, { "name": "accounts/:account_id/line_items", "request": { "method": "POST", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/line_items?campaign_id=&objective=&placements=&product_type=", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "line_items" ], "query": [ { "key": "campaign_id", "value": "", "description": "required" }, { "key": "objective", "value": "", "description": "required" }, { "key": "placements", "value": "", "description": "required" }, { "key": "product_type", "value": "", "description": "required" }, { "key": "advertiser_domain", "value": "", "description": "sometimes required", "disabled": true }, { "key": "bid_amount_local_micro", "value": "", "description": "sometimes required", "disabled": true }, { "key": "categories", "value": "", "description": "sometimes required", "disabled": true }, { "key": "primary_web_event_tag", "value": "", "description": "sometimes required", "disabled": true }, { "key": "advertiser_user_id", "value": "", "description": "optional", "disabled": true }, { "key": "automatically_select_bid", "value": "", "description": "optional", "disabled": true }, { "key": "bid_type", "value": "", "description": "optional", "disabled": true }, { "key": "bid_unit", "value": "", "description": "optional", "disabled": true }, { "key": "charge_by", "value": "", "description": "optional", "disabled": true }, { "key": "end_time", "value": "", "description": "optional", "disabled": true }, { "key": "entity_status", "value": "", "description": "optional", "disabled": true }, { "key": "include_sentiment", "value": "", "description": "optional", "disabled": true }, { "key": "audience_expansion", "value": "", "description": "optional", "disabled": true }, { "key": "name", "value": "", "description": "optional", "disabled": true }, { "key": "optimization", "value": "", "description": "optional", "disabled": true }, { "key": "start_time", "value": "", "description": "optional", "disabled": true }, { "key": "total_budget_amount_local_micro", "value": "", "description": "optional", "disabled": true }, { "key": "tracking_tags", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "batch/accounts/:account_id/line_items", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json" } ], "url": { "raw": "https://ads-api.twitter.com/{{version}}/batch/accounts/{{account_id}}/line_items?operation_type=¶ms=", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "batch", "accounts", "{{account_id}}", "line_items" ], "query": [ { "key": "operation_type", "value": "", "description": "required" }, { "key": "params", "value": "", "description": "required" } ] } }, "response": [] }, { "name": "accounts/:account_id/line_items/:line_item_id", "request": { "method": "PUT", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/line_items/:line_item_id?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "line_items", ":line_item_id" ], "query": [ { "key": "advertiser_domain", "value": "", "description": "optional", "disabled": true }, { "key": "advertiser_user_id", "value": "", "description": "optional", "disabled": true }, { "key": "automatically_select_bid", "value": "", "description": "optional", "disabled": true }, { "key": "bid_amount_local_micro", "value": "", "description": "optional", "disabled": true }, { "key": "bid_type", "value": "", "description": "optional", "disabled": true }, { "key": "categories", "value": "", "description": "optional", "disabled": true }, { "key": "end_time", "value": "", "description": "optional", "disabled": true }, { "key": "entity_status", "value": "", "description": "optional", "disabled": true }, { "key": "include_sentiment", "value": "", "description": "optional", "disabled": true }, { "key": "audience_expansion", "value": "", "description": "optional", "disabled": true }, { "key": "name", "value": "", "description": "optional", "disabled": true }, { "key": "optimization", "value": "", "description": "optional", "disabled": true }, { "key": "start_time", "value": "", "description": "optional", "disabled": true }, { "key": "total_budget_amount_local_micro", "value": "", "description": "optional", "disabled": true }, { "key": "tracking_tags", "value": "", "description": "optional", "disabled": true } ], "variable": [ { "id": "3bd239ae-6dbb-4504-aef5-7fbd9054b52e", "key": "line_item_id", "type": "any" } ] } }, "response": [] }, { "name": "accounts/:account_id/line_items/:line_item_id", "request": { "method": "DELETE", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/line_items/:line_item_id", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "line_items", ":line_item_id" ], "variable": [ { "id": "ef49532b-f577-4ca6-abb4-4a9a5400a0ca", "key": "line_item_id", "type": "any" } ] } }, "response": [] } ], "description": "https://developer.twitter.com/en/docs/ads/campaign-management/api-reference/line-items", "event": [ { "listen": "prerequest", "script": { "id": "2b84d1c8-8a87-45ac-a1d8-5e759d038aef", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "a8dea8e6-fecb-41c0-acb4-98f7fb46f986", "type": "text/javascript", "exec": [ "" ] } } ], "_postman_isSubFolder": true }, { "name": "Line Item Apps", "item": [ { "name": "accounts/:account_id/line_item_apps", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/line_item_apps?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "line_item_apps" ], "query": [ { "key": "count", "value": "", "description": "optional", "disabled": true }, { "key": "cursor", "value": "", "description": "optional", "disabled": true }, { "key": "line_item_ids", "value": "", "description": "optional", "disabled": true }, { "key": "line_item_app_ids", "value": "", "description": "optional", "disabled": true }, { "key": "sort_by", "value": "", "description": "optional", "disabled": true }, { "key": "with_deleted", "value": "", "description": "optional", "disabled": true }, { "key": "with_total_count", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "accounts/:account_id/line_item_apps/:line_item_app_id", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/line_item_apps/:line_item_app_id?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "line_item_apps", ":line_item_app_id" ], "query": [ { "key": "with_deleted", "value": "", "description": "optional", "disabled": true } ], "variable": [ { "id": "05d74ab8-2d0b-4056-814e-0dd8d809e7d8", "key": "line_item_app_id", "type": "any" } ] } }, "response": [] }, { "name": "accounts/:account_id/line_item_apps", "request": { "method": "POST", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/line_item_apps?app_store_identifier=&line_item_id=&os_type=", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "line_item_apps" ], "query": [ { "key": "app_store_identifier", "value": "", "description": "required" }, { "key": "line_item_id", "value": "", "description": "required" }, { "key": "os_type", "value": "", "description": "required" } ] } }, "response": [] }, { "name": "accounts/:account_id/line_item_apps/:line_item_app_id", "request": { "method": "DELETE", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/line_item_apps/:line_item_app_id", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "line_item_apps", ":line_item_app_id" ], "variable": [ { "id": "5f4d4177-b6db-4767-bd81-e445206f02ee", "key": "line_item_app_id", "type": "any" } ] } }, "response": [] } ], "description": "https://developer.twitter.com/en/docs/ads/campaign-management/api-reference/line-item-apps", "event": [ { "listen": "prerequest", "script": { "id": "623aa941-68b7-48be-8677-7972c55a58a8", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "25675546-99e9-4171-8521-b2fd79d24213", "type": "text/javascript", "exec": [ "" ] } } ], "_postman_isSubFolder": true }, { "name": "Line Item Placements", "item": [ { "name": "line_items/placements", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/line_items/placements?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "line_items", "placements" ], "query": [ { "key": "product_type", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] } ], "description": "https://developer.twitter.com/en/docs/ads/campaign-management/api-reference/line-item-placements", "event": [ { "listen": "prerequest", "script": { "id": "32d71391-f96b-4a74-8e38-5903b0ce1743", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "3d9011f3-9aae-4ac0-b2ba-511dd9548de9", "type": "text/javascript", "exec": [ "" ] } } ], "_postman_isSubFolder": true }, { "name": "Media Creatives", "item": [ { "name": "accounts/:account_id/media_creatives", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/media_creatives?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "media_creatives" ], "query": [ { "key": "campaign_id", "value": "", "description": "optional", "disabled": true }, { "key": "count", "value": "", "description": "optional", "disabled": true }, { "key": "cursor", "value": "", "description": "optional", "disabled": true }, { "key": "line_item_ids", "value": "", "description": "optional", "disabled": true }, { "key": "media_creative_ids", "value": "", "description": "optional", "disabled": true }, { "key": "sort_by", "value": "", "description": "optional", "disabled": true }, { "key": "with_deleted", "value": "", "description": "optional", "disabled": true }, { "key": "with_total_count", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "accounts/:account_id/media_creatives/:media_creative_id", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/media_creatives/:media_creative_id?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "media_creatives", ":media_creative_id" ], "query": [ { "key": "with_deleted", "value": "", "description": "optional", "disabled": true } ], "variable": [ { "id": "5e27dce1-2e2c-4f75-b2a3-d22124a62b48", "key": "media_creative_id", "type": "any" } ] } }, "response": [] }, { "name": "accounts/:account_id/media_creatives", "request": { "method": "POST", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/media_creatives?account_id&account_media_id&line_item_id", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "media_creatives" ], "query": [ { "key": "account_id", "value": "", "description": "required" }, { "key": "account_media_id", "value": "", "description": "required" }, { "key": "line_item_id", "value": "", "description": "required" }, { "key": "landing_url", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "accounts/:account_id/media_creatives/:media_creative_id", "request": { "method": "DELETE", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/media_creatives/:media_creative_id", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "media_creatives", ":media_creative_id" ], "variable": [ { "id": "0092682b-7043-4588-b8c1-1b26d5bdf343", "key": "media_creative_id", "type": "any" } ] } }, "response": [] } ], "description": "https://developer.twitter.com/en/docs/ads/campaign-management/api-reference/media-creatives", "event": [ { "listen": "prerequest", "script": { "id": "295b8dbd-93ca-4b18-ae39-1a97fe05c4c6", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "ec8f7617-7d86-4394-a616-b18763d036eb", "type": "text/javascript", "exec": [ "" ] } } ], "_postman_isSubFolder": true }, { "name": "Promoted Accounts", "item": [ { "name": "accounts/:account_id/promoted_accounts", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/promoted_accounts?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "promoted_accounts" ], "query": [ { "key": "count", "value": "", "description": "optional", "disabled": true }, { "key": "cursor", "value": "", "description": "optional", "disabled": true }, { "key": "line_item_ids", "value": "", "description": "optional", "disabled": true }, { "key": "promoted_account_ids", "value": "", "description": "optional", "disabled": true }, { "key": "sort_by", "value": "", "description": "optional", "disabled": true }, { "key": "with_deleted", "value": "", "description": "optional", "disabled": true }, { "key": "with_total_count", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "accounts/:account_id/promoted_accounts/:promoted_account_id", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/promoted_accounts/:promoted_account_id?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "promoted_accounts", ":promoted_account_id" ], "query": [ { "key": "with_deleted", "value": "", "description": "optional", "disabled": true } ], "variable": [ { "id": "99b463c3-6159-4a90-ab3d-f27d11b2f85e", "key": "promoted_account_id", "type": "any" } ] } }, "response": [] }, { "name": "accounts/:account_id/promoted_accounts", "request": { "method": "POST", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/promoted_accounts?line_item_id=&user_id=", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "promoted_accounts" ], "query": [ { "key": "line_item_id", "value": "", "description": "required" }, { "key": "user_id", "value": "", "description": "required" } ] } }, "response": [] }, { "name": "accounts/:account_id/promoted_accounts/:promoted_account_id", "request": { "method": "DELETE", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/promoted_accounts/:promoted_account_id", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "promoted_accounts", ":promoted_account_id" ], "variable": [ { "id": "7a7eba72-d749-40a2-a70b-440d9f8ef26c", "key": "promoted_account_id", "type": "any" } ] } }, "response": [] } ], "description": "https://developer.twitter.com/en/docs/ads/campaign-management/api-reference/promoted-accounts", "event": [ { "listen": "prerequest", "script": { "id": "14587d34-cf17-4cc9-b6cf-b139cb83ca24", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "8262fdd8-fcee-4702-a0be-8145ef56ee48", "type": "text/javascript", "exec": [ "" ] } } ], "_postman_isSubFolder": true }, { "name": "Promoted Tweets", "item": [ { "name": "accounts/:account_id/promoted_tweets", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/promoted_tweets?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "promoted_tweets" ], "query": [ { "key": "count", "value": "", "description": "optional", "disabled": true }, { "key": "cursor", "value": "", "description": "optional", "disabled": true }, { "key": "line_item_ids", "value": "", "description": "optional", "disabled": true }, { "key": "promoted_tweet_ids", "value": "", "description": "optional", "disabled": true }, { "key": "sort_by", "value": "", "description": "optional", "disabled": true }, { "key": "with_deleted", "value": "", "description": "optional", "disabled": true }, { "key": "with_total_count", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "accounts/:account_id/promoted_tweets/:promoted_tweet_id", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/promoted_tweets/:promoted_tweet_id?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "promoted_tweets", ":promoted_tweet_id" ], "query": [ { "key": "with_deleted", "value": "", "description": "optional", "disabled": true } ], "variable": [ { "id": "f0d8e346-d722-451c-af8b-fa1d0fd9e003", "key": "promoted_tweet_id", "type": "any" } ] } }, "response": [] }, { "name": "accounts/:account_id/promoted_tweets", "request": { "method": "POST", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/promoted_tweets?line_item_id=&tweet_ids=", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "promoted_tweets" ], "query": [ { "key": "line_item_id", "value": "", "description": "required" }, { "key": "tweet_ids", "value": "", "description": "required" } ] } }, "response": [] }, { "name": "accounts/:account_id/promoted_tweets/:promoted_tweet_id", "request": { "method": "DELETE", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/promoted_tweets/:promoted_tweet_id", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "promoted_tweets", ":promoted_tweet_id" ], "variable": [ { "id": "0a1a0f3e-e25f-497a-9668-8ffd9178acd9", "key": "promoted_tweet_id", "type": "any" } ] } }, "response": [] } ], "description": "https://developer.twitter.com/en/docs/ads/campaign-management/api-reference/promoted-tweets", "event": [ { "listen": "prerequest", "script": { "id": "1b9e54ae-4019-4f0d-b38f-359686583fe1", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "54af7fe0-4a14-4f1f-9d8c-55608a0b8547", "type": "text/javascript", "exec": [ "" ] } } ], "_postman_isSubFolder": true }, { "name": "Promotable Users", "item": [ { "name": "accounts/:account_id/promotable_users", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/promotable_users?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "promotable_users" ], "query": [ { "key": "count", "value": "", "description": "optional", "disabled": true }, { "key": "cursor", "value": "", "description": "optional", "disabled": true }, { "key": "promotable_user_ids", "value": "", "description": "optional", "disabled": true }, { "key": "sort_by", "value": "", "description": "optional", "disabled": true }, { "key": "with_deleted", "value": "", "description": "optional", "disabled": true }, { "key": "with_total_count", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "accounts/:account_id/promotable_users/:promotable_user_id", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/promotable_users/:promotable_user_id?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "promotable_users", ":promotable_user_id" ], "query": [ { "key": "promotable_user_id", "value": "", "description": "optional", "disabled": true }, { "key": "with_deleted", "value": "", "description": "optional", "disabled": true } ], "variable": [ { "id": "0fb24af7-d830-463a-80a0-57e2b1591628", "key": "promotable_user_id", "type": "any" } ] } }, "response": [] } ], "description": "https://developer.twitter.com/en/docs/ads/campaign-management/api-reference/promotable-users", "event": [ { "listen": "prerequest", "script": { "id": "5d2ad062-8c9d-46ac-9670-eec004b91f37", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "797aa2da-948c-4a75-81e0-ad65d3cedb82", "type": "text/javascript", "exec": [ "" ] } } ], "_postman_isSubFolder": true }, { "name": "Scheduled Promoted Tweets", "item": [ { "name": "accounts/:account_id/scheduled_promoted_tweets", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/scheduled_promoted_tweets?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "scheduled_promoted_tweets" ], "query": [ { "key": "count", "value": "", "description": "optional", "disabled": true }, { "key": "cursor", "value": "", "description": "optional", "disabled": true }, { "key": "line_item_ids", "value": "", "description": "optional", "disabled": true }, { "key": "scheduled_promoted_tweet_ids", "value": "", "description": "optional", "disabled": true }, { "key": "sort_by", "value": "", "description": "optional", "disabled": true }, { "key": "with_deleted", "value": "", "description": "optional", "disabled": true }, { "key": "with_total_count", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "accounts/:account_id/scheduled_promoted_tweets/:scheduled_promoted_tweet_id", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/scheduled_promoted_tweets/:scheduled_promoted_tweet_id?scheduled_promoted_tweet_id=", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "scheduled_promoted_tweets", ":scheduled_promoted_tweet_id" ], "query": [ { "key": "scheduled_promoted_tweet_id", "value": "", "description": "required" }, { "key": "with_deleted", "value": "", "description": "optional", "disabled": true } ], "variable": [ { "id": "635f0b55-fb1a-45e5-a792-5f7b8a01b874", "key": "scheduled_promoted_tweet_id", "type": "any" } ] } }, "response": [] }, { "name": "accounts/:account_id/scheduled_promoted_tweets", "request": { "method": "POST", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/scheduled_promoted_tweets?line_item_id=&scheduled_tweet_id=", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "scheduled_promoted_tweets" ], "query": [ { "key": "line_item_id", "value": "", "description": "required" }, { "key": "scheduled_tweet_id", "value": "", "description": "required" } ] } }, "response": [] }, { "name": "accounts/:account_id/scheduled_promoted_tweets/:scheduled_promoted_tweet_id", "request": { "method": "DELETE", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/scheduled_promoted_tweets/:scheduled_promoted_tweet_id?scheduled_promoted_tweet_id=", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "scheduled_promoted_tweets", ":scheduled_promoted_tweet_id" ], "query": [ { "key": "scheduled_promoted_tweet_id", "value": "", "description": "required" } ], "variable": [ { "id": "fa718ef7-7b4b-4999-b96f-e3a538411544", "key": "scheduled_promoted_tweet_id", "type": "any" } ] } }, "response": [] } ], "description": "https://developer.twitter.com/en/docs/ads/campaign-management/api-reference/scheduled-promoted-tweets", "event": [ { "listen": "prerequest", "script": { "id": "1b65f5c0-a8cf-4aa0-a05e-91058e33503c", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "179b220b-73d6-41ac-b83c-ba88290f36d3", "type": "text/javascript", "exec": [ "" ] } } ], "_postman_isSubFolder": true }, { "name": "Targeting Criteria", "item": [ { "name": "accounts/:account_id/targeting_criteria", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/targeting_criteria?line_item_ids=", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "targeting_criteria" ], "query": [ { "key": "line_item_ids", "value": "", "description": "required" }, { "key": "count", "value": "", "description": "optional", "disabled": true }, { "key": "cursor", "value": "", "description": "optional", "disabled": true }, { "key": "lang", "value": "", "description": "optional", "disabled": true }, { "key": "sort_by", "value": "", "description": "optional", "disabled": true }, { "key": "targeting_criterion_ids", "value": "", "description": "optional", "disabled": true }, { "key": "with_deleted", "value": "", "description": "optional", "disabled": true }, { "key": "with_total_count", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "accounts/:account_id/targeting_criteria/:targeting_criterion_id", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/targeting_criteria/:targeting_criterion_id?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "targeting_criteria", ":targeting_criterion_id" ], "query": [ { "key": "lang", "value": "", "description": "optional", "disabled": true }, { "key": "with_deleted", "value": "", "description": "optional", "disabled": true } ], "variable": [ { "id": "f2a7e86b-b8b8-49c9-81b7-2c24753f6983", "key": "targeting_criterion_id", "type": "any" } ] } }, "response": [] }, { "name": "accounts/:account_id/targeting_criteria", "request": { "method": "POST", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/targeting_criteria?line_item_id=&targeting_type=&targeting_value=", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "targeting_criteria" ], "query": [ { "key": "line_item_id", "value": "", "description": "required" }, { "key": "targeting_type", "value": "", "description": "required" }, { "key": "targeting_value", "value": "", "description": "required" }, { "key": "tailored_audience_expansion", "value": "", "description": "optional", "disabled": true }, { "key": "operator_type", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "batch/accounts/:account_id/targeting_criteria", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json" } ], "url": { "raw": "https://ads-api.twitter.com/{{version}}/batch/accounts/{{account_id}}/targeting_criteria?operation_type=¶ms=", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "batch", "accounts", "{{account_id}}", "targeting_criteria" ], "query": [ { "key": "operation_type", "value": "", "description": "required" }, { "key": "params", "value": "", "description": "required" } ] } }, "response": [] }, { "name": "accounts/:account_id/targeting_criteria/:targeting_criterion_id", "request": { "method": "DELETE", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/targeting_criteria/:targeting_criterion_id", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "targeting_criteria", ":targeting_criterion_id" ], "variable": [ { "id": "0e6f4675-2a40-4a91-ad81-0694e174aad4", "key": "targeting_criterion_id", "type": "any" } ] } }, "response": [] } ], "description": "https://developer.twitter.com/en/docs/ads/campaign-management/api-reference/targeting-criteria", "event": [ { "listen": "prerequest", "script": { "id": "f7980282-668d-44fe-b02d-8af22c5b7a82", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "f8359548-2df6-44df-8d23-0f9d3593d2fc", "type": "text/javascript", "exec": [ "" ] } } ], "_postman_isSubFolder": true }, { "name": "Targeting Options", "item": [ { "name": "targeting_criteria/app_store_categories", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/targeting_criteria/app_store_categories?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "targeting_criteria", "app_store_categories" ], "query": [ { "key": "q", "value": "", "description": "optional", "disabled": true }, { "key": "os_type", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "targeting_criteria/behavior_taxonomies", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/targeting_criteria/behavior_taxonomies?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "targeting_criteria", "behavior_taxonomies" ], "query": [ { "key": "count", "value": "", "description": "optional", "disabled": true }, { "key": "cursor", "value": "", "description": "optional", "disabled": true }, { "key": "parent_behavior_taxonomy_ids", "value": "", "description": "optional", "disabled": true }, { "key": "sort_by", "value": "", "description": "optional", "disabled": true }, { "key": "with_total_count", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "targeting_criteria/behaviors", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/targeting_criteria/behaviors?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "targeting_criteria", "behaviors" ], "query": [ { "key": "count", "value": "", "description": "optional", "disabled": true }, { "key": "country_code", "value": "", "description": "optional", "disabled": true }, { "key": "cursor", "value": "", "description": "optional", "disabled": true }, { "key": "sort_by", "value": "", "description": "optional", "disabled": true }, { "key": "with_total_count", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "targeting_criteria/conversations", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/targeting_criteria/conversations?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "targeting_criteria", "conversations" ], "query": [ { "key": "conversation_type", "value": "", "description": "optional", "disabled": true }, { "key": "count", "value": "", "description": "optional", "disabled": true }, { "key": "cursor", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "targeting_criteria/devices", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/targeting_criteria/devices?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "targeting_criteria", "devices" ], "query": [ { "key": "count", "value": "", "description": "optional", "disabled": true }, { "key": "q", "value": "", "description": "optional", "disabled": true }, { "key": "os_type", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "targeting_criteria/events", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/targeting_criteria/events?event_types=", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "targeting_criteria", "events" ], "query": [ { "key": "event_types", "value": "", "description": "required" }, { "key": "count", "value": "", "description": "optional", "disabled": true }, { "key": "country_codes", "value": "", "description": "optional", "disabled": true }, { "key": "cursor", "value": "", "description": "optional", "disabled": true }, { "key": "end_time", "value": "", "description": "optional", "disabled": true }, { "key": "start_time", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "targeting_criteria/interests", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/targeting_criteria/interests?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "targeting_criteria", "interests" ], "query": [ { "key": "count", "value": "", "description": "optional", "disabled": true }, { "key": "cursor", "value": "", "description": "optional", "disabled": true }, { "key": "q", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "targeting_criteria/languages", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/targeting_criteria/languages?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "targeting_criteria", "languages" ], "query": [ { "key": "count", "value": "", "description": "optional", "disabled": true }, { "key": "cursor", "value": "", "description": "optional", "disabled": true }, { "key": "q", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "targeting_criteria/locations", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/targeting_criteria/locations?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "targeting_criteria", "locations" ], "query": [ { "key": "count", "value": "", "description": "optional", "disabled": true }, { "key": "country_code", "value": "", "description": "optional", "disabled": true }, { "key": "cursor", "value": "", "description": "optional", "disabled": true }, { "key": "location_type", "value": "", "description": "optional", "disabled": true }, { "key": "q", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "targeting_criteria/network_operators", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/targeting_criteria/network_operators?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "targeting_criteria", "network_operators" ], "query": [ { "key": "count", "value": "", "description": "optional", "disabled": true }, { "key": "country_code", "value": "", "description": "optional", "disabled": true }, { "key": "cursor", "value": "", "description": "optional", "disabled": true }, { "key": "q", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "targeting_criteria/platform_versions", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/targeting_criteria/platform_versions?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "targeting_criteria", "platform_versions" ], "query": [ { "key": "q", "value": "", "description": "optional", "disabled": true }, { "key": "os_type", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "targeting_criteria/platforms", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/targeting_criteria/platforms?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "targeting_criteria", "platforms" ], "query": [ { "key": "count", "value": "", "description": "optional", "disabled": true }, { "key": "q", "value": "", "description": "optional", "disabled": true }, { "key": "lang", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "targeting_criteria/tv_markets", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/targeting_criteria/tv_markets", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "targeting_criteria", "tv_markets" ] } }, "response": [] }, { "name": "targeting_criteria/tv_shows", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/targeting_criteria/tv_shows?locale=", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "targeting_criteria", "tv_shows" ], "query": [ { "key": "locale", "value": "", "description": "required" }, { "key": "count", "value": "", "description": "optional", "disabled": true }, { "key": "cursor", "value": "", "description": "optional", "disabled": true }, { "key": "q", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] } ], "description": "https://developer.twitter.com/en/docs/ads/campaign-management/api-reference/targeting-options", "event": [ { "listen": "prerequest", "script": { "id": "e6c1a4c2-4ceb-462d-a87b-3ea32a9bbae3", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "6963fe1f-746d-4665-a435-10ed75214cf1", "type": "text/javascript", "exec": [ "" ] } } ], "_postman_isSubFolder": true }, { "name": "Targeting Suggestions", "item": [ { "name": "accounts/:account_id/targeting_suggestions", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/targeting_suggestions?suggestion_type=&targeting_values=", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "targeting_suggestions" ], "query": [ { "key": "suggestion_type", "value": "", "description": "required" }, { "key": "targeting_values", "value": "", "description": "required" }, { "key": "count", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] } ], "description": "https://developer.twitter.com/en/docs/ads/campaign-management/api-reference/targeting-suggestions", "event": [ { "listen": "prerequest", "script": { "id": "a12460fe-57b4-4752-add7-e7120876f2a6", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "17f727ad-e64b-4c36-84c9-cf167fa98c00", "type": "text/javascript", "exec": [ "" ] } } ], "_postman_isSubFolder": true }, { "name": "Tax Settings", "item": [ { "name": "accounts/:account_id/tax_settings", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/tax_settings", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "tax_settings" ] } }, "response": [] }, { "name": "accounts/:account_id/tax_settings", "request": { "method": "PUT", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/tax_settings?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "tax_settings" ], "query": [ { "key": "address_city", "value": "", "description": "optional", "disabled": true }, { "key": "address_country", "value": "", "description": "optional", "disabled": true }, { "key": "address_email", "value": "", "description": "optional", "disabled": true }, { "key": "address_first_name", "value": "", "description": "optional", "disabled": true }, { "key": "address_last_name", "value": "", "description": "optional", "disabled": true }, { "key": "address_name", "value": "", "description": "optional", "disabled": true }, { "key": "address_postal_code", "value": "", "description": "optional", "disabled": true }, { "key": "address_region", "value": "", "description": "optional", "disabled": true }, { "key": "address_street1", "value": "", "description": "optional", "disabled": true }, { "key": "address_street2", "value": "", "description": "optional", "disabled": true }, { "key": "bill_to", "value": "", "description": "optional", "disabled": true }, { "key": "business_relationship", "value": "", "description": "optional", "disabled": true }, { "key": "client_address_city", "value": "", "description": "optional", "disabled": true }, { "key": "client_address_country", "value": "", "description": "optional", "disabled": true }, { "key": "client_address_email", "value": "", "description": "optional", "disabled": true }, { "key": "client_address_first_name", "value": "", "description": "optional", "disabled": true }, { "key": "client_address_last_name", "value": "", "description": "optional", "disabled": true }, { "key": "client_address_name", "value": "", "description": "optional", "disabled": true }, { "key": "client_address_postal_code", "value": "", "description": "optional", "disabled": true }, { "key": "client_address_region", "value": "", "description": "optional", "disabled": true }, { "key": "client_address_street1", "value": "", "description": "optional", "disabled": true }, { "key": "client_address_street2", "value": "", "description": "optional", "disabled": true }, { "key": "invoice_jurisdiction", "value": "", "description": "optional", "disabled": true }, { "key": "tax_category", "value": "", "description": "optional", "disabled": true }, { "key": "tax_exemption_id", "value": "", "description": "optional", "disabled": true }, { "key": "tax_id", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] } ], "description": "https://developer.twitter.com/en/docs/ads/campaign-management/api-reference/tax-settings", "event": [ { "listen": "prerequest", "script": { "id": "512b87f9-ff11-4eee-ac69-240cdca1ad3c", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "a2f44add-abe9-4725-9af3-6d958c96fb35", "type": "text/javascript", "exec": [ "" ] } } ], "_postman_isSubFolder": true }, { "name": "User Settings", "item": [ { "name": "accounts/:account_id/user_settings/:user_id", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/user_settings/:user_id?user_id=", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "user_settings", ":user_id" ], "query": [ { "key": "user_id", "value": "", "description": "required" } ], "variable": [ { "id": "6da511c1-bfb6-48ec-ae84-f8056c006761", "key": "user_id", "type": "any" } ] } }, "response": [] }, { "name": "accounts/:account_id/user_settings/:user_id", "request": { "method": "PUT", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/user_settings/:user_id?user_id=", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "user_settings", ":user_id" ], "query": [ { "key": "user_id", "value": "", "description": "required" }, { "key": "notification_email", "value": "", "description": "optional", "disabled": true }, { "key": "contact_phone", "value": "", "description": "optional", "disabled": true }, { "key": "contact_phone_extension", "value": "", "description": "optional", "disabled": true }, { "key": "subscribed_email_types", "value": "", "description": "optional", "disabled": true } ], "variable": [ { "id": "5caec6d1-6dd5-4e1c-8d62-553a411fb103", "key": "user_id", "type": "any" } ] } }, "response": [] } ], "description": "https://developer.twitter.com/en/docs/ads/campaign-management/api-reference/user-settings", "event": [ { "listen": "prerequest", "script": { "id": "e3b92615-4b49-4197-8d1f-1c68b677edea", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "0ae99a44-7845-4ac2-84f3-0575bfd29a38", "type": "text/javascript", "exec": [ "" ] } } ], "_postman_isSubFolder": true }, { "name": "Advertiser Business Categories", "item": [ { "name": "advertiser_business_categories", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/advertiser_business_categories", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "advertiser_business_categories" ] } }, "response": [] } ], "description": "https://developer.twitter.com/en/docs/ads/campaign-management/api-reference/advertiser-business-categories\n", "event": [ { "listen": "prerequest", "script": { "id": "f13f0485-b3c4-4014-af6d-1660db4a25dc", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "dda9c307-0690-4696-b372-3c3cfff59ac0", "type": "text/javascript", "exec": [ "" ] } } ], "_postman_isSubFolder": true }, { "name": "Audience Summary", "item": [ { "name": "accounts/:account_id/audience_summary", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json", "type": "text" } ], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/audience_summary?targeting_criteria", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "audience_summary" ], "query": [ { "key": "targeting_criteria", "value": "", "description": "required" } ] } }, "response": [] } ], "description": "https://developer.twitter.com/en/docs/ads/campaign-management/api-reference/audience-summary", "_postman_isSubFolder": true } ], "description": "https://developer.twitter.com/en/docs/ads/campaign-management/overview", "event": [ { "listen": "prerequest", "script": { "id": "72c31036-9d42-4a60-885e-348b4a5a2fd7", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "c53318cd-eb1a-4296-afd5-0480a08b1d57", "type": "text/javascript", "exec": [ "" ] } } ] }, { "name": "Creatives", "item": [ { "name": "Account Media", "item": [ { "name": "accounts/:account_id/account_media", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/account_media?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "account_media" ], "query": [ { "key": "account_media_ids", "value": "", "description": "optional", "disabled": true }, { "key": "count", "value": "", "description": "optional", "disabled": true }, { "key": "cursor", "value": "", "description": "optional", "disabled": true }, { "key": "sort_by", "value": "", "description": "optional", "disabled": true }, { "key": "with_deleted", "value": "", "description": "optional", "disabled": true }, { "key": "with_total_count", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "accounts/:account_id/account_media/:account_media_id", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/account_media/:account_media_id?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "account_media", ":account_media_id" ], "query": [ { "key": "with_deleted", "value": "", "description": "optional", "disabled": true } ], "variable": [ { "id": "077e3b75-1807-48ef-a2eb-0ab57b62aeff", "key": "account_media_id", "type": "any" } ] } }, "response": [] }, { "name": "accounts/:account_id/account_media/:account_media_id", "request": { "method": "DELETE", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/account_media/:account_media_id", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "account_media", ":account_media_id" ], "variable": [ { "id": "233f07f1-0478-4076-bd0c-fa8ed325d89d", "key": "account_media_id", "type": "any" } ] } }, "response": [] } ], "description": "https://developer.twitter.com/en/docs/ads/creatives/api-reference/account-media", "event": [ { "listen": "prerequest", "script": { "id": "5895a70f-2c89-4298-80b3-cba5c78f2057", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "c4b08bfd-60a0-4a2a-96c8-d54eb8cc66f2", "type": "text/javascript", "exec": [ "" ] } } ], "_postman_isSubFolder": true }, { "name": "Cards Fetch", "item": [ { "name": "accounts/:account_id/cards/all", "event": [ { "listen": "prerequest", "script": { "id": "465a2689-075f-423c-899d-3a7effafa594", "exec": [ "/*", " * This is a Pre-request script for Postman client to remediate OAuth 1.0a issue", " * where certain request fails if the query parameter includes some specific characters.", " * https://tools.ietf.org/html/rfc3986#section-2.2 (rfc3986, gen-delims reserved characters)", " *", " * NOTE: This Pre-script is intended to use with \"GET\" request but might be able to", " * work with other methods that have no request body.", " * For \"POST\" request, there's another workaround.", " * See: https://github.com/twitterdev/postman-twitter-ads-api/issues/2", " * ", " * In order to use this Pre-request script, you need to change your \"Authorization\" type to", " * \"No Auth\" only for the target request and do not apply to the top-level object.", " */", "", "const sdk = require('postman-collection');", "", "function toArray(object) {", " let array = [];", " Object.keys(object).forEach(key => {", " array.push(`${key}=${object[key]}`);", " });", " return array", "}", "", "// fetch all env variables that are currently defined", "const env_variables = pm.environment.toObject({", " excludeDisabled: true", "});", "", "const oauth_consumer_key = env_variables.consumer_key;", "const oauth_consumer_secret = env_variables.consumer_secret;", "const oauth_token = env_variables.access_token;", "const oauth_secret = env_variables.token_secret;", "const oauth_signing_key = `${oauth_consumer_secret}&${oauth_secret}`;", "", "// create random oauth_nonce string", "const random_source = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';", "var oauth_nonce = '';", "for (var i = 0; i < 32; i++) {", " oauth_nonce += random_source.charAt(Math.floor(Math.random() * random_source.length));", "}", "", "const oauth_parameter_string_object = {};", "oauth_parameter_string_object.oauth_consumer_key = oauth_consumer_key;", "oauth_parameter_string_object.oauth_token = oauth_token;", "const oauth_nonce_array = CryptoJS.enc.Utf8.parse(oauth_nonce);", "oauth_parameter_string_object.oauth_nonce = encodeURIComponent(CryptoJS.enc.Base64.stringify(oauth_nonce_array));", "oauth_parameter_string_object.oauth_signature_method = 'HMAC-SHA1';", "oauth_parameter_string_object.oauth_version = '1.0';", "oauth_parameter_string_object.oauth_timestamp = Math.round((new Date()).getTime() / 1000);", "", "// for Authorization request header (copy object)", "const oauth_authorization_header_object = Object.assign({}, oauth_parameter_string_object);", "", "// convert query string into object (+ encode)", "const url_query_string_object = {};", "", "const url_query_string_object_array = sdk.QueryParam.parse(", " pm.request.url.getQueryString({", " ignoreDisabled: true", " })", ");", "", "url_query_string_object_array.forEach(item => {", " url_query_string_object[item.key] = encodeURIComponent(item.value);", "});", "", "// merge query parameter", "Object.assign(oauth_parameter_string_object, url_query_string_object);", "", "// sort object by key", "const oauth_parameter_string_object_ordered = {};", "Object.keys(oauth_parameter_string_object).sort().forEach(function(key) {", " oauth_parameter_string_object_ordered[key] = oauth_parameter_string_object[key];", "});", "", "// generate parameter string", "const oauth_parameter_string = toArray(oauth_parameter_string_object_ordered).join('&');", "", "// replace dynamic variables", "let base_host = pm.request.url.getOAuth1BaseUrl();", "let regexp = /{{(.*?)}}/g;", "while (result = regexp.exec(base_host)) {", " let value = env_variables[result[1]];", " base_host = base_host.replace(new RegExp(`{{${result[1]}}}`, 'g'), value);", "}", "", "// generate base string", "const oauth_base_string = `${pm.request.method}&${encodeURIComponent(base_host)}&${encodeURIComponent(oauth_parameter_string)}`;", "", "// generate signature", "const oauth_signature = CryptoJS.enc.Base64.stringify(CryptoJS.HmacSHA1(oauth_base_string, oauth_signing_key));", "", "oauth_authorization_header_object.oauth_signature = encodeURIComponent(oauth_signature);", "", "// generate Authorization header string", "const oauth_authorization_header = toArray(oauth_authorization_header_object).join(', ');", "", "// generate Authorization header", "pm.request.headers.add({", " key: 'Authorization',", " value: `OAuth ${oauth_authorization_header}`", "});", "", "// Escape URI parameters using encodeURIComponent => RFC3986", "if (Object.keys(url_query_string_object).length !== 0) {", " // generate query parameter string", " const request_parameter_string = toArray(url_query_string_object).join('&');", "", " pm.request.url = `${pm.request.url.getOAuth1BaseUrl()}?${request_parameter_string}`;", "}" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "noauth" }, "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/cards/all?card_uris=", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "cards", "all" ], "query": [ { "key": "card_uris", "value": "", "description": "required" }, { "key": "with_deleted", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "accounts/:account_id/cards/all/:card_id", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/cards/all/:card_id?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "cards", "all", ":card_id" ], "query": [ { "key": "with_deleted", "value": "", "description": "optional", "disabled": true } ], "variable": [ { "id": "647fc424-3a77-4765-9934-6936f97b9688", "key": "card_id", "type": "any" } ] } }, "response": [] } ], "description": "https://developer.twitter.com/en/docs/ads/creatives/api-reference/cards-fetch", "event": [ { "listen": "prerequest", "script": { "id": "f272144c-e255-437e-b4f1-c1c7c7a99e84", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "7529cd5d-3dce-4394-977f-611fbe7c930b", "type": "text/javascript", "exec": [ "" ] } } ], "_postman_isSubFolder": true }, { "name": "Tweets", "item": [ { "name": "accounts/:account_id/tweets", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/tweets?tweet_type=", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "tweets" ], "query": [ { "key": "tweet_type", "value": "", "description": "required" }, { "key": "count", "value": "", "description": "optional", "disabled": true }, { "key": "cursor", "value": "", "description": "optional", "disabled": true }, { "key": "timeline_type", "value": "", "description": "optional", "disabled": true }, { "key": "trim_user", "value": "", "description": "optional", "disabled": true }, { "key": "tweet_ids", "value": "", "description": "optional", "disabled": true }, { "key": "user_id", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "accounts/:account_id/tweet", "event": [ { "listen": "prerequest", "script": { "id": "f198b6d6-2d36-49c9-b37f-c84c4d58bd43", "exec": [ "/*", " * This is a Pre-request script for Postman client to remediate OAuth 1.0a issue", " * where certain request fails if the query parameter includes some specific characters.", " * https://tools.ietf.org/html/rfc3986#section-2.2 (rfc3986, gen-delims reserved characters)", " *", " * NOTE: This Pre-script is intended to use with \"GET\" request but might be able to", " * work with other methods that have no request body.", " * For \"POST\" request, there's another workaround.", " * See: https://github.com/twitterdev/postman-twitter-ads-api/issues/2", " * ", " * In order to use this Pre-request script, you need to change your \"Authorization\" type to", " * \"No Auth\" only for the target request and do not apply to the top-level object.", " */", "", "const sdk = require('postman-collection');", "", "function toArray(object) {", " let array = [];", " Object.keys(object).forEach(key => {", " array.push(`${key}=${object[key]}`);", " });", " return array", "}", "", "// fetch all env variables that are currently defined", "const env_variables = pm.environment.toObject({", " excludeDisabled: true", "});", "", "const oauth_consumer_key = env_variables.consumer_key;", "const oauth_consumer_secret = env_variables.consumer_secret;", "const oauth_token = env_variables.access_token;", "const oauth_secret = env_variables.token_secret;", "const oauth_signing_key = `${oauth_consumer_secret}&${oauth_secret}`;", "", "// create random oauth_nonce string", "const random_source = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';", "var oauth_nonce = '';", "for (var i = 0; i < 32; i++) {", " oauth_nonce += random_source.charAt(Math.floor(Math.random() * random_source.length));", "}", "", "const oauth_parameter_string_object = {};", "oauth_parameter_string_object.oauth_consumer_key = oauth_consumer_key;", "oauth_parameter_string_object.oauth_token = oauth_token;", "const oauth_nonce_array = CryptoJS.enc.Utf8.parse(oauth_nonce);", "oauth_parameter_string_object.oauth_nonce = encodeURIComponent(CryptoJS.enc.Base64.stringify(oauth_nonce_array));", "oauth_parameter_string_object.oauth_signature_method = 'HMAC-SHA1';", "oauth_parameter_string_object.oauth_version = '1.0';", "oauth_parameter_string_object.oauth_timestamp = Math.round((new Date()).getTime() / 1000);", "", "// for Authorization request header (copy object)", "const oauth_authorization_header_object = Object.assign({}, oauth_parameter_string_object);", "", "// convert query string into object (+ encode)", "const url_query_string_object = {};", "", "const url_query_string_object_array = sdk.QueryParam.parse(", " pm.request.url.getQueryString({", " ignoreDisabled: true", " })", ");", "", "url_query_string_object_array.forEach(item => {", " url_query_string_object[item.key] = encodeURIComponent(item.value);", "});", "", "// merge query parameter", "Object.assign(oauth_parameter_string_object, url_query_string_object);", "", "// sort object by key", "const oauth_parameter_string_object_ordered = {};", "Object.keys(oauth_parameter_string_object).sort().forEach(function(key) {", " oauth_parameter_string_object_ordered[key] = oauth_parameter_string_object[key];", "});", "", "// generate parameter string", "const oauth_parameter_string = toArray(oauth_parameter_string_object_ordered).join('&');", "", "// replace dynamic variables", "let base_host = pm.request.url.getOAuth1BaseUrl();", "let regexp = /{{(.*?)}}/g;", "while (result = regexp.exec(base_host)) {", " let value = env_variables[result[1]];", " base_host = base_host.replace(new RegExp(`{{${result[1]}}}`, 'g'), value);", "}", "", "// generate base string", "const oauth_base_string = `${pm.request.method}&${encodeURIComponent(base_host)}&${encodeURIComponent(oauth_parameter_string)}`;", "", "// generate signature", "const oauth_signature = CryptoJS.enc.Base64.stringify(CryptoJS.HmacSHA1(oauth_base_string, oauth_signing_key));", "", "oauth_authorization_header_object.oauth_signature = encodeURIComponent(oauth_signature);", "", "// generate Authorization header string", "const oauth_authorization_header = toArray(oauth_authorization_header_object).join(', ');", "", "// generate Authorization header", "pm.request.headers.add({", " key: 'Authorization',", " value: `OAuth ${oauth_authorization_header}`", "});", "", "// Escape URI parameters using encodeURIComponent => RFC3986", "if (Object.keys(url_query_string_object).length !== 0) {", " // generate query parameter string", " const request_parameter_string = toArray(url_query_string_object).join('&');", "", " pm.request.url = `${pm.request.url.getOAuth1BaseUrl()}?${request_parameter_string}`;", "}" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "noauth" }, "method": "POST", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/tweet?as_user_id", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "tweet" ], "query": [ { "key": "as_user_id", "value": "", "description": "required" }, { "key": "text", "value": "", "description": "sometimes required", "disabled": true }, { "key": "card_uri", "value": "", "description": "optional", "disabled": true }, { "key": "media_keys", "value": "", "description": "optional", "disabled": true }, { "key": "nullcast", "value": "", "description": "optional", "disabled": true }, { "key": "trim_user", "value": "", "description": "optional", "disabled": true }, { "key": "tweet_mode", "value": "", "description": "optional", "disabled": true }, { "key": "video_cta", "value": "", "description": "optional", "disabled": true }, { "key": "video_cta_value", "value": "", "description": "optional", "disabled": true }, { "key": "video_description", "value": "", "description": "optional", "disabled": true }, { "key": "video_title", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] } ], "description": "https://developer.twitter.com/en/docs/ads/creatives/api-reference/tweets", "event": [ { "listen": "prerequest", "script": { "id": "ee81d12a-f8c2-4102-8d32-1d27406ae301", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "50fcf865-de68-49a0-8192-4fb35926a076", "type": "text/javascript", "exec": [ "" ] } } ], "_postman_isSubFolder": true }, { "name": "Draft Tweets", "item": [ { "name": "accounts/:account_id/draft_tweets", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/draft_tweets?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "draft_tweets" ], "query": [ { "key": "count", "value": "", "description": "optional", "disabled": true }, { "key": "cursor", "value": "", "description": "optional", "disabled": true }, { "key": "user_id", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "accounts/:account_id/draft_tweets/:draft_tweet_id", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/draft_tweets/:draft_tweet_id", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "draft_tweets", ":draft_tweet_id" ], "variable": [ { "id": "f1ecdd62-002e-449b-aa7f-524a4908b5a4", "key": "draft_tweet_id", "type": "any" } ] } }, "response": [] }, { "name": "accounts/:account_id/draft_tweets", "event": [ { "listen": "prerequest", "script": { "id": "904e3df1-45be-453d-8d2b-59c148517002", "exec": [ "/*", " * This is a Pre-request script for Postman client to remediate OAuth 1.0a issue", " * where certain request fails if the query parameter includes some specific characters.", " * https://tools.ietf.org/html/rfc3986#section-2.2 (rfc3986, gen-delims reserved characters)", " *", " * NOTE: This Pre-script is intended to use with \"GET\" request but might be able to", " * work with other methods that have no request body.", " * For \"POST\" request, there's another workaround.", " * See: https://github.com/twitterdev/postman-twitter-ads-api/issues/2", " * ", " * In order to use this Pre-request script, you need to change your \"Authorization\" type to", " * \"No Auth\" only for the target request and do not apply to the top-level object.", " */", "", "const sdk = require('postman-collection');", "", "function toArray(object) {", " let array = [];", " Object.keys(object).forEach(key => {", " array.push(`${key}=${object[key]}`);", " });", " return array", "}", "", "// fetch all env variables that are currently defined", "const env_variables = pm.environment.toObject({", " excludeDisabled: true", "});", "", "const oauth_consumer_key = env_variables.consumer_key;", "const oauth_consumer_secret = env_variables.consumer_secret;", "const oauth_token = env_variables.access_token;", "const oauth_secret = env_variables.token_secret;", "const oauth_signing_key = `${oauth_consumer_secret}&${oauth_secret}`;", "", "// create random oauth_nonce string", "const random_source = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';", "var oauth_nonce = '';", "for (var i = 0; i < 32; i++) {", " oauth_nonce += random_source.charAt(Math.floor(Math.random() * random_source.length));", "}", "", "const oauth_parameter_string_object = {};", "oauth_parameter_string_object.oauth_consumer_key = oauth_consumer_key;", "oauth_parameter_string_object.oauth_token = oauth_token;", "const oauth_nonce_array = CryptoJS.enc.Utf8.parse(oauth_nonce);", "oauth_parameter_string_object.oauth_nonce = encodeURIComponent(CryptoJS.enc.Base64.stringify(oauth_nonce_array));", "oauth_parameter_string_object.oauth_signature_method = 'HMAC-SHA1';", "oauth_parameter_string_object.oauth_version = '1.0';", "oauth_parameter_string_object.oauth_timestamp = Math.round((new Date()).getTime() / 1000);", "", "// for Authorization request header (copy object)", "const oauth_authorization_header_object = Object.assign({}, oauth_parameter_string_object);", "", "// convert query string into object (+ encode)", "const url_query_string_object = {};", "", "const url_query_string_object_array = sdk.QueryParam.parse(", " pm.request.url.getQueryString({", " ignoreDisabled: true", " })", ");", "", "url_query_string_object_array.forEach(item => {", " url_query_string_object[item.key] = encodeURIComponent(item.value);", "});", "", "// merge query parameter", "Object.assign(oauth_parameter_string_object, url_query_string_object);", "", "// sort object by key", "const oauth_parameter_string_object_ordered = {};", "Object.keys(oauth_parameter_string_object).sort().forEach(function(key) {", " oauth_parameter_string_object_ordered[key] = oauth_parameter_string_object[key];", "});", "", "// generate parameter string", "const oauth_parameter_string = toArray(oauth_parameter_string_object_ordered).join('&');", "", "// replace dynamic variables", "let base_host = pm.request.url.getOAuth1BaseUrl();", "let regexp = /{{(.*?)}}/g;", "while (result = regexp.exec(base_host)) {", " let value = env_variables[result[1]];", " base_host = base_host.replace(new RegExp(`{{${result[1]}}}`, 'g'), value);", "}", "", "// generate base string", "const oauth_base_string = `${pm.request.method}&${encodeURIComponent(base_host)}&${encodeURIComponent(oauth_parameter_string)}`;", "", "// generate signature", "const oauth_signature = CryptoJS.enc.Base64.stringify(CryptoJS.HmacSHA1(oauth_base_string, oauth_signing_key));", "", "oauth_authorization_header_object.oauth_signature = encodeURIComponent(oauth_signature);", "", "// generate Authorization header string", "const oauth_authorization_header = toArray(oauth_authorization_header_object).join(', ');", "", "// generate Authorization header", "pm.request.headers.add({", " key: 'Authorization',", " value: `OAuth ${oauth_authorization_header}`", "});", "", "// Escape URI parameters using encodeURIComponent => RFC3986", "if (Object.keys(url_query_string_object).length !== 0) {", " // generate query parameter string", " const request_parameter_string = toArray(url_query_string_object).join('&');", "", " pm.request.url = `${pm.request.url.getOAuth1BaseUrl()}?${request_parameter_string}`;", "}" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "noauth" }, "method": "POST", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/draft_tweets?as_user_id", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "draft_tweets" ], "query": [ { "key": "as_user_id", "value": "", "description": "required" }, { "key": "text", "value": "", "description": "sometimes required", "disabled": true }, { "key": "card_uri", "value": "", "description": "optional", "disabled": true }, { "key": "media_keys", "value": "", "description": "optional", "disabled": true }, { "key": "nullcast", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "accounts/:account_id/draft_tweets/:draft_tweet_id", "event": [ { "listen": "prerequest", "script": { "id": "5ddd94cd-e1f6-4e04-bb18-42ad6ea3705a", "exec": [ "/*", " * This is a Pre-request script for Postman client to remediate OAuth 1.0a issue", " * where certain request fails if the query parameter includes some specific characters.", " * https://tools.ietf.org/html/rfc3986#section-2.2 (rfc3986, gen-delims reserved characters)", " *", " * NOTE: This Pre-script is intended to use with \"GET\" request but might be able to", " * work with other methods that have no request body.", " * For \"POST\" request, there's another workaround.", " * See: https://github.com/twitterdev/postman-twitter-ads-api/issues/2", " * ", " * In order to use this Pre-request script, you need to change your \"Authorization\" type to", " * \"No Auth\" only for the target request and do not apply to the top-level object.", " */", "", "const sdk = require('postman-collection');", "", "function toArray(object) {", " let array = [];", " Object.keys(object).forEach(key => {", " array.push(`${key}=${object[key]}`);", " });", " return array", "}", "", "// fetch all env variables that are currently defined", "const env_variables = pm.environment.toObject({", " excludeDisabled: true", "});", "", "const oauth_consumer_key = env_variables.consumer_key;", "const oauth_consumer_secret = env_variables.consumer_secret;", "const oauth_token = env_variables.access_token;", "const oauth_secret = env_variables.token_secret;", "const oauth_signing_key = `${oauth_consumer_secret}&${oauth_secret}`;", "", "// create random oauth_nonce string", "const random_source = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';", "var oauth_nonce = '';", "for (var i = 0; i < 32; i++) {", " oauth_nonce += random_source.charAt(Math.floor(Math.random() * random_source.length));", "}", "", "const oauth_parameter_string_object = {};", "oauth_parameter_string_object.oauth_consumer_key = oauth_consumer_key;", "oauth_parameter_string_object.oauth_token = oauth_token;", "const oauth_nonce_array = CryptoJS.enc.Utf8.parse(oauth_nonce);", "oauth_parameter_string_object.oauth_nonce = encodeURIComponent(CryptoJS.enc.Base64.stringify(oauth_nonce_array));", "oauth_parameter_string_object.oauth_signature_method = 'HMAC-SHA1';", "oauth_parameter_string_object.oauth_version = '1.0';", "oauth_parameter_string_object.oauth_timestamp = Math.round((new Date()).getTime() / 1000);", "", "// for Authorization request header (copy object)", "const oauth_authorization_header_object = Object.assign({}, oauth_parameter_string_object);", "", "// convert query string into object (+ encode)", "const url_query_string_object = {};", "", "const url_query_string_object_array = sdk.QueryParam.parse(", " pm.request.url.getQueryString({", " ignoreDisabled: true", " })", ");", "", "url_query_string_object_array.forEach(item => {", " url_query_string_object[item.key] = encodeURIComponent(item.value);", "});", "", "// merge query parameter", "Object.assign(oauth_parameter_string_object, url_query_string_object);", "", "// sort object by key", "const oauth_parameter_string_object_ordered = {};", "Object.keys(oauth_parameter_string_object).sort().forEach(function(key) {", " oauth_parameter_string_object_ordered[key] = oauth_parameter_string_object[key];", "});", "", "// generate parameter string", "const oauth_parameter_string = toArray(oauth_parameter_string_object_ordered).join('&');", "", "// replace dynamic variables", "let base_host = pm.request.url.getOAuth1BaseUrl();", "let regexp = /{{(.*?)}}/g;", "while (result = regexp.exec(base_host)) {", " let value = env_variables[result[1]];", " base_host = base_host.replace(new RegExp(`{{${result[1]}}}`, 'g'), value);", "}", "", "// generate base string", "const oauth_base_string = `${pm.request.method}&${encodeURIComponent(base_host)}&${encodeURIComponent(oauth_parameter_string)}`;", "", "// generate signature", "const oauth_signature = CryptoJS.enc.Base64.stringify(CryptoJS.HmacSHA1(oauth_base_string, oauth_signing_key));", "", "oauth_authorization_header_object.oauth_signature = encodeURIComponent(oauth_signature);", "", "// generate Authorization header string", "const oauth_authorization_header = toArray(oauth_authorization_header_object).join(', ');", "", "// generate Authorization header", "pm.request.headers.add({", " key: 'Authorization',", " value: `OAuth ${oauth_authorization_header}`", "});", "", "// Escape URI parameters using encodeURIComponent => RFC3986", "if (Object.keys(url_query_string_object).length !== 0) {", " // generate query parameter string", " const request_parameter_string = toArray(url_query_string_object).join('&');", "", " pm.request.url = `${pm.request.url.getOAuth1BaseUrl()}?${request_parameter_string}`;", "}" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "noauth" }, "method": "PUT", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/draft_tweets/:draft_tweet_id?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "draft_tweets", ":draft_tweet_id" ], "query": [ { "key": "card_uri", "value": "", "description": "optional", "disabled": true }, { "key": "media_keys", "value": "", "description": "optional", "disabled": true }, { "key": "nullcast", "value": "", "description": "optional", "disabled": true }, { "key": "text", "value": "", "description": "optional", "disabled": true } ], "variable": [ { "id": "18dd2039-bbe6-49b1-816c-9830ffc59408", "key": "draft_tweet_id", "type": "any" } ] } }, "response": [] }, { "name": "accounts/:account_id/draft_tweets/:draft_tweet_id", "request": { "method": "DELETE", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/draft_tweets/:draft_tweet_id", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "draft_tweets", ":draft_tweet_id" ], "variable": [ { "id": "02416318-bf1c-4b50-8c24-77993a598dcf", "key": "draft_tweet_id", "type": "any" } ] } }, "response": [] }, { "name": "accounts/:account_id/draft_tweets/preview/:draft_tweet_id", "request": { "method": "POST", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/draft_tweets/preview/:draft_tweet_id", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "draft_tweets", "preview", ":draft_tweet_id" ], "variable": [ { "id": "a5ff84ac-f1bd-4c89-b5ac-3d3b7969af44", "key": "draft_tweet_id", "value": "", "type": "string" } ] } }, "response": [] } ], "description": "https://developer.twitter.com/en/docs/ads/creatives/api-reference/draft-tweets", "event": [ { "listen": "prerequest", "script": { "id": "97d1e0cc-dd30-47ea-bb09-071f759ed6aa", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "cbe19557-d11d-49ae-9c8b-d0e156614bf8", "type": "text/javascript", "exec": [ "" ] } } ], "_postman_isSubFolder": true }, { "name": "Scheduled Tweets", "item": [ { "name": "accounts/:account_id/scheduled_tweets", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/scheduled_tweets?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "scheduled_tweets" ], "query": [ { "key": "count", "value": "", "description": "optional", "disabled": true }, { "key": "cursor", "value": "", "description": "optional", "disabled": true }, { "key": "user_id", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "accounts/:account_id/scheduled_tweets/:scheduled_tweet_id", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/scheduled_tweets/:scheduled_tweet_id?scheduled_tweet_id=", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "scheduled_tweets", ":scheduled_tweet_id" ], "query": [ { "key": "scheduled_tweet_id", "value": "", "description": "required" } ], "variable": [ { "id": "9b567973-1034-47b2-929d-964406defe13", "key": "scheduled_tweet_id", "type": "any" } ] } }, "response": [] }, { "name": "accounts/:account_id/scheduled_tweets", "event": [ { "listen": "prerequest", "script": { "id": "258c2f24-b032-4afc-955e-6dc593bb60d9", "exec": [ "/*", " * This is a Pre-request script for Postman client to remediate OAuth 1.0a issue", " * where certain request fails if the query parameter includes some specific characters.", " * https://tools.ietf.org/html/rfc3986#section-2.2 (rfc3986, gen-delims reserved characters)", " *", " * NOTE: This Pre-script is intended to use with \"GET\" request but might be able to", " * work with other methods that have no request body.", " * For \"POST\" request, there's another workaround.", " * See: https://github.com/twitterdev/postman-twitter-ads-api/issues/2", " * ", " * In order to use this Pre-request script, you need to change your \"Authorization\" type to", " * \"No Auth\" only for the target request and do not apply to the top-level object.", " */", "", "const sdk = require('postman-collection');", "", "function toArray(object) {", " let array = [];", " Object.keys(object).forEach(key => {", " array.push(`${key}=${object[key]}`);", " });", " return array", "}", "", "// fetch all env variables that are currently defined", "const env_variables = pm.environment.toObject({", " excludeDisabled: true", "});", "", "const oauth_consumer_key = env_variables.consumer_key;", "const oauth_consumer_secret = env_variables.consumer_secret;", "const oauth_token = env_variables.access_token;", "const oauth_secret = env_variables.token_secret;", "const oauth_signing_key = `${oauth_consumer_secret}&${oauth_secret}`;", "", "// create random oauth_nonce string", "const random_source = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';", "var oauth_nonce = '';", "for (var i = 0; i < 32; i++) {", " oauth_nonce += random_source.charAt(Math.floor(Math.random() * random_source.length));", "}", "", "const oauth_parameter_string_object = {};", "oauth_parameter_string_object.oauth_consumer_key = oauth_consumer_key;", "oauth_parameter_string_object.oauth_token = oauth_token;", "const oauth_nonce_array = CryptoJS.enc.Utf8.parse(oauth_nonce);", "oauth_parameter_string_object.oauth_nonce = encodeURIComponent(CryptoJS.enc.Base64.stringify(oauth_nonce_array));", "oauth_parameter_string_object.oauth_signature_method = 'HMAC-SHA1';", "oauth_parameter_string_object.oauth_version = '1.0';", "oauth_parameter_string_object.oauth_timestamp = Math.round((new Date()).getTime() / 1000);", "", "// for Authorization request header (copy object)", "const oauth_authorization_header_object = Object.assign({}, oauth_parameter_string_object);", "", "// convert query string into object (+ encode)", "const url_query_string_object = {};", "", "const url_query_string_object_array = sdk.QueryParam.parse(", " pm.request.url.getQueryString({", " ignoreDisabled: true", " })", ");", "", "url_query_string_object_array.forEach(item => {", " url_query_string_object[item.key] = encodeURIComponent(item.value);", "});", "", "// merge query parameter", "Object.assign(oauth_parameter_string_object, url_query_string_object);", "", "// sort object by key", "const oauth_parameter_string_object_ordered = {};", "Object.keys(oauth_parameter_string_object).sort().forEach(function(key) {", " oauth_parameter_string_object_ordered[key] = oauth_parameter_string_object[key];", "});", "", "// generate parameter string", "const oauth_parameter_string = toArray(oauth_parameter_string_object_ordered).join('&');", "", "// replace dynamic variables", "let base_host = pm.request.url.getOAuth1BaseUrl();", "let regexp = /{{(.*?)}}/g;", "while (result = regexp.exec(base_host)) {", " let value = env_variables[result[1]];", " base_host = base_host.replace(new RegExp(`{{${result[1]}}}`, 'g'), value);", "}", "", "// generate base string", "const oauth_base_string = `${pm.request.method}&${encodeURIComponent(base_host)}&${encodeURIComponent(oauth_parameter_string)}`;", "", "// generate signature", "const oauth_signature = CryptoJS.enc.Base64.stringify(CryptoJS.HmacSHA1(oauth_base_string, oauth_signing_key));", "", "oauth_authorization_header_object.oauth_signature = encodeURIComponent(oauth_signature);", "", "// generate Authorization header string", "const oauth_authorization_header = toArray(oauth_authorization_header_object).join(', ');", "", "// generate Authorization header", "pm.request.headers.add({", " key: 'Authorization',", " value: `OAuth ${oauth_authorization_header}`", "});", "", "// Escape URI parameters using encodeURIComponent => RFC3986", "if (Object.keys(url_query_string_object).length !== 0) {", " // generate query parameter string", " const request_parameter_string = toArray(url_query_string_object).join('&');", "", " pm.request.url = `${pm.request.url.getOAuth1BaseUrl()}?${request_parameter_string}`;", "}" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "noauth" }, "method": "POST", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/scheduled_tweets?as_user_id&scheduled_at=", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "scheduled_tweets" ], "query": [ { "key": "as_user_id", "value": "", "description": "required" }, { "key": "scheduled_at", "value": "", "description": "required" }, { "key": "text", "value": "", "description": "sometimes required", "disabled": true }, { "key": "card_uri", "value": "", "description": "optional", "disabled": true }, { "key": "media_keys", "value": "", "description": "optional", "disabled": true }, { "key": "nullcast", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "accounts/:account_id/scheduled_tweets/:scheduled_tweet_id", "event": [ { "listen": "prerequest", "script": { "id": "43cd45a7-3da5-451f-82e0-277920e50173", "exec": [ "/*", " * This is a Pre-request script for Postman client to remediate OAuth 1.0a issue", " * where certain request fails if the query parameter includes some specific characters.", " * https://tools.ietf.org/html/rfc3986#section-2.2 (rfc3986, gen-delims reserved characters)", " *", " * NOTE: This Pre-script is intended to use with \"GET\" request but might be able to", " * work with other methods that have no request body.", " * For \"POST\" request, there's another workaround.", " * See: https://github.com/twitterdev/postman-twitter-ads-api/issues/2", " * ", " * In order to use this Pre-request script, you need to change your \"Authorization\" type to", " * \"No Auth\" only for the target request and do not apply to the top-level object.", " */", "", "const sdk = require('postman-collection');", "", "function toArray(object) {", " let array = [];", " Object.keys(object).forEach(key => {", " array.push(`${key}=${object[key]}`);", " });", " return array", "}", "", "// fetch all env variables that are currently defined", "const env_variables = pm.environment.toObject({", " excludeDisabled: true", "});", "", "const oauth_consumer_key = env_variables.consumer_key;", "const oauth_consumer_secret = env_variables.consumer_secret;", "const oauth_token = env_variables.access_token;", "const oauth_secret = env_variables.token_secret;", "const oauth_signing_key = `${oauth_consumer_secret}&${oauth_secret}`;", "", "// create random oauth_nonce string", "const random_source = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';", "var oauth_nonce = '';", "for (var i = 0; i < 32; i++) {", " oauth_nonce += random_source.charAt(Math.floor(Math.random() * random_source.length));", "}", "", "const oauth_parameter_string_object = {};", "oauth_parameter_string_object.oauth_consumer_key = oauth_consumer_key;", "oauth_parameter_string_object.oauth_token = oauth_token;", "const oauth_nonce_array = CryptoJS.enc.Utf8.parse(oauth_nonce);", "oauth_parameter_string_object.oauth_nonce = encodeURIComponent(CryptoJS.enc.Base64.stringify(oauth_nonce_array));", "oauth_parameter_string_object.oauth_signature_method = 'HMAC-SHA1';", "oauth_parameter_string_object.oauth_version = '1.0';", "oauth_parameter_string_object.oauth_timestamp = Math.round((new Date()).getTime() / 1000);", "", "// for Authorization request header (copy object)", "const oauth_authorization_header_object = Object.assign({}, oauth_parameter_string_object);", "", "// convert query string into object (+ encode)", "const url_query_string_object = {};", "", "const url_query_string_object_array = sdk.QueryParam.parse(", " pm.request.url.getQueryString({", " ignoreDisabled: true", " })", ");", "", "url_query_string_object_array.forEach(item => {", " url_query_string_object[item.key] = encodeURIComponent(item.value);", "});", "", "// merge query parameter", "Object.assign(oauth_parameter_string_object, url_query_string_object);", "", "// sort object by key", "const oauth_parameter_string_object_ordered = {};", "Object.keys(oauth_parameter_string_object).sort().forEach(function(key) {", " oauth_parameter_string_object_ordered[key] = oauth_parameter_string_object[key];", "});", "", "// generate parameter string", "const oauth_parameter_string = toArray(oauth_parameter_string_object_ordered).join('&');", "", "// replace dynamic variables", "let base_host = pm.request.url.getOAuth1BaseUrl();", "let regexp = /{{(.*?)}}/g;", "while (result = regexp.exec(base_host)) {", " let value = env_variables[result[1]];", " base_host = base_host.replace(new RegExp(`{{${result[1]}}}`, 'g'), value);", "}", "", "// generate base string", "const oauth_base_string = `${pm.request.method}&${encodeURIComponent(base_host)}&${encodeURIComponent(oauth_parameter_string)}`;", "", "// generate signature", "const oauth_signature = CryptoJS.enc.Base64.stringify(CryptoJS.HmacSHA1(oauth_base_string, oauth_signing_key));", "", "oauth_authorization_header_object.oauth_signature = encodeURIComponent(oauth_signature);", "", "// generate Authorization header string", "const oauth_authorization_header = toArray(oauth_authorization_header_object).join(', ');", "", "// generate Authorization header", "pm.request.headers.add({", " key: 'Authorization',", " value: `OAuth ${oauth_authorization_header}`", "});", "", "// Escape URI parameters using encodeURIComponent => RFC3986", "if (Object.keys(url_query_string_object).length !== 0) {", " // generate query parameter string", " const request_parameter_string = toArray(url_query_string_object).join('&');", "", " pm.request.url = `${pm.request.url.getOAuth1BaseUrl()}?${request_parameter_string}`;", "}" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "noauth" }, "method": "PUT", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/scheduled_tweets/:scheduled_tweet_id?scheduled_tweet_id=", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "scheduled_tweets", ":scheduled_tweet_id" ], "query": [ { "key": "scheduled_tweet_id", "value": "", "description": "required" }, { "key": "card_uri", "value": "", "description": "optional", "disabled": true }, { "key": "media_keys", "value": "", "description": "optional", "disabled": true }, { "key": "nullcast", "value": "", "description": "optional", "disabled": true }, { "key": "scheduled_at", "value": "", "description": "optional", "disabled": true }, { "key": "text", "value": "", "description": "optional", "disabled": true } ], "variable": [ { "id": "3d0fead3-3aa1-4897-b123-9d5d0e791d4d", "key": "scheduled_tweet_id", "type": "any" } ] } }, "response": [] }, { "name": "accounts/:account_id/scheduled_tweets/:scheduled_tweet_id", "request": { "method": "DELETE", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/scheduled_tweets/:scheduled_tweet_id?scheduled_tweet_id=", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "scheduled_tweets", ":scheduled_tweet_id" ], "query": [ { "key": "scheduled_tweet_id", "value": "", "description": "required" } ], "variable": [ { "id": "80fca9e3-6ca4-4706-b176-f30abdfd68f9", "key": "scheduled_tweet_id", "type": "any" } ] } }, "response": [] } ], "description": "https://developer.twitter.com/en/docs/ads/creatives/api-reference/scheduled-tweets", "event": [ { "listen": "prerequest", "script": { "id": "4cc0fad0-98b3-4108-b3d5-163630809e6a", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "38bfa2db-36f0-4747-b217-f27888ab2340", "type": "text/javascript", "exec": [ "" ] } } ], "_postman_isSubFolder": true }, { "name": "Website Cards", "item": [ { "name": "accounts/:account_id/cards/website", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/cards/website?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "cards", "website" ], "query": [ { "key": "card_ids", "value": "", "description": "optional", "disabled": true }, { "key": "count", "value": "", "description": "optional", "disabled": true }, { "key": "cursor", "value": "", "description": "optional", "disabled": true }, { "key": "q", "value": "", "description": "optional", "disabled": true }, { "key": "sort_by", "value": "", "description": "optional", "disabled": true }, { "key": "with_deleted", "value": "", "description": "optional", "disabled": true }, { "key": "with_total_count", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "accounts/:account_id/cards/website/:card_id", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/cards/website/:card_id?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "cards", "website", ":card_id" ], "query": [ { "key": "with_deleted", "value": "", "description": "optional", "disabled": true } ], "variable": [ { "id": "d73b24d0-b931-4e77-a3de-7f7004f4db1d", "key": "card_id", "type": "any" } ] } }, "response": [] }, { "name": "accounts/:account_id/cards/website", "event": [ { "listen": "prerequest", "script": { "id": "d6459457-0879-432f-a1af-2fcd5106cc0d", "exec": [ "/*", " * This is a Pre-request script for Postman client to remediate OAuth 1.0a issue", " * where certain request fails if the query parameter includes some specific characters.", " * https://tools.ietf.org/html/rfc3986#section-2.2 (rfc3986, gen-delims reserved characters)", " *", " * NOTE: This Pre-script is intended to use with \"GET\" request but might be able to", " * work with other methods that have no request body.", " * For \"POST\" request, there's another workaround.", " * See: https://github.com/twitterdev/postman-twitter-ads-api/issues/2", " * ", " * In order to use this Pre-request script, you need to change your \"Authorization\" type to", " * \"No Auth\" only for the target request and do not apply to the top-level object.", " */", "", "const sdk = require('postman-collection');", "", "function toArray(object) {", " let array = [];", " Object.keys(object).forEach(key => {", " array.push(`${key}=${object[key]}`);", " });", " return array", "}", "", "// fetch all env variables that are currently defined", "const env_variables = pm.environment.toObject({", " excludeDisabled: true", "});", "", "const oauth_consumer_key = env_variables.consumer_key;", "const oauth_consumer_secret = env_variables.consumer_secret;", "const oauth_token = env_variables.access_token;", "const oauth_secret = env_variables.token_secret;", "const oauth_signing_key = `${oauth_consumer_secret}&${oauth_secret}`;", "", "// create random oauth_nonce string", "const random_source = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';", "var oauth_nonce = '';", "for (var i = 0; i < 32; i++) {", " oauth_nonce += random_source.charAt(Math.floor(Math.random() * random_source.length));", "}", "", "const oauth_parameter_string_object = {};", "oauth_parameter_string_object.oauth_consumer_key = oauth_consumer_key;", "oauth_parameter_string_object.oauth_token = oauth_token;", "const oauth_nonce_array = CryptoJS.enc.Utf8.parse(oauth_nonce);", "oauth_parameter_string_object.oauth_nonce = encodeURIComponent(CryptoJS.enc.Base64.stringify(oauth_nonce_array));", "oauth_parameter_string_object.oauth_signature_method = 'HMAC-SHA1';", "oauth_parameter_string_object.oauth_version = '1.0';", "oauth_parameter_string_object.oauth_timestamp = Math.round((new Date()).getTime() / 1000);", "", "// for Authorization request header (copy object)", "const oauth_authorization_header_object = Object.assign({}, oauth_parameter_string_object);", "", "// convert query string into object (+ encode)", "const url_query_string_object = {};", "", "const url_query_string_object_array = sdk.QueryParam.parse(", " pm.request.url.getQueryString({", " ignoreDisabled: true", " })", ");", "", "url_query_string_object_array.forEach(item => {", " url_query_string_object[item.key] = encodeURIComponent(item.value);", "});", "", "// merge query parameter", "Object.assign(oauth_parameter_string_object, url_query_string_object);", "", "// sort object by key", "const oauth_parameter_string_object_ordered = {};", "Object.keys(oauth_parameter_string_object).sort().forEach(function(key) {", " oauth_parameter_string_object_ordered[key] = oauth_parameter_string_object[key];", "});", "", "// generate parameter string", "const oauth_parameter_string = toArray(oauth_parameter_string_object_ordered).join('&');", "", "// replace dynamic variables", "let base_host = pm.request.url.getOAuth1BaseUrl();", "let regexp = /{{(.*?)}}/g;", "while (result = regexp.exec(base_host)) {", " let value = env_variables[result[1]];", " base_host = base_host.replace(new RegExp(`{{${result[1]}}}`, 'g'), value);", "}", "", "// generate base string", "const oauth_base_string = `${pm.request.method}&${encodeURIComponent(base_host)}&${encodeURIComponent(oauth_parameter_string)}`;", "", "// generate signature", "const oauth_signature = CryptoJS.enc.Base64.stringify(CryptoJS.HmacSHA1(oauth_base_string, oauth_signing_key));", "", "oauth_authorization_header_object.oauth_signature = encodeURIComponent(oauth_signature);", "", "// generate Authorization header string", "const oauth_authorization_header = toArray(oauth_authorization_header_object).join(', ');", "", "// generate Authorization header", "pm.request.headers.add({", " key: 'Authorization',", " value: `OAuth ${oauth_authorization_header}`", "});", "", "// Escape URI parameters using encodeURIComponent => RFC3986", "if (Object.keys(url_query_string_object).length !== 0) {", " // generate query parameter string", " const request_parameter_string = toArray(url_query_string_object).join('&');", "", " pm.request.url = `${pm.request.url.getOAuth1BaseUrl()}?${request_parameter_string}`;", "}" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "noauth" }, "method": "POST", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/cards/website?name=&website_title=&website_url=", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "cards", "website" ], "query": [ { "key": "name", "value": "", "description": "required" }, { "key": "website_title", "value": "", "description": "required" }, { "key": "website_url", "value": "", "description": "required" }, { "key": "media_key", "value": "", "description": "sometimes required", "disabled": true } ] } }, "response": [] }, { "name": "accounts/:account_id/cards/website/:card_id", "event": [ { "listen": "prerequest", "script": { "id": "81816ed1-e4de-49e8-bb34-1803f4f10cd5", "exec": [ "/*", " * This is a Pre-request script for Postman client to remediate OAuth 1.0a issue", " * where certain request fails if the query parameter includes some specific characters.", " * https://tools.ietf.org/html/rfc3986#section-2.2 (rfc3986, gen-delims reserved characters)", " *", " * NOTE: This Pre-script is intended to use with \"GET\" request but might be able to", " * work with other methods that have no request body.", " * For \"POST\" request, there's another workaround.", " * See: https://github.com/twitterdev/postman-twitter-ads-api/issues/2", " * ", " * In order to use this Pre-request script, you need to change your \"Authorization\" type to", " * \"No Auth\" only for the target request and do not apply to the top-level object.", " */", "", "const sdk = require('postman-collection');", "", "function toArray(object) {", " let array = [];", " Object.keys(object).forEach(key => {", " array.push(`${key}=${object[key]}`);", " });", " return array", "}", "", "// fetch all env variables that are currently defined", "const env_variables = pm.environment.toObject({", " excludeDisabled: true", "});", "", "const oauth_consumer_key = env_variables.consumer_key;", "const oauth_consumer_secret = env_variables.consumer_secret;", "const oauth_token = env_variables.access_token;", "const oauth_secret = env_variables.token_secret;", "const oauth_signing_key = `${oauth_consumer_secret}&${oauth_secret}`;", "", "// create random oauth_nonce string", "const random_source = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';", "var oauth_nonce = '';", "for (var i = 0; i < 32; i++) {", " oauth_nonce += random_source.charAt(Math.floor(Math.random() * random_source.length));", "}", "", "const oauth_parameter_string_object = {};", "oauth_parameter_string_object.oauth_consumer_key = oauth_consumer_key;", "oauth_parameter_string_object.oauth_token = oauth_token;", "const oauth_nonce_array = CryptoJS.enc.Utf8.parse(oauth_nonce);", "oauth_parameter_string_object.oauth_nonce = encodeURIComponent(CryptoJS.enc.Base64.stringify(oauth_nonce_array));", "oauth_parameter_string_object.oauth_signature_method = 'HMAC-SHA1';", "oauth_parameter_string_object.oauth_version = '1.0';", "oauth_parameter_string_object.oauth_timestamp = Math.round((new Date()).getTime() / 1000);", "", "// for Authorization request header (copy object)", "const oauth_authorization_header_object = Object.assign({}, oauth_parameter_string_object);", "", "// convert query string into object (+ encode)", "const url_query_string_object = {};", "", "const url_query_string_object_array = sdk.QueryParam.parse(", " pm.request.url.getQueryString({", " ignoreDisabled: true", " })", ");", "", "url_query_string_object_array.forEach(item => {", " url_query_string_object[item.key] = encodeURIComponent(item.value);", "});", "", "// merge query parameter", "Object.assign(oauth_parameter_string_object, url_query_string_object);", "", "// sort object by key", "const oauth_parameter_string_object_ordered = {};", "Object.keys(oauth_parameter_string_object).sort().forEach(function(key) {", " oauth_parameter_string_object_ordered[key] = oauth_parameter_string_object[key];", "});", "", "// generate parameter string", "const oauth_parameter_string = toArray(oauth_parameter_string_object_ordered).join('&');", "", "// replace dynamic variables", "let base_host = pm.request.url.getOAuth1BaseUrl();", "let regexp = /{{(.*?)}}/g;", "while (result = regexp.exec(base_host)) {", " let value = env_variables[result[1]];", " base_host = base_host.replace(new RegExp(`{{${result[1]}}}`, 'g'), value);", "}", "", "// generate base string", "const oauth_base_string = `${pm.request.method}&${encodeURIComponent(base_host)}&${encodeURIComponent(oauth_parameter_string)}`;", "", "// generate signature", "const oauth_signature = CryptoJS.enc.Base64.stringify(CryptoJS.HmacSHA1(oauth_base_string, oauth_signing_key));", "", "oauth_authorization_header_object.oauth_signature = encodeURIComponent(oauth_signature);", "", "// generate Authorization header string", "const oauth_authorization_header = toArray(oauth_authorization_header_object).join(', ');", "", "// generate Authorization header", "pm.request.headers.add({", " key: 'Authorization',", " value: `OAuth ${oauth_authorization_header}`", "});", "", "// Escape URI parameters using encodeURIComponent => RFC3986", "if (Object.keys(url_query_string_object).length !== 0) {", " // generate query parameter string", " const request_parameter_string = toArray(url_query_string_object).join('&');", "", " pm.request.url = `${pm.request.url.getOAuth1BaseUrl()}?${request_parameter_string}`;", "}" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "noauth" }, "method": "PUT", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/cards/website/:card_id?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "cards", "website", ":card_id" ], "query": [ { "key": "media_key", "value": "", "description": "optional", "disabled": true }, { "key": "name", "value": "", "description": "optional", "disabled": true }, { "key": "website_title", "value": "", "description": "optional", "disabled": true }, { "key": "website_url", "value": "", "description": "optional", "disabled": true } ], "variable": [ { "id": "6e3bf928-0a1e-491e-a1b1-454121b445b5", "key": "card_id", "type": "any" } ] } }, "response": [] }, { "name": "accounts/:account_id/cards/website/:card_id", "request": { "method": "DELETE", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/cards/website/:card_id", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "cards", "website", ":card_id" ], "variable": [ { "id": "59f61cda-5320-4ef7-9cac-41eea697fef8", "key": "card_id", "type": "any" } ] } }, "response": [] } ], "description": "https://developer.twitter.com/en/docs/ads/creatives/api-reference/website", "event": [ { "listen": "prerequest", "script": { "id": "f5cf6885-b2eb-44eb-91f2-ea9f0c33b97a", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "930e3092-daf6-44c1-9d20-b5cfe698965e", "type": "text/javascript", "exec": [ "" ] } } ], "_postman_isSubFolder": true }, { "name": "Video Website Cards", "item": [ { "name": "accounts/:account_id/cards/video_website", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/cards/video_website?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "cards", "video_website" ], "query": [ { "key": "card_ids", "value": "", "description": "optional", "disabled": true }, { "key": "count", "value": "", "description": "optional", "disabled": true }, { "key": "cursor", "value": "", "description": "optional", "disabled": true }, { "key": "q", "value": "", "description": "optional", "disabled": true }, { "key": "sort_by", "value": "", "description": "optional", "disabled": true }, { "key": "with_deleted", "value": "", "description": "optional", "disabled": true }, { "key": "with_total_count", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "accounts/:account_id/cards/video_website/:card_id", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/cards/video_website/:card_id?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "cards", "video_website", ":card_id" ], "query": [ { "key": "with_deleted", "value": "", "description": "optional", "disabled": true } ], "variable": [ { "id": "5cbbffcc-6420-42e0-b0f0-1bb0b48f0ad8", "key": "card_id", "type": "any" } ] } }, "response": [] }, { "name": "accounts/:account_id/cards/video_website", "event": [ { "listen": "prerequest", "script": { "id": "1670e783-01c1-4633-a353-bec5c6f4d178", "exec": [ "/*", " * This is a Pre-request script for Postman client to remediate OAuth 1.0a issue", " * where certain request fails if the query parameter includes some specific characters.", " * https://tools.ietf.org/html/rfc3986#section-2.2 (rfc3986, gen-delims reserved characters)", " *", " * NOTE: This Pre-script is intended to use with \"GET\" request but might be able to", " * work with other methods that have no request body.", " * For \"POST\" request, there's another workaround.", " * See: https://github.com/twitterdev/postman-twitter-ads-api/issues/2", " * ", " * In order to use this Pre-request script, you need to change your \"Authorization\" type to", " * \"No Auth\" only for the target request and do not apply to the top-level object.", " */", "", "const sdk = require('postman-collection');", "", "function toArray(object) {", " let array = [];", " Object.keys(object).forEach(key => {", " array.push(`${key}=${object[key]}`);", " });", " return array", "}", "", "// fetch all env variables that are currently defined", "const env_variables = pm.environment.toObject({", " excludeDisabled: true", "});", "", "const oauth_consumer_key = env_variables.consumer_key;", "const oauth_consumer_secret = env_variables.consumer_secret;", "const oauth_token = env_variables.access_token;", "const oauth_secret = env_variables.token_secret;", "const oauth_signing_key = `${oauth_consumer_secret}&${oauth_secret}`;", "", "// create random oauth_nonce string", "const random_source = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';", "var oauth_nonce = '';", "for (var i = 0; i < 32; i++) {", " oauth_nonce += random_source.charAt(Math.floor(Math.random() * random_source.length));", "}", "", "const oauth_parameter_string_object = {};", "oauth_parameter_string_object.oauth_consumer_key = oauth_consumer_key;", "oauth_parameter_string_object.oauth_token = oauth_token;", "const oauth_nonce_array = CryptoJS.enc.Utf8.parse(oauth_nonce);", "oauth_parameter_string_object.oauth_nonce = encodeURIComponent(CryptoJS.enc.Base64.stringify(oauth_nonce_array));", "oauth_parameter_string_object.oauth_signature_method = 'HMAC-SHA1';", "oauth_parameter_string_object.oauth_version = '1.0';", "oauth_parameter_string_object.oauth_timestamp = Math.round((new Date()).getTime() / 1000);", "", "// for Authorization request header (copy object)", "const oauth_authorization_header_object = Object.assign({}, oauth_parameter_string_object);", "", "// convert query string into object (+ encode)", "const url_query_string_object = {};", "", "const url_query_string_object_array = sdk.QueryParam.parse(", " pm.request.url.getQueryString({", " ignoreDisabled: true", " })", ");", "", "url_query_string_object_array.forEach(item => {", " url_query_string_object[item.key] = encodeURIComponent(item.value);", "});", "", "// merge query parameter", "Object.assign(oauth_parameter_string_object, url_query_string_object);", "", "// sort object by key", "const oauth_parameter_string_object_ordered = {};", "Object.keys(oauth_parameter_string_object).sort().forEach(function(key) {", " oauth_parameter_string_object_ordered[key] = oauth_parameter_string_object[key];", "});", "", "// generate parameter string", "const oauth_parameter_string = toArray(oauth_parameter_string_object_ordered).join('&');", "", "// replace dynamic variables", "let base_host = pm.request.url.getOAuth1BaseUrl();", "let regexp = /{{(.*?)}}/g;", "while (result = regexp.exec(base_host)) {", " let value = env_variables[result[1]];", " base_host = base_host.replace(new RegExp(`{{${result[1]}}}`, 'g'), value);", "}", "", "// generate base string", "const oauth_base_string = `${pm.request.method}&${encodeURIComponent(base_host)}&${encodeURIComponent(oauth_parameter_string)}`;", "", "// generate signature", "const oauth_signature = CryptoJS.enc.Base64.stringify(CryptoJS.HmacSHA1(oauth_base_string, oauth_signing_key));", "", "oauth_authorization_header_object.oauth_signature = encodeURIComponent(oauth_signature);", "", "// generate Authorization header string", "const oauth_authorization_header = toArray(oauth_authorization_header_object).join(', ');", "", "// generate Authorization header", "pm.request.headers.add({", " key: 'Authorization',", " value: `OAuth ${oauth_authorization_header}`", "});", "", "// Escape URI parameters using encodeURIComponent => RFC3986", "if (Object.keys(url_query_string_object).length !== 0) {", " // generate query parameter string", " const request_parameter_string = toArray(url_query_string_object).join('&');", "", " pm.request.url = `${pm.request.url.getOAuth1BaseUrl()}?${request_parameter_string}`;", "}" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "noauth" }, "method": "POST", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/cards/video_website?name=&title=&media_key&website_url=", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "cards", "video_website" ], "query": [ { "key": "name", "value": "", "description": "required" }, { "key": "title", "value": "", "description": "required" }, { "key": "media_key", "value": "", "description": "required" }, { "key": "website_url", "value": "", "description": "required" } ] } }, "response": [] }, { "name": "accounts/:account_id/cards/video_website/:card_id", "event": [ { "listen": "prerequest", "script": { "id": "0432a723-09be-40f5-a3ff-98528803c813", "exec": [ "/*", " * This is a Pre-request script for Postman client to remediate OAuth 1.0a issue", " * where certain request fails if the query parameter includes some specific characters.", " * https://tools.ietf.org/html/rfc3986#section-2.2 (rfc3986, gen-delims reserved characters)", " *", " * NOTE: This Pre-script is intended to use with \"GET\" request but might be able to", " * work with other methods that have no request body.", " * For \"POST\" request, there's another workaround.", " * See: https://github.com/twitterdev/postman-twitter-ads-api/issues/2", " * ", " * In order to use this Pre-request script, you need to change your \"Authorization\" type to", " * \"No Auth\" only for the target request and do not apply to the top-level object.", " */", "", "const sdk = require('postman-collection');", "", "function toArray(object) {", " let array = [];", " Object.keys(object).forEach(key => {", " array.push(`${key}=${object[key]}`);", " });", " return array", "}", "", "// fetch all env variables that are currently defined", "const env_variables = pm.environment.toObject({", " excludeDisabled: true", "});", "", "const oauth_consumer_key = env_variables.consumer_key;", "const oauth_consumer_secret = env_variables.consumer_secret;", "const oauth_token = env_variables.access_token;", "const oauth_secret = env_variables.token_secret;", "const oauth_signing_key = `${oauth_consumer_secret}&${oauth_secret}`;", "", "// create random oauth_nonce string", "const random_source = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';", "var oauth_nonce = '';", "for (var i = 0; i < 32; i++) {", " oauth_nonce += random_source.charAt(Math.floor(Math.random() * random_source.length));", "}", "", "const oauth_parameter_string_object = {};", "oauth_parameter_string_object.oauth_consumer_key = oauth_consumer_key;", "oauth_parameter_string_object.oauth_token = oauth_token;", "const oauth_nonce_array = CryptoJS.enc.Utf8.parse(oauth_nonce);", "oauth_parameter_string_object.oauth_nonce = encodeURIComponent(CryptoJS.enc.Base64.stringify(oauth_nonce_array));", "oauth_parameter_string_object.oauth_signature_method = 'HMAC-SHA1';", "oauth_parameter_string_object.oauth_version = '1.0';", "oauth_parameter_string_object.oauth_timestamp = Math.round((new Date()).getTime() / 1000);", "", "// for Authorization request header (copy object)", "const oauth_authorization_header_object = Object.assign({}, oauth_parameter_string_object);", "", "// convert query string into object (+ encode)", "const url_query_string_object = {};", "", "const url_query_string_object_array = sdk.QueryParam.parse(", " pm.request.url.getQueryString({", " ignoreDisabled: true", " })", ");", "", "url_query_string_object_array.forEach(item => {", " url_query_string_object[item.key] = encodeURIComponent(item.value);", "});", "", "// merge query parameter", "Object.assign(oauth_parameter_string_object, url_query_string_object);", "", "// sort object by key", "const oauth_parameter_string_object_ordered = {};", "Object.keys(oauth_parameter_string_object).sort().forEach(function(key) {", " oauth_parameter_string_object_ordered[key] = oauth_parameter_string_object[key];", "});", "", "// generate parameter string", "const oauth_parameter_string = toArray(oauth_parameter_string_object_ordered).join('&');", "", "// replace dynamic variables", "let base_host = pm.request.url.getOAuth1BaseUrl();", "let regexp = /{{(.*?)}}/g;", "while (result = regexp.exec(base_host)) {", " let value = env_variables[result[1]];", " base_host = base_host.replace(new RegExp(`{{${result[1]}}}`, 'g'), value);", "}", "", "// generate base string", "const oauth_base_string = `${pm.request.method}&${encodeURIComponent(base_host)}&${encodeURIComponent(oauth_parameter_string)}`;", "", "// generate signature", "const oauth_signature = CryptoJS.enc.Base64.stringify(CryptoJS.HmacSHA1(oauth_base_string, oauth_signing_key));", "", "oauth_authorization_header_object.oauth_signature = encodeURIComponent(oauth_signature);", "", "// generate Authorization header string", "const oauth_authorization_header = toArray(oauth_authorization_header_object).join(', ');", "", "// generate Authorization header", "pm.request.headers.add({", " key: 'Authorization',", " value: `OAuth ${oauth_authorization_header}`", "});", "", "// Escape URI parameters using encodeURIComponent => RFC3986", "if (Object.keys(url_query_string_object).length !== 0) {", " // generate query parameter string", " const request_parameter_string = toArray(url_query_string_object).join('&');", "", " pm.request.url = `${pm.request.url.getOAuth1BaseUrl()}?${request_parameter_string}`;", "}" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "noauth" }, "method": "PUT", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/cards/video_website/:card_id?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "cards", "video_website", ":card_id" ], "query": [ { "key": "name", "value": "", "description": "optional", "disabled": true }, { "key": "title", "value": "", "description": "optional", "disabled": true }, { "key": "media_key", "value": "", "description": "optional", "disabled": true }, { "key": "website_url", "value": "", "description": "optional", "disabled": true } ], "variable": [ { "id": "82677ffc-78b7-49f2-b9ec-5a58b68fe6f2", "key": "card_id", "type": "any" } ] } }, "response": [] }, { "name": "accounts/:account_id/cards/video_website/:card_id", "request": { "method": "DELETE", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/cards/video_website/:card_id", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "cards", "video_website", ":card_id" ], "variable": [ { "id": "5c34f152-150e-4545-9f79-80bd6e40dde0", "key": "card_id", "type": "any" } ] } }, "response": [] } ], "description": "https://developer.twitter.com/en/docs/ads/creatives/api-reference/video-website", "event": [ { "listen": "prerequest", "script": { "id": "82be12b9-1998-41a7-8094-5742179e0f24", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "06244fe0-06ae-42ac-bdf2-2c4d3288be9c", "type": "text/javascript", "exec": [ "" ] } } ], "_postman_isSubFolder": true }, { "name": "Image App Download Cards", "item": [ { "name": "accounts/:account_id/cards/image_app_download", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/cards/image_app_download?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "cards", "image_app_download" ], "query": [ { "key": "card_ids", "value": "", "description": "optional", "disabled": true }, { "key": "count", "value": "", "description": "optional", "disabled": true }, { "key": "cursor", "value": "", "description": "optional", "disabled": true }, { "key": "q", "value": "", "description": "optional", "disabled": true }, { "key": "sort_by", "value": "", "description": "optional", "disabled": true }, { "key": "with_deleted", "value": "", "description": "optional", "disabled": true }, { "key": "with_total_count", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "accounts/:account_id/cards/image_app_download/:card_id", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/cards/image_app_download/:card_id?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "cards", "image_app_download", ":card_id" ], "query": [ { "key": "with_deleted", "value": "", "description": "optional", "disabled": true } ], "variable": [ { "id": "0db8388b-91c8-490c-9fef-bbad63035330", "key": "card_id", "type": "any" } ] } }, "response": [] }, { "name": "accounts/:account_id/cards/image_app_download", "event": [ { "listen": "prerequest", "script": { "id": "5b96eb54-6538-405f-ad7d-f003ea3d4fe5", "exec": [ "/*", " * This is a Pre-request script for Postman client to remediate OAuth 1.0a issue", " * where certain request fails if the query parameter includes some specific characters.", " * https://tools.ietf.org/html/rfc3986#section-2.2 (rfc3986, gen-delims reserved characters)", " *", " * NOTE: This Pre-script is intended to use with \"GET\" request but might be able to", " * work with other methods that have no request body.", " * For \"POST\" request, there's another workaround.", " * See: https://github.com/twitterdev/postman-twitter-ads-api/issues/2", " * ", " * In order to use this Pre-request script, you need to change your \"Authorization\" type to", " * \"No Auth\" only for the target request and do not apply to the top-level object.", " */", "", "const sdk = require('postman-collection');", "", "function toArray(object) {", " let array = [];", " Object.keys(object).forEach(key => {", " array.push(`${key}=${object[key]}`);", " });", " return array", "}", "", "// fetch all env variables that are currently defined", "const env_variables = pm.environment.toObject({", " excludeDisabled: true", "});", "", "const oauth_consumer_key = env_variables.consumer_key;", "const oauth_consumer_secret = env_variables.consumer_secret;", "const oauth_token = env_variables.access_token;", "const oauth_secret = env_variables.token_secret;", "const oauth_signing_key = `${oauth_consumer_secret}&${oauth_secret}`;", "", "// create random oauth_nonce string", "const random_source = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';", "var oauth_nonce = '';", "for (var i = 0; i < 32; i++) {", " oauth_nonce += random_source.charAt(Math.floor(Math.random() * random_source.length));", "}", "", "const oauth_parameter_string_object = {};", "oauth_parameter_string_object.oauth_consumer_key = oauth_consumer_key;", "oauth_parameter_string_object.oauth_token = oauth_token;", "const oauth_nonce_array = CryptoJS.enc.Utf8.parse(oauth_nonce);", "oauth_parameter_string_object.oauth_nonce = encodeURIComponent(CryptoJS.enc.Base64.stringify(oauth_nonce_array));", "oauth_parameter_string_object.oauth_signature_method = 'HMAC-SHA1';", "oauth_parameter_string_object.oauth_version = '1.0';", "oauth_parameter_string_object.oauth_timestamp = Math.round((new Date()).getTime() / 1000);", "", "// for Authorization request header (copy object)", "const oauth_authorization_header_object = Object.assign({}, oauth_parameter_string_object);", "", "// convert query string into object (+ encode)", "const url_query_string_object = {};", "", "const url_query_string_object_array = sdk.QueryParam.parse(", " pm.request.url.getQueryString({", " ignoreDisabled: true", " })", ");", "", "url_query_string_object_array.forEach(item => {", " url_query_string_object[item.key] = encodeURIComponent(item.value);", "});", "", "// merge query parameter", "Object.assign(oauth_parameter_string_object, url_query_string_object);", "", "// sort object by key", "const oauth_parameter_string_object_ordered = {};", "Object.keys(oauth_parameter_string_object).sort().forEach(function(key) {", " oauth_parameter_string_object_ordered[key] = oauth_parameter_string_object[key];", "});", "", "// generate parameter string", "const oauth_parameter_string = toArray(oauth_parameter_string_object_ordered).join('&');", "", "// replace dynamic variables", "let base_host = pm.request.url.getOAuth1BaseUrl();", "let regexp = /{{(.*?)}}/g;", "while (result = regexp.exec(base_host)) {", " let value = env_variables[result[1]];", " base_host = base_host.replace(new RegExp(`{{${result[1]}}}`, 'g'), value);", "}", "", "// generate base string", "const oauth_base_string = `${pm.request.method}&${encodeURIComponent(base_host)}&${encodeURIComponent(oauth_parameter_string)}`;", "", "// generate signature", "const oauth_signature = CryptoJS.enc.Base64.stringify(CryptoJS.HmacSHA1(oauth_base_string, oauth_signing_key));", "", "oauth_authorization_header_object.oauth_signature = encodeURIComponent(oauth_signature);", "", "// generate Authorization header string", "const oauth_authorization_header = toArray(oauth_authorization_header_object).join(', ');", "", "// generate Authorization header", "pm.request.headers.add({", " key: 'Authorization',", " value: `OAuth ${oauth_authorization_header}`", "});", "", "// Escape URI parameters using encodeURIComponent => RFC3986", "if (Object.keys(url_query_string_object).length !== 0) {", " // generate query parameter string", " const request_parameter_string = toArray(url_query_string_object).join('&');", "", " pm.request.url = `${pm.request.url.getOAuth1BaseUrl()}?${request_parameter_string}`;", "}" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "noauth" }, "method": "POST", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/cards/image_app_download?name=&country_code=", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "cards", "image_app_download" ], "query": [ { "key": "name", "value": "", "description": "required" }, { "key": "country_code", "value": "", "description": "required" }, { "key": "ipad_app_id", "value": "", "description": "sometimes required", "disabled": true }, { "key": "iphone_app_id", "value": "", "description": "sometimes required", "disabled": true }, { "key": "googleplay_app_id", "value": "", "description": "sometimes required", "disabled": true }, { "key": "app_cta", "value": "", "description": "optional", "disabled": true }, { "key": "ipad_deep_link", "value": "", "description": "optional", "disabled": true }, { "key": "iphone_deep_link", "value": "", "description": "optional", "disabled": true }, { "key": "googleplay_deep_link", "value": "", "description": "optional", "disabled": true }, { "key": "media_key", "value": "", "description": "sometimes required", "disabled": true } ] } }, "response": [] }, { "name": "accounts/:account_id/cards/image_app_download/:card_id", "event": [ { "listen": "prerequest", "script": { "id": "f3360e0e-5085-49e7-b609-f3f9d0bdad5d", "exec": [ "/*", " * This is a Pre-request script for Postman client to remediate OAuth 1.0a issue", " * where certain request fails if the query parameter includes some specific characters.", " * https://tools.ietf.org/html/rfc3986#section-2.2 (rfc3986, gen-delims reserved characters)", " *", " * NOTE: This Pre-script is intended to use with \"GET\" request but might be able to", " * work with other methods that have no request body.", " * For \"POST\" request, there's another workaround.", " * See: https://github.com/twitterdev/postman-twitter-ads-api/issues/2", " * ", " * In order to use this Pre-request script, you need to change your \"Authorization\" type to", " * \"No Auth\" only for the target request and do not apply to the top-level object.", " */", "", "const sdk = require('postman-collection');", "", "function toArray(object) {", " let array = [];", " Object.keys(object).forEach(key => {", " array.push(`${key}=${object[key]}`);", " });", " return array", "}", "", "// fetch all env variables that are currently defined", "const env_variables = pm.environment.toObject({", " excludeDisabled: true", "});", "", "const oauth_consumer_key = env_variables.consumer_key;", "const oauth_consumer_secret = env_variables.consumer_secret;", "const oauth_token = env_variables.access_token;", "const oauth_secret = env_variables.token_secret;", "const oauth_signing_key = `${oauth_consumer_secret}&${oauth_secret}`;", "", "// create random oauth_nonce string", "const random_source = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';", "var oauth_nonce = '';", "for (var i = 0; i < 32; i++) {", " oauth_nonce += random_source.charAt(Math.floor(Math.random() * random_source.length));", "}", "", "const oauth_parameter_string_object = {};", "oauth_parameter_string_object.oauth_consumer_key = oauth_consumer_key;", "oauth_parameter_string_object.oauth_token = oauth_token;", "const oauth_nonce_array = CryptoJS.enc.Utf8.parse(oauth_nonce);", "oauth_parameter_string_object.oauth_nonce = encodeURIComponent(CryptoJS.enc.Base64.stringify(oauth_nonce_array));", "oauth_parameter_string_object.oauth_signature_method = 'HMAC-SHA1';", "oauth_parameter_string_object.oauth_version = '1.0';", "oauth_parameter_string_object.oauth_timestamp = Math.round((new Date()).getTime() / 1000);", "", "// for Authorization request header (copy object)", "const oauth_authorization_header_object = Object.assign({}, oauth_parameter_string_object);", "", "// convert query string into object (+ encode)", "const url_query_string_object = {};", "", "const url_query_string_object_array = sdk.QueryParam.parse(", " pm.request.url.getQueryString({", " ignoreDisabled: true", " })", ");", "", "url_query_string_object_array.forEach(item => {", " url_query_string_object[item.key] = encodeURIComponent(item.value);", "});", "", "// merge query parameter", "Object.assign(oauth_parameter_string_object, url_query_string_object);", "", "// sort object by key", "const oauth_parameter_string_object_ordered = {};", "Object.keys(oauth_parameter_string_object).sort().forEach(function(key) {", " oauth_parameter_string_object_ordered[key] = oauth_parameter_string_object[key];", "});", "", "// generate parameter string", "const oauth_parameter_string = toArray(oauth_parameter_string_object_ordered).join('&');", "", "// replace dynamic variables", "let base_host = pm.request.url.getOAuth1BaseUrl();", "let regexp = /{{(.*?)}}/g;", "while (result = regexp.exec(base_host)) {", " let value = env_variables[result[1]];", " base_host = base_host.replace(new RegExp(`{{${result[1]}}}`, 'g'), value);", "}", "", "// generate base string", "const oauth_base_string = `${pm.request.method}&${encodeURIComponent(base_host)}&${encodeURIComponent(oauth_parameter_string)}`;", "", "// generate signature", "const oauth_signature = CryptoJS.enc.Base64.stringify(CryptoJS.HmacSHA1(oauth_base_string, oauth_signing_key));", "", "oauth_authorization_header_object.oauth_signature = encodeURIComponent(oauth_signature);", "", "// generate Authorization header string", "const oauth_authorization_header = toArray(oauth_authorization_header_object).join(', ');", "", "// generate Authorization header", "pm.request.headers.add({", " key: 'Authorization',", " value: `OAuth ${oauth_authorization_header}`", "});", "", "// Escape URI parameters using encodeURIComponent => RFC3986", "if (Object.keys(url_query_string_object).length !== 0) {", " // generate query parameter string", " const request_parameter_string = toArray(url_query_string_object).join('&');", "", " pm.request.url = `${pm.request.url.getOAuth1BaseUrl()}?${request_parameter_string}`;", "}" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "noauth" }, "method": "PUT", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/cards/image_app_download/:card_id?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "cards", "image_app_download", ":card_id" ], "query": [ { "key": "country_code", "value": "", "description": "optional", "disabled": true }, { "key": "app_cta", "value": "", "description": "optional", "disabled": true }, { "key": "ipad_app_id", "value": "", "description": "optional", "disabled": true }, { "key": "ipad_deep_link", "value": "", "description": "optional", "disabled": true }, { "key": "iphone_app_id", "value": "", "description": "optional", "disabled": true }, { "key": "iphone_deep_link", "value": "", "description": "optional", "disabled": true }, { "key": "googleplay_app_id", "value": "", "description": "optional", "disabled": true }, { "key": "googleplay_deep_link", "value": "", "description": "optional", "disabled": true }, { "key": "name", "value": "", "description": "optional", "disabled": true }, { "key": "media_key", "value": "", "description": "optional", "disabled": true } ], "variable": [ { "id": "cff19d1e-018b-4a19-9911-6278e9473b70", "key": "card_id", "type": "any" } ] } }, "response": [] }, { "name": "accounts/:account_id/cards/image_app_download/:card_id", "request": { "method": "DELETE", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/cards/image_app_download/:card_id", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "cards", "image_app_download", ":card_id" ], "variable": [ { "id": "f3a64a82-f34b-4bb8-a9ed-ad88de9992be", "key": "card_id", "type": "any" } ] } }, "response": [] } ], "description": "https://developer.twitter.com/en/docs/ads/creatives/api-reference/image-app-download", "event": [ { "listen": "prerequest", "script": { "id": "6394cc6c-bce2-49a1-9986-64a123fff741", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "8e53117f-60cb-4e88-8aa2-1e7a0a437619", "type": "text/javascript", "exec": [ "" ] } } ], "_postman_isSubFolder": true }, { "name": "Image Conversation Cards", "item": [ { "name": "accounts/:account_id/cards/image_conversation", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/cards/image_conversation?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "cards", "image_conversation" ], "query": [ { "key": "card_ids", "value": "", "description": "optional", "disabled": true }, { "key": "count", "value": "", "description": "optional", "disabled": true }, { "key": "cursor", "value": "", "description": "optional", "disabled": true }, { "key": "q", "value": "", "description": "optional", "disabled": true }, { "key": "sort_by", "value": "", "description": "optional", "disabled": true }, { "key": "with_deleted", "value": "", "description": "optional", "disabled": true }, { "key": "with_total_count", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "accounts/:account_id/cards/image_conversation/:card_id", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/cards/image_conversation/:card_id?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "cards", "image_conversation", ":card_id" ], "query": [ { "key": "with_deleted", "value": "", "description": "optional", "disabled": true } ], "variable": [ { "id": "fca7e5d4-3152-4981-be33-36965e519a28", "key": "card_id", "type": "any" } ] } }, "response": [] }, { "name": "accounts/:account_id/cards/image_conversation", "event": [ { "listen": "prerequest", "script": { "id": "3daece4a-88a6-47b4-be8d-00657aecea5c", "exec": [ "/*", " * This is a Pre-request script for Postman client to remediate OAuth 1.0a issue", " * where certain request fails if the query parameter includes some specific characters.", " * https://tools.ietf.org/html/rfc3986#section-2.2 (rfc3986, gen-delims reserved characters)", " *", " * NOTE: This Pre-script is intended to use with \"GET\" request but might be able to", " * work with other methods that have no request body.", " * For \"POST\" request, there's another workaround.", " * See: https://github.com/twitterdev/postman-twitter-ads-api/issues/2", " * ", " * In order to use this Pre-request script, you need to change your \"Authorization\" type to", " * \"No Auth\" only for the target request and do not apply to the top-level object.", " */", "", "const sdk = require('postman-collection');", "", "function toArray(object) {", " let array = [];", " Object.keys(object).forEach(key => {", " array.push(`${key}=${object[key]}`);", " });", " return array", "}", "", "// fetch all env variables that are currently defined", "const env_variables = pm.environment.toObject({", " excludeDisabled: true", "});", "", "const oauth_consumer_key = env_variables.consumer_key;", "const oauth_consumer_secret = env_variables.consumer_secret;", "const oauth_token = env_variables.access_token;", "const oauth_secret = env_variables.token_secret;", "const oauth_signing_key = `${oauth_consumer_secret}&${oauth_secret}`;", "", "// create random oauth_nonce string", "const random_source = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';", "var oauth_nonce = '';", "for (var i = 0; i < 32; i++) {", " oauth_nonce += random_source.charAt(Math.floor(Math.random() * random_source.length));", "}", "", "const oauth_parameter_string_object = {};", "oauth_parameter_string_object.oauth_consumer_key = oauth_consumer_key;", "oauth_parameter_string_object.oauth_token = oauth_token;", "const oauth_nonce_array = CryptoJS.enc.Utf8.parse(oauth_nonce);", "oauth_parameter_string_object.oauth_nonce = encodeURIComponent(CryptoJS.enc.Base64.stringify(oauth_nonce_array));", "oauth_parameter_string_object.oauth_signature_method = 'HMAC-SHA1';", "oauth_parameter_string_object.oauth_version = '1.0';", "oauth_parameter_string_object.oauth_timestamp = Math.round((new Date()).getTime() / 1000);", "", "// for Authorization request header (copy object)", "const oauth_authorization_header_object = Object.assign({}, oauth_parameter_string_object);", "", "// convert query string into object (+ encode)", "const url_query_string_object = {};", "", "const url_query_string_object_array = sdk.QueryParam.parse(", " pm.request.url.getQueryString({", " ignoreDisabled: true", " })", ");", "", "url_query_string_object_array.forEach(item => {", " url_query_string_object[item.key] = encodeURIComponent(item.value);", "});", "", "// merge query parameter", "Object.assign(oauth_parameter_string_object, url_query_string_object);", "", "// sort object by key", "const oauth_parameter_string_object_ordered = {};", "Object.keys(oauth_parameter_string_object).sort().forEach(function(key) {", " oauth_parameter_string_object_ordered[key] = oauth_parameter_string_object[key];", "});", "", "// generate parameter string", "const oauth_parameter_string = toArray(oauth_parameter_string_object_ordered).join('&');", "", "// replace dynamic variables", "let base_host = pm.request.url.getOAuth1BaseUrl();", "let regexp = /{{(.*?)}}/g;", "while (result = regexp.exec(base_host)) {", " let value = env_variables[result[1]];", " base_host = base_host.replace(new RegExp(`{{${result[1]}}}`, 'g'), value);", "}", "", "// generate base string", "const oauth_base_string = `${pm.request.method}&${encodeURIComponent(base_host)}&${encodeURIComponent(oauth_parameter_string)}`;", "", "// generate signature", "const oauth_signature = CryptoJS.enc.Base64.stringify(CryptoJS.HmacSHA1(oauth_base_string, oauth_signing_key));", "", "oauth_authorization_header_object.oauth_signature = encodeURIComponent(oauth_signature);", "", "// generate Authorization header string", "const oauth_authorization_header = toArray(oauth_authorization_header_object).join(', ');", "", "// generate Authorization header", "pm.request.headers.add({", " key: 'Authorization',", " value: `OAuth ${oauth_authorization_header}`", "});", "", "// Escape URI parameters using encodeURIComponent => RFC3986", "if (Object.keys(url_query_string_object).length !== 0) {", " // generate query parameter string", " const request_parameter_string = toArray(url_query_string_object).join('&');", "", " pm.request.url = `${pm.request.url.getOAuth1BaseUrl()}?${request_parameter_string}`;", "}" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "noauth" }, "method": "POST", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/cards/image_conversation?first_cta=&first_cta_tweet=&name=&thank_you_text=", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "cards", "image_conversation" ], "query": [ { "key": "first_cta", "value": "", "description": "required" }, { "key": "first_cta_tweet", "value": "", "description": "required" }, { "key": "name", "value": "", "description": "required" }, { "key": "thank_you_text", "value": "", "description": "required" }, { "key": "media_key", "value": "", "description": "sometimes required", "disabled": true }, { "key": "second_cta", "value": "", "description": "sometimes required", "disabled": true }, { "key": "second_cta_tweet", "value": "", "description": "sometimes required", "disabled": true }, { "key": "title", "value": "", "description": "sometimes required", "disabled": true }, { "key": "unlocked_image_media_key", "value": "", "description": "optional", "disabled": true }, { "key": "third_cta", "value": "", "description": "optional", "disabled": true }, { "key": "third_cta_tweet", "value": "", "description": "sometimes required", "disabled": true }, { "key": "fourth_cta", "value": "", "description": "optional", "disabled": true }, { "key": "fourth_cta_tweet", "value": "", "description": "sometimes required", "disabled": true }, { "key": "thank_you_url", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "accounts/:account_id/cards/image_conversation/:card_id", "event": [ { "listen": "prerequest", "script": { "id": "882da559-ab62-41b1-98a0-300e007b5f30", "exec": [ "/*", " * This is a Pre-request script for Postman client to remediate OAuth 1.0a issue", " * where certain request fails if the query parameter includes some specific characters.", " * https://tools.ietf.org/html/rfc3986#section-2.2 (rfc3986, gen-delims reserved characters)", " *", " * NOTE: This Pre-script is intended to use with \"GET\" request but might be able to", " * work with other methods that have no request body.", " * For \"POST\" request, there's another workaround.", " * See: https://github.com/twitterdev/postman-twitter-ads-api/issues/2", " * ", " * In order to use this Pre-request script, you need to change your \"Authorization\" type to", " * \"No Auth\" only for the target request and do not apply to the top-level object.", " */", "", "const sdk = require('postman-collection');", "", "function toArray(object) {", " let array = [];", " Object.keys(object).forEach(key => {", " array.push(`${key}=${object[key]}`);", " });", " return array", "}", "", "// fetch all env variables that are currently defined", "const env_variables = pm.environment.toObject({", " excludeDisabled: true", "});", "", "const oauth_consumer_key = env_variables.consumer_key;", "const oauth_consumer_secret = env_variables.consumer_secret;", "const oauth_token = env_variables.access_token;", "const oauth_secret = env_variables.token_secret;", "const oauth_signing_key = `${oauth_consumer_secret}&${oauth_secret}`;", "", "// create random oauth_nonce string", "const random_source = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';", "var oauth_nonce = '';", "for (var i = 0; i < 32; i++) {", " oauth_nonce += random_source.charAt(Math.floor(Math.random() * random_source.length));", "}", "", "const oauth_parameter_string_object = {};", "oauth_parameter_string_object.oauth_consumer_key = oauth_consumer_key;", "oauth_parameter_string_object.oauth_token = oauth_token;", "const oauth_nonce_array = CryptoJS.enc.Utf8.parse(oauth_nonce);", "oauth_parameter_string_object.oauth_nonce = encodeURIComponent(CryptoJS.enc.Base64.stringify(oauth_nonce_array));", "oauth_parameter_string_object.oauth_signature_method = 'HMAC-SHA1';", "oauth_parameter_string_object.oauth_version = '1.0';", "oauth_parameter_string_object.oauth_timestamp = Math.round((new Date()).getTime() / 1000);", "", "// for Authorization request header (copy object)", "const oauth_authorization_header_object = Object.assign({}, oauth_parameter_string_object);", "", "// convert query string into object (+ encode)", "const url_query_string_object = {};", "", "const url_query_string_object_array = sdk.QueryParam.parse(", " pm.request.url.getQueryString({", " ignoreDisabled: true", " })", ");", "", "url_query_string_object_array.forEach(item => {", " url_query_string_object[item.key] = encodeURIComponent(item.value);", "});", "", "// merge query parameter", "Object.assign(oauth_parameter_string_object, url_query_string_object);", "", "// sort object by key", "const oauth_parameter_string_object_ordered = {};", "Object.keys(oauth_parameter_string_object).sort().forEach(function(key) {", " oauth_parameter_string_object_ordered[key] = oauth_parameter_string_object[key];", "});", "", "// generate parameter string", "const oauth_parameter_string = toArray(oauth_parameter_string_object_ordered).join('&');", "", "// replace dynamic variables", "let base_host = pm.request.url.getOAuth1BaseUrl();", "let regexp = /{{(.*?)}}/g;", "while (result = regexp.exec(base_host)) {", " let value = env_variables[result[1]];", " base_host = base_host.replace(new RegExp(`{{${result[1]}}}`, 'g'), value);", "}", "", "// generate base string", "const oauth_base_string = `${pm.request.method}&${encodeURIComponent(base_host)}&${encodeURIComponent(oauth_parameter_string)}`;", "", "// generate signature", "const oauth_signature = CryptoJS.enc.Base64.stringify(CryptoJS.HmacSHA1(oauth_base_string, oauth_signing_key));", "", "oauth_authorization_header_object.oauth_signature = encodeURIComponent(oauth_signature);", "", "// generate Authorization header string", "const oauth_authorization_header = toArray(oauth_authorization_header_object).join(', ');", "", "// generate Authorization header", "pm.request.headers.add({", " key: 'Authorization',", " value: `OAuth ${oauth_authorization_header}`", "});", "", "// Escape URI parameters using encodeURIComponent => RFC3986", "if (Object.keys(url_query_string_object).length !== 0) {", " // generate query parameter string", " const request_parameter_string = toArray(url_query_string_object).join('&');", "", " pm.request.url = `${pm.request.url.getOAuth1BaseUrl()}?${request_parameter_string}`;", "}" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "noauth" }, "method": "PUT", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/cards/image_conversation/:card_id?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "cards", "image_conversation", ":card_id" ], "query": [ { "key": "unlocked_image_media_key", "value": "", "description": "optional", "disabled": true }, { "key": "media_key", "value": "", "description": "optional", "disabled": true }, { "key": "first_cta", "value": "", "description": "optional", "disabled": true }, { "key": "first_cta_tweet", "value": "", "description": "optional", "disabled": true }, { "key": "second_cta", "value": "", "description": "optional", "disabled": true }, { "key": "second_cta_tweet", "value": "", "description": "optional", "disabled": true }, { "key": "third_cta", "value": "", "description": "optional", "disabled": true }, { "key": "third_cta_tweet", "value": "", "description": "optional", "disabled": true }, { "key": "fourth_cta", "value": "", "description": "optional", "disabled": true }, { "key": "fourth_cta_tweet", "value": "", "description": "optional", "disabled": true }, { "key": "name", "value": "", "description": "optional", "disabled": true }, { "key": "thank_you_text", "value": "", "description": "optional", "disabled": true }, { "key": "thank_you_url", "value": "", "description": "optional", "disabled": true }, { "key": "title", "value": "", "description": "optional", "disabled": true } ], "variable": [ { "id": "ded9e91f-2c26-48d8-8d16-0033d496bf80", "key": "card_id", "type": "any" } ] } }, "response": [] }, { "name": "accounts/:account_id/cards/image_conversation/:card_id", "request": { "method": "DELETE", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/cards/image_conversation/:card_id", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "cards", "image_conversation", ":card_id" ], "variable": [ { "id": "779e4468-7829-4edb-bb73-7443e9fcbbc1", "key": "card_id", "type": "any" } ] } }, "response": [] } ], "description": "https://developer.twitter.com/en/docs/ads/creatives/api-reference/image-conversation", "event": [ { "listen": "prerequest", "script": { "id": "86b05dbc-007e-4c6c-87bc-3d3e3e56ffbd", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "bf21ea11-35cd-4588-a9af-11617378dbcb", "type": "text/javascript", "exec": [ "" ] } } ], "_postman_isSubFolder": true }, { "name": "Image Direct Message Cards", "item": [ { "name": "accounts/:account_id/cards/image_direct_message", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/cards/image_direct_message?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "cards", "image_direct_message" ], "query": [ { "key": "card_ids", "value": "", "description": "optional", "disabled": true }, { "key": "count", "value": "", "description": "optional", "disabled": true }, { "key": "cursor", "value": "", "description": "optional", "disabled": true }, { "key": "q", "value": "", "description": "optional", "disabled": true }, { "key": "sort_by", "value": "", "description": "optional", "disabled": true }, { "key": "with_deleted", "value": "", "description": "optional", "disabled": true }, { "key": "with_total_count", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "accounts/:account_id/cards/image_direct_message/:card_id", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/cards/image_direct_message/:card_id?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "cards", "image_direct_message", ":card_id" ], "query": [ { "key": "with_deleted", "value": "", "description": "optional", "disabled": true } ], "variable": [ { "id": "2a631b9b-77fb-49f9-ba3f-97831bfc6729", "key": "card_id", "type": "any" } ] } }, "response": [] }, { "name": "accounts/:account_id/cards/image_direct_message", "request": { "method": "POST", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/cards/image_direct_message?first_cta=&first_cta_welcome_message_id=&name=&recipient_user_id=", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "cards", "image_direct_message" ], "query": [ { "key": "first_cta", "value": "", "description": "required" }, { "key": "first_cta_welcome_message_id", "value": "", "description": "required" }, { "key": "name", "value": "", "description": "required" }, { "key": "recipient_user_id", "value": "", "description": "required" }, { "key": "media_key", "value": "", "description": "sometimes required", "disabled": true }, { "key": "second_cta", "value": "", "description": "optional", "disabled": true }, { "key": "second_cta_welcome_message_id", "value": "", "description": "optional", "disabled": true }, { "key": "third_cta", "value": "", "description": "optional", "disabled": true }, { "key": "third_cta_welcome_message_id", "value": "", "description": "optional", "disabled": true }, { "key": "fourth_cta", "value": "", "description": "optional", "disabled": true }, { "key": "fourth_cta_welcome_message_id", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "accounts/:account_id/cards/image_direct_message", "request": { "method": "PUT", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/cards/image_direct_message?card_id=", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "cards", "image_direct_message" ], "query": [ { "key": "card_id", "value": "", "description": "required" }, { "key": "first_cta", "value": "", "description": "optional", "disabled": true }, { "key": "first_cta_welcome_message_id", "value": "", "description": "optional", "disabled": true }, { "key": "media_key", "value": "", "description": "optional", "disabled": true }, { "key": "second_cta", "value": "", "description": "optional", "disabled": true }, { "key": "second_cta_welcome_message_id", "value": "", "description": "optional", "disabled": true }, { "key": "third_cta", "value": "", "description": "optional", "disabled": true }, { "key": "third_cta_welcome_message_id", "value": "", "description": "optional", "disabled": true }, { "key": "fourth_cta", "value": "", "description": "optional", "disabled": true }, { "key": "fourth_cta_welcome_message_id", "value": "", "description": "optional", "disabled": true }, { "key": "name", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "accounts/:account_id/cards/image_direct_message/:card_id", "request": { "method": "DELETE", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/cards/image_direct_message/:card_id", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "cards", "image_direct_message", ":card_id" ], "variable": [ { "id": "100888d5-bf93-4694-b4ad-a6909ce018d8", "key": "card_id", "type": "any" } ] } }, "response": [] } ], "description": "https://developer.twitter.com/en/docs/ads/creatives/api-reference/image-direct-message", "event": [ { "listen": "prerequest", "script": { "id": "edb8a31b-b548-4b48-856b-1271afe42769", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "a8d6f5bb-7e99-4467-a160-26ad5c2c57da", "type": "text/javascript", "exec": [ "" ] } } ], "_postman_isSubFolder": true }, { "name": "Video App Download Cards", "item": [ { "name": "accounts/:account_id/cards/video_app_download", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/cards/video_app_download?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "cards", "video_app_download" ], "query": [ { "key": "card_ids", "value": "", "description": "optional", "disabled": true }, { "key": "count", "value": "", "description": "optional", "disabled": true }, { "key": "cursor", "value": "", "description": "optional", "disabled": true }, { "key": "q", "value": "", "description": "optional", "disabled": true }, { "key": "sort_by", "value": "", "description": "optional", "disabled": true }, { "key": "with_deleted", "value": "", "description": "optional", "disabled": true }, { "key": "with_total_count", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "accounts/:account_id/cards/video_app_download/:card_id", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/cards/video_app_download/:card_id?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "cards", "video_app_download", ":card_id" ], "query": [ { "key": "with_deleted", "value": "", "description": "optional", "disabled": true } ], "variable": [ { "id": "0c4f0b7d-782f-4892-b884-5f8947e4f89c", "key": "card_id", "type": "any" } ] } }, "response": [] }, { "name": "accounts/:account_id/cards/video_app_download", "event": [ { "listen": "prerequest", "script": { "id": "e60dfe84-de54-4bc1-b787-07146a549c3b", "exec": [ "/*", " * This is a Pre-request script for Postman client to remediate OAuth 1.0a issue", " * where certain request fails if the query parameter includes some specific characters.", " * https://tools.ietf.org/html/rfc3986#section-2.2 (rfc3986, gen-delims reserved characters)", " *", " * NOTE: This Pre-script is intended to use with \"GET\" request but might be able to", " * work with other methods that have no request body.", " * For \"POST\" request, there's another workaround.", " * See: https://github.com/twitterdev/postman-twitter-ads-api/issues/2", " * ", " * In order to use this Pre-request script, you need to change your \"Authorization\" type to", " * \"No Auth\" only for the target request and do not apply to the top-level object.", " */", "", "const sdk = require('postman-collection');", "", "function toArray(object) {", " let array = [];", " Object.keys(object).forEach(key => {", " array.push(`${key}=${object[key]}`);", " });", " return array", "}", "", "// fetch all env variables that are currently defined", "const env_variables = pm.environment.toObject({", " excludeDisabled: true", "});", "", "const oauth_consumer_key = env_variables.consumer_key;", "const oauth_consumer_secret = env_variables.consumer_secret;", "const oauth_token = env_variables.access_token;", "const oauth_secret = env_variables.token_secret;", "const oauth_signing_key = `${oauth_consumer_secret}&${oauth_secret}`;", "", "// create random oauth_nonce string", "const random_source = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';", "var oauth_nonce = '';", "for (var i = 0; i < 32; i++) {", " oauth_nonce += random_source.charAt(Math.floor(Math.random() * random_source.length));", "}", "", "const oauth_parameter_string_object = {};", "oauth_parameter_string_object.oauth_consumer_key = oauth_consumer_key;", "oauth_parameter_string_object.oauth_token = oauth_token;", "const oauth_nonce_array = CryptoJS.enc.Utf8.parse(oauth_nonce);", "oauth_parameter_string_object.oauth_nonce = encodeURIComponent(CryptoJS.enc.Base64.stringify(oauth_nonce_array));", "oauth_parameter_string_object.oauth_signature_method = 'HMAC-SHA1';", "oauth_parameter_string_object.oauth_version = '1.0';", "oauth_parameter_string_object.oauth_timestamp = Math.round((new Date()).getTime() / 1000);", "", "// for Authorization request header (copy object)", "const oauth_authorization_header_object = Object.assign({}, oauth_parameter_string_object);", "", "// convert query string into object (+ encode)", "const url_query_string_object = {};", "", "const url_query_string_object_array = sdk.QueryParam.parse(", " pm.request.url.getQueryString({", " ignoreDisabled: true", " })", ");", "", "url_query_string_object_array.forEach(item => {", " url_query_string_object[item.key] = encodeURIComponent(item.value);", "});", "", "// merge query parameter", "Object.assign(oauth_parameter_string_object, url_query_string_object);", "", "// sort object by key", "const oauth_parameter_string_object_ordered = {};", "Object.keys(oauth_parameter_string_object).sort().forEach(function(key) {", " oauth_parameter_string_object_ordered[key] = oauth_parameter_string_object[key];", "});", "", "// generate parameter string", "const oauth_parameter_string = toArray(oauth_parameter_string_object_ordered).join('&');", "", "// replace dynamic variables", "let base_host = pm.request.url.getOAuth1BaseUrl();", "let regexp = /{{(.*?)}}/g;", "while (result = regexp.exec(base_host)) {", " let value = env_variables[result[1]];", " base_host = base_host.replace(new RegExp(`{{${result[1]}}}`, 'g'), value);", "}", "", "// generate base string", "const oauth_base_string = `${pm.request.method}&${encodeURIComponent(base_host)}&${encodeURIComponent(oauth_parameter_string)}`;", "", "// generate signature", "const oauth_signature = CryptoJS.enc.Base64.stringify(CryptoJS.HmacSHA1(oauth_base_string, oauth_signing_key));", "", "oauth_authorization_header_object.oauth_signature = encodeURIComponent(oauth_signature);", "", "// generate Authorization header string", "const oauth_authorization_header = toArray(oauth_authorization_header_object).join(', ');", "", "// generate Authorization header", "pm.request.headers.add({", " key: 'Authorization',", " value: `OAuth ${oauth_authorization_header}`", "});", "", "// Escape URI parameters using encodeURIComponent => RFC3986", "if (Object.keys(url_query_string_object).length !== 0) {", " // generate query parameter string", " const request_parameter_string = toArray(url_query_string_object).join('&');", "", " pm.request.url = `${pm.request.url.getOAuth1BaseUrl()}?${request_parameter_string}`;", "}" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "noauth" }, "method": "POST", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/cards/video_app_download?country_code=&name=&media_key", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "cards", "video_app_download" ], "query": [ { "key": "country_code", "value": "", "description": "required" }, { "key": "name", "value": "", "description": "required" }, { "key": "media_key", "value": "", "description": "required" }, { "key": "ipad_app_id", "value": "", "description": "sometimes required", "disabled": true }, { "key": "iphone_app_id", "value": "", "description": "sometimes required", "disabled": true }, { "key": "googleplay_app_id", "value": "", "description": "sometimes required", "disabled": true }, { "key": "app_cta", "value": "", "description": "optional", "disabled": true }, { "key": "ipad_deep_link", "value": "", "description": "optional", "disabled": true }, { "key": "iphone_deep_link", "value": "", "description": "optional", "disabled": true }, { "key": "googleplay_deep_link", "value": "", "description": "optional", "disabled": true }, { "key": "poster_media_key", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "accounts/:account_id/cards/video_app_download/:card_id", "event": [ { "listen": "prerequest", "script": { "id": "55a6960c-eef7-4301-849b-c56235de0ffe", "exec": [ "/*", " * This is a Pre-request script for Postman client to remediate OAuth 1.0a issue", " * where certain request fails if the query parameter includes some specific characters.", " * https://tools.ietf.org/html/rfc3986#section-2.2 (rfc3986, gen-delims reserved characters)", " *", " * NOTE: This Pre-script is intended to use with \"GET\" request but might be able to", " * work with other methods that have no request body.", " * For \"POST\" request, there's another workaround.", " * See: https://github.com/twitterdev/postman-twitter-ads-api/issues/2", " * ", " * In order to use this Pre-request script, you need to change your \"Authorization\" type to", " * \"No Auth\" only for the target request and do not apply to the top-level object.", " */", "", "const sdk = require('postman-collection');", "", "function toArray(object) {", " let array = [];", " Object.keys(object).forEach(key => {", " array.push(`${key}=${object[key]}`);", " });", " return array", "}", "", "// fetch all env variables that are currently defined", "const env_variables = pm.environment.toObject({", " excludeDisabled: true", "});", "", "const oauth_consumer_key = env_variables.consumer_key;", "const oauth_consumer_secret = env_variables.consumer_secret;", "const oauth_token = env_variables.access_token;", "const oauth_secret = env_variables.token_secret;", "const oauth_signing_key = `${oauth_consumer_secret}&${oauth_secret}`;", "", "// create random oauth_nonce string", "const random_source = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';", "var oauth_nonce = '';", "for (var i = 0; i < 32; i++) {", " oauth_nonce += random_source.charAt(Math.floor(Math.random() * random_source.length));", "}", "", "const oauth_parameter_string_object = {};", "oauth_parameter_string_object.oauth_consumer_key = oauth_consumer_key;", "oauth_parameter_string_object.oauth_token = oauth_token;", "const oauth_nonce_array = CryptoJS.enc.Utf8.parse(oauth_nonce);", "oauth_parameter_string_object.oauth_nonce = encodeURIComponent(CryptoJS.enc.Base64.stringify(oauth_nonce_array));", "oauth_parameter_string_object.oauth_signature_method = 'HMAC-SHA1';", "oauth_parameter_string_object.oauth_version = '1.0';", "oauth_parameter_string_object.oauth_timestamp = Math.round((new Date()).getTime() / 1000);", "", "// for Authorization request header (copy object)", "const oauth_authorization_header_object = Object.assign({}, oauth_parameter_string_object);", "", "// convert query string into object (+ encode)", "const url_query_string_object = {};", "", "const url_query_string_object_array = sdk.QueryParam.parse(", " pm.request.url.getQueryString({", " ignoreDisabled: true", " })", ");", "", "url_query_string_object_array.forEach(item => {", " url_query_string_object[item.key] = encodeURIComponent(item.value);", "});", "", "// merge query parameter", "Object.assign(oauth_parameter_string_object, url_query_string_object);", "", "// sort object by key", "const oauth_parameter_string_object_ordered = {};", "Object.keys(oauth_parameter_string_object).sort().forEach(function(key) {", " oauth_parameter_string_object_ordered[key] = oauth_parameter_string_object[key];", "});", "", "// generate parameter string", "const oauth_parameter_string = toArray(oauth_parameter_string_object_ordered).join('&');", "", "// replace dynamic variables", "let base_host = pm.request.url.getOAuth1BaseUrl();", "let regexp = /{{(.*?)}}/g;", "while (result = regexp.exec(base_host)) {", " let value = env_variables[result[1]];", " base_host = base_host.replace(new RegExp(`{{${result[1]}}}`, 'g'), value);", "}", "", "// generate base string", "const oauth_base_string = `${pm.request.method}&${encodeURIComponent(base_host)}&${encodeURIComponent(oauth_parameter_string)}`;", "", "// generate signature", "const oauth_signature = CryptoJS.enc.Base64.stringify(CryptoJS.HmacSHA1(oauth_base_string, oauth_signing_key));", "", "oauth_authorization_header_object.oauth_signature = encodeURIComponent(oauth_signature);", "", "// generate Authorization header string", "const oauth_authorization_header = toArray(oauth_authorization_header_object).join(', ');", "", "// generate Authorization header", "pm.request.headers.add({", " key: 'Authorization',", " value: `OAuth ${oauth_authorization_header}`", "});", "", "// Escape URI parameters using encodeURIComponent => RFC3986", "if (Object.keys(url_query_string_object).length !== 0) {", " // generate query parameter string", " const request_parameter_string = toArray(url_query_string_object).join('&');", "", " pm.request.url = `${pm.request.url.getOAuth1BaseUrl()}?${request_parameter_string}`;", "}" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "noauth" }, "method": "PUT", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/cards/video_app_download/:card_id?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "cards", "video_app_download", ":card_id" ], "query": [ { "key": "country_code", "value": "", "description": "optional", "disabled": true }, { "key": "app_cta", "value": "", "description": "optional", "disabled": true }, { "key": "ipad_app_id", "value": "", "description": "optional", "disabled": true }, { "key": "ipad_deep_link", "value": "", "description": "optional", "disabled": true }, { "key": "iphone_app_id", "value": "", "description": "optional", "disabled": true }, { "key": "iphone_deep_link", "value": "", "description": "optional", "disabled": true }, { "key": "googleplay_app_id", "value": "", "description": "optional", "disabled": true }, { "key": "googleplay_deep_link", "value": "", "description": "optional", "disabled": true }, { "key": "poster_media_key", "value": "", "description": "optional", "disabled": true }, { "key": "name", "value": "", "description": "optional", "disabled": true }, { "key": "media_key", "value": "", "description": "optional", "disabled": true } ], "variable": [ { "id": "4191812c-7303-4b38-acee-ba7e2fd589a8", "key": "card_id", "type": "any" } ] } }, "response": [] }, { "name": "accounts/:account_id/cards/video_app_download/:card_id", "request": { "method": "DELETE", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/cards/video_app_download/:card_id", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "cards", "video_app_download", ":card_id" ], "variable": [ { "id": "82b2dafb-9a7f-4083-8ff7-44b5b027d0d4", "key": "card_id", "type": "any" } ] } }, "response": [] } ], "description": "https://developer.twitter.com/en/docs/ads/creatives/api-reference/video-app-download", "event": [ { "listen": "prerequest", "script": { "id": "53b1d415-699d-4f0e-bc56-f629aee66e10", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "bacbd78c-9033-48a6-8dd3-392a21ea5ed7", "type": "text/javascript", "exec": [ "" ] } } ], "_postman_isSubFolder": true }, { "name": "Video Conversation Cards", "item": [ { "name": "accounts/:account_id/cards/video_conversation", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/cards/video_conversation?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "cards", "video_conversation" ], "query": [ { "key": "card_ids", "value": "", "description": "optional", "disabled": true }, { "key": "count", "value": "", "description": "optional", "disabled": true }, { "key": "cursor", "value": "", "description": "optional", "disabled": true }, { "key": "q", "value": "", "description": "optional", "disabled": true }, { "key": "sort_by", "value": "", "description": "optional", "disabled": true }, { "key": "with_deleted", "value": "", "description": "optional", "disabled": true }, { "key": "with_total_count", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "accounts/:account_id/cards/video_conversation/:card_id", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/cards/video_conversation/:card_id?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "cards", "video_conversation", ":card_id" ], "query": [ { "key": "with_deleted", "value": "", "description": "optional", "disabled": true } ], "variable": [ { "id": "9c9297d0-9e9c-4a31-844c-9b4e092aed92", "key": "card_id", "type": "any" } ] } }, "response": [] }, { "name": "accounts/:account_id/cards/video_conversation", "event": [ { "listen": "prerequest", "script": { "id": "4004e10f-cb90-48b7-bd05-9ae71f147f47", "exec": [ "/*", " * This is a Pre-request script for Postman client to remediate OAuth 1.0a issue", " * where certain request fails if the query parameter includes some specific characters.", " * https://tools.ietf.org/html/rfc3986#section-2.2 (rfc3986, gen-delims reserved characters)", " *", " * NOTE: This Pre-script is intended to use with \"GET\" request but might be able to", " * work with other methods that have no request body.", " * For \"POST\" request, there's another workaround.", " * See: https://github.com/twitterdev/postman-twitter-ads-api/issues/2", " * ", " * In order to use this Pre-request script, you need to change your \"Authorization\" type to", " * \"No Auth\" only for the target request and do not apply to the top-level object.", " */", "", "const sdk = require('postman-collection');", "", "function toArray(object) {", " let array = [];", " Object.keys(object).forEach(key => {", " array.push(`${key}=${object[key]}`);", " });", " return array", "}", "", "// fetch all env variables that are currently defined", "const env_variables = pm.environment.toObject({", " excludeDisabled: true", "});", "", "const oauth_consumer_key = env_variables.consumer_key;", "const oauth_consumer_secret = env_variables.consumer_secret;", "const oauth_token = env_variables.access_token;", "const oauth_secret = env_variables.token_secret;", "const oauth_signing_key = `${oauth_consumer_secret}&${oauth_secret}`;", "", "// create random oauth_nonce string", "const random_source = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';", "var oauth_nonce = '';", "for (var i = 0; i < 32; i++) {", " oauth_nonce += random_source.charAt(Math.floor(Math.random() * random_source.length));", "}", "", "const oauth_parameter_string_object = {};", "oauth_parameter_string_object.oauth_consumer_key = oauth_consumer_key;", "oauth_parameter_string_object.oauth_token = oauth_token;", "const oauth_nonce_array = CryptoJS.enc.Utf8.parse(oauth_nonce);", "oauth_parameter_string_object.oauth_nonce = encodeURIComponent(CryptoJS.enc.Base64.stringify(oauth_nonce_array));", "oauth_parameter_string_object.oauth_signature_method = 'HMAC-SHA1';", "oauth_parameter_string_object.oauth_version = '1.0';", "oauth_parameter_string_object.oauth_timestamp = Math.round((new Date()).getTime() / 1000);", "", "// for Authorization request header (copy object)", "const oauth_authorization_header_object = Object.assign({}, oauth_parameter_string_object);", "", "// convert query string into object (+ encode)", "const url_query_string_object = {};", "", "const url_query_string_object_array = sdk.QueryParam.parse(", " pm.request.url.getQueryString({", " ignoreDisabled: true", " })", ");", "", "url_query_string_object_array.forEach(item => {", " url_query_string_object[item.key] = encodeURIComponent(item.value);", "});", "", "// merge query parameter", "Object.assign(oauth_parameter_string_object, url_query_string_object);", "", "// sort object by key", "const oauth_parameter_string_object_ordered = {};", "Object.keys(oauth_parameter_string_object).sort().forEach(function(key) {", " oauth_parameter_string_object_ordered[key] = oauth_parameter_string_object[key];", "});", "", "// generate parameter string", "const oauth_parameter_string = toArray(oauth_parameter_string_object_ordered).join('&');", "", "// replace dynamic variables", "let base_host = pm.request.url.getOAuth1BaseUrl();", "let regexp = /{{(.*?)}}/g;", "while (result = regexp.exec(base_host)) {", " let value = env_variables[result[1]];", " base_host = base_host.replace(new RegExp(`{{${result[1]}}}`, 'g'), value);", "}", "", "// generate base string", "const oauth_base_string = `${pm.request.method}&${encodeURIComponent(base_host)}&${encodeURIComponent(oauth_parameter_string)}`;", "", "// generate signature", "const oauth_signature = CryptoJS.enc.Base64.stringify(CryptoJS.HmacSHA1(oauth_base_string, oauth_signing_key));", "", "oauth_authorization_header_object.oauth_signature = encodeURIComponent(oauth_signature);", "", "// generate Authorization header string", "const oauth_authorization_header = toArray(oauth_authorization_header_object).join(', ');", "", "// generate Authorization header", "pm.request.headers.add({", " key: 'Authorization',", " value: `OAuth ${oauth_authorization_header}`", "});", "", "// Escape URI parameters using encodeURIComponent => RFC3986", "if (Object.keys(url_query_string_object).length !== 0) {", " // generate query parameter string", " const request_parameter_string = toArray(url_query_string_object).join('&');", "", " pm.request.url = `${pm.request.url.getOAuth1BaseUrl()}?${request_parameter_string}`;", "}" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "noauth" }, "method": "POST", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/cards/video_conversation?first_cta=&first_cta_tweet=&name=&thank_you_text=&media_key", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "cards", "video_conversation" ], "query": [ { "key": "first_cta", "value": "", "description": "required" }, { "key": "first_cta_tweet", "value": "", "description": "required" }, { "key": "name", "value": "", "description": "required" }, { "key": "thank_you_text", "value": "", "description": "required" }, { "key": "media_key", "value": "", "description": "required" }, { "key": "title", "value": "", "description": "sometimes required", "disabled": true }, { "key": "second_cta", "value": "", "description": "sometimes required", "disabled": true }, { "key": "second_cta_tweet", "value": "", "description": "sometimes required", "disabled": true }, { "key": "unlocked_image_media_key", "value": "", "description": "optional", "disabled": true }, { "key": "unlocked_video_media_key", "value": "", "description": "optional", "disabled": true }, { "key": "poster_media_key", "value": "", "description": "optional", "disabled": true }, { "key": "third_cta", "value": "", "description": "optional", "disabled": true }, { "key": "third_cta_tweet", "value": "", "description": "sometimes required", "disabled": true }, { "key": "fourth_cta", "value": "", "description": "optional", "disabled": true }, { "key": "fourth_cta_tweet", "value": "", "description": "sometimes required", "disabled": true }, { "key": "thank_you_url", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "accounts/:account_id/cards/video_conversation/:card_id", "event": [ { "listen": "prerequest", "script": { "id": "3925bc4d-2292-4a5e-af73-a2d54e411e85", "exec": [ "/*", " * This is a Pre-request script for Postman client to remediate OAuth 1.0a issue", " * where certain request fails if the query parameter includes some specific characters.", " * https://tools.ietf.org/html/rfc3986#section-2.2 (rfc3986, gen-delims reserved characters)", " *", " * NOTE: This Pre-script is intended to use with \"GET\" request but might be able to", " * work with other methods that have no request body.", " * For \"POST\" request, there's another workaround.", " * See: https://github.com/twitterdev/postman-twitter-ads-api/issues/2", " * ", " * In order to use this Pre-request script, you need to change your \"Authorization\" type to", " * \"No Auth\" only for the target request and do not apply to the top-level object.", " */", "", "const sdk = require('postman-collection');", "", "function toArray(object) {", " let array = [];", " Object.keys(object).forEach(key => {", " array.push(`${key}=${object[key]}`);", " });", " return array", "}", "", "// fetch all env variables that are currently defined", "const env_variables = pm.environment.toObject({", " excludeDisabled: true", "});", "", "const oauth_consumer_key = env_variables.consumer_key;", "const oauth_consumer_secret = env_variables.consumer_secret;", "const oauth_token = env_variables.access_token;", "const oauth_secret = env_variables.token_secret;", "const oauth_signing_key = `${oauth_consumer_secret}&${oauth_secret}`;", "", "// create random oauth_nonce string", "const random_source = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';", "var oauth_nonce = '';", "for (var i = 0; i < 32; i++) {", " oauth_nonce += random_source.charAt(Math.floor(Math.random() * random_source.length));", "}", "", "const oauth_parameter_string_object = {};", "oauth_parameter_string_object.oauth_consumer_key = oauth_consumer_key;", "oauth_parameter_string_object.oauth_token = oauth_token;", "const oauth_nonce_array = CryptoJS.enc.Utf8.parse(oauth_nonce);", "oauth_parameter_string_object.oauth_nonce = encodeURIComponent(CryptoJS.enc.Base64.stringify(oauth_nonce_array));", "oauth_parameter_string_object.oauth_signature_method = 'HMAC-SHA1';", "oauth_parameter_string_object.oauth_version = '1.0';", "oauth_parameter_string_object.oauth_timestamp = Math.round((new Date()).getTime() / 1000);", "", "// for Authorization request header (copy object)", "const oauth_authorization_header_object = Object.assign({}, oauth_parameter_string_object);", "", "// convert query string into object (+ encode)", "const url_query_string_object = {};", "", "const url_query_string_object_array = sdk.QueryParam.parse(", " pm.request.url.getQueryString({", " ignoreDisabled: true", " })", ");", "", "url_query_string_object_array.forEach(item => {", " url_query_string_object[item.key] = encodeURIComponent(item.value);", "});", "", "// merge query parameter", "Object.assign(oauth_parameter_string_object, url_query_string_object);", "", "// sort object by key", "const oauth_parameter_string_object_ordered = {};", "Object.keys(oauth_parameter_string_object).sort().forEach(function(key) {", " oauth_parameter_string_object_ordered[key] = oauth_parameter_string_object[key];", "});", "", "// generate parameter string", "const oauth_parameter_string = toArray(oauth_parameter_string_object_ordered).join('&');", "", "// replace dynamic variables", "let base_host = pm.request.url.getOAuth1BaseUrl();", "let regexp = /{{(.*?)}}/g;", "while (result = regexp.exec(base_host)) {", " let value = env_variables[result[1]];", " base_host = base_host.replace(new RegExp(`{{${result[1]}}}`, 'g'), value);", "}", "", "// generate base string", "const oauth_base_string = `${pm.request.method}&${encodeURIComponent(base_host)}&${encodeURIComponent(oauth_parameter_string)}`;", "", "// generate signature", "const oauth_signature = CryptoJS.enc.Base64.stringify(CryptoJS.HmacSHA1(oauth_base_string, oauth_signing_key));", "", "oauth_authorization_header_object.oauth_signature = encodeURIComponent(oauth_signature);", "", "// generate Authorization header string", "const oauth_authorization_header = toArray(oauth_authorization_header_object).join(', ');", "", "// generate Authorization header", "pm.request.headers.add({", " key: 'Authorization',", " value: `OAuth ${oauth_authorization_header}`", "});", "", "// Escape URI parameters using encodeURIComponent => RFC3986", "if (Object.keys(url_query_string_object).length !== 0) {", " // generate query parameter string", " const request_parameter_string = toArray(url_query_string_object).join('&');", "", " pm.request.url = `${pm.request.url.getOAuth1BaseUrl()}?${request_parameter_string}`;", "}" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "noauth" }, "method": "PUT", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/cards/video_conversation/:card_id?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "cards", "video_conversation", ":card_id" ], "query": [ { "key": "unlocked_image_media_key", "value": "", "description": "optional", "disabled": true }, { "key": "unlocked_video_media_key", "value": "", "description": "optional", "disabled": true }, { "key": "poster_media_key", "value": "", "description": "optional", "disabled": true }, { "key": "first_cta", "value": "", "description": "optional", "disabled": true }, { "key": "first_cta_tweet", "value": "", "description": "optional", "disabled": true }, { "key": "second_cta", "value": "", "description": "optional", "disabled": true }, { "key": "second_cta_tweet", "value": "", "description": "optional", "disabled": true }, { "key": "third_cta", "value": "", "description": "optional", "disabled": true }, { "key": "third_cta_tweet", "value": "", "description": "optional", "disabled": true }, { "key": "fourth_cta", "value": "", "description": "optional", "disabled": true }, { "key": "fourth_cta_tweet", "value": "", "description": "optional", "disabled": true }, { "key": "name", "value": "", "description": "optional", "disabled": true }, { "key": "thank_you_text", "value": "", "description": "optional", "disabled": true }, { "key": "thank_you_url", "value": "", "description": "optional", "disabled": true }, { "key": "title", "value": "", "description": "optional", "disabled": true }, { "key": "media_key", "value": "", "description": "optional", "disabled": true } ], "variable": [ { "id": "2177e001-628f-41b8-a02b-57288dc79325", "key": "card_id", "type": "any" } ] } }, "response": [] }, { "name": "accounts/:account_id/cards/video_conversation/:card_id", "request": { "method": "DELETE", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/cards/video_conversation/:card_id", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "cards", "video_conversation", ":card_id" ], "variable": [ { "id": "016ff87b-dd04-41ec-a9a7-f588c9b8cad8", "key": "card_id", "type": "any" } ] } }, "response": [] } ], "description": "https://developer.twitter.com/en/docs/ads/creatives/api-reference/video-conversation", "event": [ { "listen": "prerequest", "script": { "id": "51680aca-5190-426e-8e58-3c530b265c12", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "4007f904-559d-4c00-aff5-3d971a558736", "type": "text/javascript", "exec": [ "" ] } } ], "_postman_isSubFolder": true }, { "name": "Video Direct Message Cards", "item": [ { "name": "accounts/:account_id/cards/video_direct_message", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/cards/video_direct_message?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "cards", "video_direct_message" ], "query": [ { "key": "card_ids", "value": "", "description": "optional", "disabled": true }, { "key": "count", "value": "", "description": "optional", "disabled": true }, { "key": "cursor", "value": "", "description": "optional", "disabled": true }, { "key": "q", "value": "", "description": "optional", "disabled": true }, { "key": "sort_by", "value": "", "description": "optional", "disabled": true }, { "key": "with_deleted", "value": "", "description": "optional", "disabled": true }, { "key": "with_total_count", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "accounts/:account_id/cards/video_direct_message/:card_id", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/cards/video_direct_message/:card_id?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "cards", "video_direct_message", ":card_id" ], "query": [ { "key": "with_deleted", "value": "", "description": "optional", "disabled": true } ], "variable": [ { "id": "cb5d06fc-e4c5-4973-84f4-6f43f89392bf", "key": "card_id", "type": "any" } ] } }, "response": [] }, { "name": "accounts/:account_id/cards/video_direct_message", "request": { "method": "POST", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/cards/video_direct_message?first_cta=&first_cta_welcome_message_id=&name=&recipient_user_id=&media_key", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "cards", "video_direct_message" ], "query": [ { "key": "first_cta", "value": "", "description": "required" }, { "key": "first_cta_welcome_message_id", "value": "", "description": "required" }, { "key": "name", "value": "", "description": "required" }, { "key": "recipient_user_id", "value": "", "description": "required" }, { "key": "media_key", "value": "", "description": "required" }, { "key": "poster_media_key", "value": "", "description": "optional", "disabled": true }, { "key": "second_cta", "value": "", "description": "optional", "disabled": true }, { "key": "second_cta_welcome_message_id", "value": "", "description": "optional", "disabled": true }, { "key": "third_cta", "value": "", "description": "optional", "disabled": true }, { "key": "third_cta_welcome_message_id", "value": "", "description": "optional", "disabled": true }, { "key": "fourth_cta", "value": "", "description": "optional", "disabled": true }, { "key": "fourth_cta_welcome_message_id", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "accounts/:account_id/cards/video_direct_message/:card_id", "request": { "method": "PUT", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/cards/video_direct_message/:card_id?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "cards", "video_direct_message", ":card_id" ], "query": [ { "key": "poster_media_key", "value": "", "description": "optional", "disabled": true }, { "key": "first_cta", "value": "", "description": "optional", "disabled": true }, { "key": "first_cta_welcome_message_id", "value": "", "description": "optional", "disabled": true }, { "key": "second_cta", "value": "", "description": "optional", "disabled": true }, { "key": "second_cta_welcome_message_id", "value": "", "description": "optional", "disabled": true }, { "key": "third_cta", "value": "", "description": "optional", "disabled": true }, { "key": "third_cta_welcome_message_id", "value": "", "description": "optional", "disabled": true }, { "key": "fourth_cta", "value": "", "description": "optional", "disabled": true }, { "key": "fourth_cta_welcome_message_id", "value": "", "description": "optional", "disabled": true }, { "key": "name", "value": "", "description": "optional", "disabled": true }, { "key": "media_key", "value": "", "description": "optional", "disabled": true } ], "variable": [ { "id": "154a888a-3320-4588-ba79-95ae8fd558f6", "key": "card_id", "type": "any" } ] } }, "response": [] }, { "name": "accounts/:account_id/cards/video_direct_message/:card_id", "request": { "method": "DELETE", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/cards/video_direct_message/:card_id", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "cards", "video_direct_message", ":card_id" ], "variable": [ { "id": "414fd31e-79b7-45e0-8479-e406e1d1f771", "key": "card_id", "type": "any" } ] } }, "response": [] } ], "description": "https://developer.twitter.com/en/docs/ads/creatives/api-reference/video-direct-message", "event": [ { "listen": "prerequest", "script": { "id": "d8243cf9-f672-4082-85b0-e0eaf00e96fc", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "d12112b0-89db-4845-bd33-a10fb34a8912", "type": "text/javascript", "exec": [ "" ] } } ], "_postman_isSubFolder": true }, { "name": "Media Library", "item": [ { "name": "accounts/:account_id/media_library", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/media_library?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "media_library" ], "query": [ { "key": "count", "value": "", "description": "optional", "disabled": true }, { "key": "cursor", "value": "", "description": "optional", "disabled": true }, { "key": "media_type", "value": "", "description": "optional", "disabled": true }, { "key": "q", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "accounts/:account_id/media_library/:media_key", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/media_library/:media_key", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "media_library", ":media_key" ], "variable": [ { "id": "86873a80-3b9e-4004-8dc7-45fd287ce326", "key": "media_key", "type": "any" } ] } }, "response": [] }, { "name": "accounts/:account_id/media_library", "request": { "method": "POST", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/media_library?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "media_library" ], "query": [ { "key": "media_key", "value": "", "description": "sometimes required", "disabled": true }, { "key": "description", "value": "", "description": "optional", "disabled": true }, { "key": "file_name", "value": "", "description": "optional", "disabled": true }, { "key": "name", "value": "", "description": "optional", "disabled": true }, { "key": "poster_media_key", "value": "", "description": "optional", "disabled": true }, { "key": "title", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "accounts/:account_id/media_library/:media_key", "request": { "method": "PUT", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/media_library/:media_key?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "media_library", ":media_key" ], "query": [ { "key": "description", "value": "", "description": "optional", "disabled": true }, { "key": "file_name", "value": "", "description": "optional", "disabled": true }, { "key": "name", "value": "", "description": "optional", "disabled": true }, { "key": "poster_media_key", "value": "", "description": "optional", "disabled": true }, { "key": "title", "value": "", "description": "optional", "disabled": true } ], "variable": [ { "id": "47b496cb-3416-435d-9ce2-e846113d0cb5", "key": "media_key", "type": "any" } ] } }, "response": [] }, { "name": "accounts/:account_id/media_library/:media_key", "request": { "method": "DELETE", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/media_library/:media_key", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "media_library", ":media_key" ], "variable": [ { "id": "21a8320d-e50b-46ce-bb3a-6e95efac912c", "key": "media_key", "type": "any" } ] } }, "response": [] } ], "description": "https://developer.twitter.com/en/docs/ads/creatives/api-reference/media-library", "event": [ { "listen": "prerequest", "script": { "id": "d79c9545-6611-43ad-8198-b655b36e23f3", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "2627768d-50d4-4c8c-924e-df7239b265e4", "type": "text/javascript", "exec": [ "" ] } } ], "_postman_isSubFolder": true }, { "name": "Poll Cards", "item": [ { "name": "accounts/:account_id/cards/poll", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/cards/poll?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "cards", "poll" ], "query": [ { "key": "card_ids", "value": "", "description": "optional", "disabled": true }, { "key": "count", "value": "", "description": "optional", "disabled": true }, { "key": "cursor", "value": "", "description": "optional", "disabled": true }, { "key": "q", "value": "", "description": "optional", "disabled": true }, { "key": "sort_by", "value": "", "description": "optional", "disabled": true }, { "key": "with_deleted", "value": "", "description": "optional", "disabled": true }, { "key": "with_total_count", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "accounts/:account_id/cards/poll/:card_id", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/cards/poll/:card_id?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "cards", "poll", ":card_id" ], "query": [ { "key": "with_deleted", "value": "", "description": "optional", "disabled": true } ], "variable": [ { "id": "debef539-5b88-4d5f-b144-72ad36a45d11", "key": "card_id", "type": "any" } ] } }, "response": [] }, { "name": "accounts/:account_id/cards/poll", "request": { "method": "POST", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/cards/poll?duration_in_minutes=&first_choice=&name=&second_choice=", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "cards", "poll" ], "query": [ { "key": "duration_in_minutes", "value": "", "description": "required" }, { "key": "first_choice", "value": "", "description": "required" }, { "key": "name", "value": "", "description": "required" }, { "key": "second_choice", "value": "", "description": "required" }, { "key": "fourth_choice", "value": "", "description": "optional", "disabled": true }, { "key": "media_key", "value": "", "description": "optional", "disabled": true }, { "key": "third_choice", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "accounts/:account_id/cards/poll/:card_id", "request": { "method": "DELETE", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/cards/poll/:card_id", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "cards", "poll", ":card_id" ], "variable": [ { "id": "a663d37a-5cdd-4c0a-aacd-eaee11a4d095", "key": "card_id", "type": "any" } ] } }, "response": [] } ], "description": "https://developer.twitter.com/en/docs/ads/creatives/api-reference/poll", "event": [ { "listen": "prerequest", "script": { "id": "71b2f652-e8d0-4d1c-bba7-35abe28771fa", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "550693e4-7983-4c36-9f9e-f5a99b09cedb", "type": "text/javascript", "exec": [ "" ] } } ], "_postman_isSubFolder": true }, { "name": "Preroll Call To Actions", "item": [ { "name": "accounts/:account_id/preroll_call_to_actions", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/preroll_call_to_actions?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "preroll_call_to_actions" ], "query": [ { "key": "line_item_ids", "value": "", "description": "optional", "disabled": true }, { "key": "count", "value": "", "description": "optional", "disabled": true }, { "key": "cursor", "value": "", "description": "optional", "disabled": true }, { "key": "preroll_call_to_action_ids", "value": "", "description": "optional", "disabled": true }, { "key": "sort_by", "value": "", "description": "optional", "disabled": true }, { "key": "with_deleted", "value": "", "description": "optional", "disabled": true }, { "key": "with_total_count", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "accounts/:account_id/preroll_call_to_actions/:preroll_call_to_action_id", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/preroll_call_to_actions/:preroll_call_to_action_id?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "preroll_call_to_actions", ":preroll_call_to_action_id" ], "query": [ { "key": "with_deleted", "value": "", "description": "optional", "disabled": true } ], "variable": [ { "id": "8e5b6100-66e3-45b6-8038-08b8fcc5284e", "key": "preroll_call_to_action_id", "type": "any" } ] } }, "response": [] }, { "name": "accounts/:account_id/preroll_call_to_actions", "request": { "method": "POST", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/preroll_call_to_actions?call_to_action=&call_to_action_url=&line_item_id=", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "preroll_call_to_actions" ], "query": [ { "key": "call_to_action", "value": "", "description": "required" }, { "key": "call_to_action_url", "value": "", "description": "required" }, { "key": "line_item_id", "value": "", "description": "required" } ] } }, "response": [] }, { "name": "accounts/:account_id/preroll_call_to_actions/:preroll_call_to_action_id", "request": { "method": "PUT", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/preroll_call_to_actions/:preroll_call_to_action_id?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "preroll_call_to_actions", ":preroll_call_to_action_id" ], "query": [ { "key": "call_to_action", "value": "", "description": "optional", "disabled": true }, { "key": "call_to_action_url", "value": "", "description": "optional", "disabled": true } ], "variable": [ { "id": "0df25256-186d-4fc8-bd9b-0dafaf321efe", "key": "preroll_call_to_action_id", "type": "any" } ] } }, "response": [] }, { "name": "accounts/:account_id/preroll_call_to_actions/:preroll_call_to_action_id", "request": { "method": "DELETE", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/preroll_call_to_actions/:preroll_call_to_action_id", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "preroll_call_to_actions", ":preroll_call_to_action_id" ], "variable": [ { "id": "85696fbe-8b19-4ac0-b2c5-9a0e57fee58b", "key": "preroll_call_to_action_id", "type": "any" } ] } }, "response": [] } ], "description": "https://developer.twitter.com/en/docs/ads/creatives/api-reference/preroll-call-to-actions", "event": [ { "listen": "prerequest", "script": { "id": "78d5d6dd-9f45-4d8f-badb-476cdbf44de9", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "32a0a04f-611c-4303-b652-040ad770b826", "type": "text/javascript", "exec": [ "" ] } } ], "_postman_isSubFolder": true }, { "name": "Tweet Previews", "item": [ { "name": "accounts/:account_id/tweet_previews", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/tweet_previews?tweet_ids=&tweet_type=", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "tweet_previews" ], "query": [ { "key": "tweet_ids", "value": "", "description": "required" }, { "key": "tweet_type", "value": "", "description": "required" } ] } }, "response": [] } ], "description": "https://developer.twitter.com/en/docs/ads/creatives/api-reference/tweet-previews", "event": [ { "listen": "prerequest", "script": { "id": "c1301dba-6fa5-457e-b063-10989177eb95", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "43322a1f-3b11-4261-95b7-e212bdcb40ac", "type": "text/javascript", "exec": [ "" ] } } ], "_postman_isSubFolder": true } ], "description": "https://developer.twitter.com/en/docs/ads/creatives/overview", "event": [ { "listen": "prerequest", "script": { "id": "9292affd-d79d-4dcc-9b7c-0f7f7bb43b7a", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "9eec7e40-679b-4370-90c7-b88c09fcc483", "type": "text/javascript", "exec": [ "" ] } } ] }, { "name": "Measurement", "item": [ { "name": "App Event Tags", "item": [ { "name": "accounts/:account_id/app_event_tags", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/app_event_tags?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "app_event_tags" ], "query": [ { "key": "app_event_tag_ids", "value": "", "description": "optional", "disabled": true }, { "key": "count", "value": "", "description": "optional", "disabled": true }, { "key": "cursor", "value": "", "description": "optional", "disabled": true }, { "key": "sort_by", "value": "", "description": "optional", "disabled": true }, { "key": "with_deleted", "value": "", "description": "optional", "disabled": true }, { "key": "with_total_count", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "accounts/:account_id/app_event_tags/:app_event_tag_id", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/app_event_tags/:app_event_tag_id?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "app_event_tags", ":app_event_tag_id" ], "query": [ { "key": "with_deleted", "value": "", "description": "optional", "disabled": true } ], "variable": [ { "id": "4f8b0e01-d6c8-4a93-aff1-d8e9f1c7e5b5", "key": "app_event_tag_id", "type": "any" } ] } }, "response": [] }, { "name": "accounts/:account_id/app_event_tags", "request": { "method": "POST", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/app_event_tags?app_store_identifier=&conversion_type=&os_type=&provider_app_event_id=&provider_app_event_name=", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "app_event_tags" ], "query": [ { "key": "app_store_identifier", "value": "", "description": "required" }, { "key": "conversion_type", "value": "", "description": "required" }, { "key": "os_type", "value": "", "description": "required" }, { "key": "provider_app_event_id", "value": "", "description": "required" }, { "key": "provider_app_event_name", "value": "", "description": "required" }, { "key": "deep_link_scheme", "value": "", "description": "optional", "disabled": true }, { "key": "post_engagement_attribution_window", "value": "", "description": "optional", "disabled": true }, { "key": "post_view_attribution_window", "value": "", "description": "optional", "disabled": true }, { "key": "retargeting_enabled", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "accounts/:account_id/app_event_tags/:id", "request": { "method": "DELETE", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/app_event_tags/:id", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "app_event_tags", ":id" ], "variable": [ { "id": "a3c4b9f5-e829-4563-a6b7-44e25b483b57", "key": "id", "type": "any" } ] } }, "response": [] } ], "description": "https://developer.twitter.com/en/docs/ads/measurement/api-reference/app-event-tags", "event": [ { "listen": "prerequest", "script": { "id": "7b3ab8b4-135b-4ebe-ab2f-62b244bffdf0", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "05bdcade-c8c4-4e01-836e-514c3ee8cb66", "type": "text/javascript", "exec": [ "" ] } } ], "_postman_isSubFolder": true }, { "name": "App Event Provider Configurations", "item": [ { "name": "accounts/:account_id/app_event_provider_configurations", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/app_event_provider_configurations?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "app_event_provider_configurations" ], "query": [ { "key": "count", "value": "", "description": "optional", "disabled": true }, { "key": "cursor", "value": "", "description": "optional", "disabled": true }, { "key": "ids", "value": "", "description": "optional", "disabled": true }, { "key": "sort_by", "value": "", "description": "optional", "disabled": true }, { "key": "with_deleted", "value": "", "description": "optional", "disabled": true }, { "key": "with_total_count", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "accounts/:account_id/app_event_provider_configurations/:id", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/app_event_provider_configurations/:id?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "app_event_provider_configurations", ":id" ], "query": [ { "key": "with_deleted", "value": "", "description": "optional", "disabled": true } ], "variable": [ { "id": "9bee3deb-ba3f-43dd-b034-242cbc378e41", "key": "id", "type": "any" } ] } }, "response": [] }, { "name": "accounts/:account_id/app_event_provider_configurations", "request": { "method": "POST", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/app_event_provider_configurations?provider_advertiser_id=", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "app_event_provider_configurations" ], "query": [ { "key": "provider_advertiser_id", "value": "", "description": "required" } ] } }, "response": [] }, { "name": "accounts/:account_id/app_event_provider_configurations/:id", "request": { "method": "DELETE", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/app_event_provider_configurations/:id", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "app_event_provider_configurations", ":id" ], "variable": [ { "id": "babb95be-9a69-40bd-9435-c9b8e02f3c9b", "key": "id", "type": "any" } ] } }, "response": [] } ], "description": "https://developer.twitter.com/en/docs/ads/measurement/api-reference/app-event-provider-configurations", "event": [ { "listen": "prerequest", "script": { "id": "7960d1ee-16ed-4ae0-813b-37211a38bd0d", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "df5cf94a-8c6a-4eae-9629-015602049fae", "type": "text/javascript", "exec": [ "" ] } } ], "_postman_isSubFolder": true }, { "name": "App Lists", "item": [ { "name": "accounts/:account_id/app_lists", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/app_lists?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "app_lists" ], "query": [ { "key": "app_list_ids", "value": "", "description": "optional", "disabled": true }, { "key": "count", "value": "", "description": "optional", "disabled": true }, { "key": "cursor", "value": "", "description": "optional", "disabled": true }, { "key": "sort_by", "value": "", "description": "optional", "disabled": true }, { "key": "with_deleted", "value": "", "description": "optional", "disabled": true }, { "key": "with_total_count", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "accounts/:account_id/app_lists/:app_list_id", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/app_lists/:app_list_id?app_list_id=", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "app_lists", ":app_list_id" ], "query": [ { "key": "app_list_id", "value": "", "description": "required" }, { "key": "with_deleted", "value": "", "description": "optional", "disabled": true } ], "variable": [ { "id": "5eb0c010-7855-4329-b0b0-c79a9b613202", "key": "app_list_id", "type": "any" } ] } }, "response": [] }, { "name": "accounts/:account_id/app_lists", "request": { "method": "POST", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/app_lists?app_store_identifiers=&name=", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "app_lists" ], "query": [ { "key": "app_store_identifiers", "value": "", "description": "required" }, { "key": "name", "value": "", "description": "required" } ] } }, "response": [] }, { "name": "accounts/:account_id/app_lists/:app_list_id", "request": { "method": "DELETE", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/app_lists/:app_list_id?app_list_id=", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "app_lists", ":app_list_id" ], "query": [ { "key": "app_list_id", "value": "", "description": "required" } ], "variable": [ { "id": "5ea08baa-9f51-427a-a032-bb538b5b6b31", "key": "app_list_id", "type": "any" } ] } }, "response": [] } ], "description": "https://developer.twitter.com/en/docs/ads/measurement/api-reference/app-lists", "event": [ { "listen": "prerequest", "script": { "id": "e7928376-0cfb-448d-ae86-50b45a2d1fec", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "8845478c-3827-4421-9b41-d9f837b6f261", "type": "text/javascript", "exec": [ "" ] } } ], "_postman_isSubFolder": true }, { "name": "Conversion Attribution", "item": [ { "name": "conversion_attribution", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/conversion_attribution?app_id=&conversion_time=&conversion_type=&hashed_device_id=&os_type=", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "conversion_attribution" ], "query": [ { "key": "app_id", "value": "", "description": "required" }, { "key": "conversion_time", "value": "", "description": "required" }, { "key": "conversion_type", "value": "", "description": "required" }, { "key": "hashed_device_id", "value": "", "description": "required" }, { "key": "os_type", "value": "", "description": "required" }, { "key": "click_window", "value": "", "description": "optional", "disabled": true }, { "key": "extra_device_ids", "value": "", "description": "optional", "disabled": true }, { "key": "non_twitter_engagement_time", "value": "", "description": "optional", "disabled": true }, { "key": "non_twitter_engagement_type", "value": "", "description": "optional", "disabled": true }, { "key": "view_through_window", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] } ], "description": "https://developer.twitter.com/en/docs/ads/measurement/api-reference/conversion-attribution", "event": [ { "listen": "prerequest", "script": { "id": "5e0682f5-4b80-40e8-bda8-f74bba102118", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "e3c171a9-1125-4909-b407-4a4ff00e4c19", "type": "text/javascript", "exec": [ "" ] } } ], "_postman_isSubFolder": true }, { "name": "Conversion Event", "item": [ { "name": "conversion_event", "request": { "method": "POST", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/conversion_event?app_id=&conversion_time=&conversion_type=&hashed_device_id=&os_type=", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "conversion_event" ], "query": [ { "key": "app_id", "value": "", "description": "required" }, { "key": "conversion_time", "value": "", "description": "required" }, { "key": "conversion_type", "value": "", "description": "required" }, { "key": "hashed_device_id", "value": "", "description": "required" }, { "key": "os_type", "value": "", "description": "required" }, { "key": "click_window", "value": "", "description": "optional", "disabled": true }, { "key": "extra_device_ids", "value": "", "description": "optional", "disabled": true }, { "key": "non_twitter_engagement_time", "value": "", "description": "optional", "disabled": true }, { "key": "non_twitter_engagement_type", "value": "", "description": "optional", "disabled": true }, { "key": "view_through_window", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] } ], "description": "https://developer.twitter.com/en/docs/ads/measurement/api-reference/conversion-event", "event": [ { "listen": "prerequest", "script": { "id": "3d9286ac-1c17-4f6c-96b0-b357d2d70fb2", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "7dcc6a2f-9ef2-4c4f-9f61-1ef2a2c58159", "type": "text/javascript", "exec": [ "" ] } } ], "_postman_isSubFolder": true }, { "name": "Web Event Tags", "item": [ { "name": "accounts/:account_id/web_event_tags", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/web_event_tags?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "web_event_tags" ], "query": [ { "key": "count", "value": "", "description": "optional", "disabled": true }, { "key": "cursor", "value": "", "description": "optional", "disabled": true }, { "key": "sort_by", "value": "", "description": "optional", "disabled": true }, { "key": "web_event_tag_ids", "value": "", "description": "optional", "disabled": true }, { "key": "with_deleted", "value": "", "description": "optional", "disabled": true }, { "key": "with_total_count", "value": "", "description": "optional", "disabled": true } ] } }, "response": [] }, { "name": "accounts/:account_id/web_event_tags/:web_event_tag_id", "request": { "method": "GET", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/web_event_tags/:web_event_tag_id?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "web_event_tags", ":web_event_tag_id" ], "query": [ { "key": "with_deleted", "value": "", "description": "optional", "disabled": true } ], "variable": [ { "id": "592b31b3-a569-4f96-af04-ec6186ac8cf9", "key": "web_event_tag_id", "type": "any" } ] } }, "response": [] }, { "name": "accounts/:account_id/web_event_tags", "request": { "method": "POST", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/web_event_tags?click_window=&name=&retargeting_enabled=&type=&view_through_window=", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "web_event_tags" ], "query": [ { "key": "click_window", "value": "", "description": "required" }, { "key": "name", "value": "", "description": "required" }, { "key": "retargeting_enabled", "value": "", "description": "required" }, { "key": "type", "value": "", "description": "required" }, { "key": "view_through_window", "value": "", "description": "required" } ] } }, "response": [] }, { "name": "accounts/:account_id/web_event_tags/:web_event_tag_id", "request": { "method": "PUT", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/web_event_tags/:web_event_tag_id?", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "web_event_tags", ":web_event_tag_id" ], "query": [ { "key": "click_window", "value": "", "description": "optional", "disabled": true }, { "key": "name", "value": "", "description": "optional", "disabled": true }, { "key": "retargeting_enabled", "value": "", "description": "optional", "disabled": true }, { "key": "type", "value": "", "description": "optional", "disabled": true }, { "key": "view_through_window", "value": "", "description": "optional", "disabled": true } ], "variable": [ { "id": "692d4ecf-797d-4deb-a269-c2d9310103e6", "key": "web_event_tag_id", "type": "any" } ] } }, "response": [] }, { "name": "accounts/:account_id/web_event_tags/:web_event_tag_id", "request": { "method": "DELETE", "header": [], "url": { "raw": "https://ads-api.twitter.com/{{version}}/accounts/{{account_id}}/web_event_tags/:web_event_tag_id", "protocol": "https", "host": [ "ads-api", "twitter", "com" ], "path": [ "{{version}}", "accounts", "{{account_id}}", "web_event_tags", ":web_event_tag_id" ], "variable": [ { "id": "18671bca-7144-4417-a053-c98731bee340", "key": "web_event_tag_id", "type": "any" } ] } }, "response": [] } ], "description": "https://developer.twitter.com/en/docs/ads/measurement/api-reference/web-event-tags", "event": [ { "listen": "prerequest", "script": { "id": "89771382-b543-476a-bbaf-933dacb23596", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "e043079b-5dcf-4372-ac4f-f3bffdad6a5c", "type": "text/javascript", "exec": [ "" ] } } ], "_postman_isSubFolder": true } ], "description": "https://developer.twitter.com/en/docs/ads/measurement/overview", "event": [ { "listen": "prerequest", "script": { "id": "02195257-68b1-48c9-aa17-f4c309b1bdbe", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "3c03987e-07bd-4cd3-a127-cc6e3a52c7dc", "type": "text/javascript", "exec": [ "" ] } } ] } ], "auth": { "type": "oauth1", "oauth1": [ { "key": "tokenSecret", "value": "{{token_secret}}", "type": "string" }, { "key": "token", "value": "{{access_token}}", "type": "string" }, { "key": "consumerSecret", "value": "{{consumer_secret}}", "type": "string" }, { "key": "consumerKey", "value": "{{consumer_key}}", "type": "string" }, { "key": "addParamsToHeader", "value": true, "type": "boolean" }, { "key": "signatureMethod", "value": "HMAC-SHA1", "type": "string" }, { "key": "version", "value": "1.0", "type": "string" }, { "key": "addEmptyParamsToSign", "value": false, "type": "boolean" } ] }, "event": [ { "listen": "prerequest", "script": { "id": "2fff0c72-fe0c-437b-9bfc-a42ce4211c18", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "380262bb-e264-4cf1-9c37-09b95b6bf76e", "type": "text/javascript", "exec": [ "" ] } } ] }