We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The Cards endpoint (https://developer.twitter.com/en/docs/twitter-ads-api/creatives/api-reference/cards) appears to be another that requires a JSON body instead of url encoded data.
twurl -H "https://ads-api.twitter.com" "/10/accounts/xyz/cards" -X POST -d '{"name":"SHOJO_1080x1080_002.mp4","components":[{"type":"MEDIA","media_key":"xyz"},{"type":"BUTTON","label":{"type":"ENUM","value":"INSTALL"},"destination":{"type":"APP","country_code":"JP","googleplay_app_id":"jp.intense.ganache","iphone_app_id":"1291823197"}}]}' -A 'Content-Type: application/json'
Here's an example twurl with a working request. (You'll need to include your account ID in the path and a valid media_key.)
The text was updated successfully, but these errors were encountered:
const JSON_ENDPOINTS = [ /direct_messages\/events\/new/, /direct_messages\/welcome_messages\/new/, /direct_messages\/welcome_messages\/rules\/new/, /media\/metadata\/create/, /collections\/entries\/curate/, /accounts\/[^\/]+\/cards$/, ]; function isJSONEndpoint(resource) { const endpoint = JSON_ENDPOINTS.find((endpoint) => { return endpoint.test(resource) }) return !!endpoint }
Swapping the JSON_ENDPOINTS to be an array of regexes might do the trick. Happy to open a PR
Sorry, something went wrong.
No branches or pull requests
The Cards endpoint (https://developer.twitter.com/en/docs/twitter-ads-api/creatives/api-reference/cards) appears to be another that requires a JSON body instead of url encoded data.
twurl -H "https://ads-api.twitter.com" "/10/accounts/xyz/cards" -X POST -d '{"name":"SHOJO_1080x1080_002.mp4","components":[{"type":"MEDIA","media_key":"xyz"},{"type":"BUTTON","label":{"type":"ENUM","value":"INSTALL"},"destination":{"type":"APP","country_code":"JP","googleplay_app_id":"jp.intense.ganache","iphone_app_id":"1291823197"}}]}' -A 'Content-Type: application/json'
Here's an example twurl with a working request. (You'll need to include your account ID in the path and a valid media_key.)
The text was updated successfully, but these errors were encountered: