POST /preroll_call_to_action ROUTE_NOT_FOUND

api

#1

Seeing ROUTE_NOT_FOUND error on the POST /preroll_call_to_action endpoint

Ensuring the account has the feature:

twurl -H ads-api.twitter.com "/0/accounts/4no6av/features" | jsonpretty
{
    "data": [
        "AGE_TARGETING",
        "ALLOW_SKIPPABLE_VIDEOS_FOR_VIDEO_VIEWS_PREROLL_OBJECTIVE",
        "BRAND_TPN",
        "CPI_CHARGING",
        "DR_TAP",
        "ENGAGER_RETARGETING",
        "EVENT_TARGETING",
        "INSTALLED_APP_CATEGORY_TARGETING",
        "MOBILE_CONVERSION_TRANSACTION_VALUE",
        "OPTIMIZED_ACTION_BIDDING",
        "OPTIMIZED_WEBSITE_CONVERSIONS",
        "QUALIFIED_IMPRESSIONS_OBJECTIVE",
        "VIDEO_VIEWS_PREROLL_OBJECTIVE",
        "VIDEO_APP_DOWNLOAD_CARD",
        "REACH_AND_FREQUENCY_ANALYTICS"
    ],
    "data_type": "features",
    "request": {
        "params": {
            "account_id": "4no6av"
        }
    }
}

Following the Video Views Preroll implementation documentation:

twurl -X POST -H ads-api.twitter.com "/0/accounts/4no6av/line_items?campaign_id=4il9s&bid_amount_local_micro=10000&name=preroll&product_type=MEDIA&placements=ALL_ON_TWITTER&objective=VIDEO_VIEWS_PREROLL&categories=IAB1" | jsonpretty
{
    "data": {
        "account_id": "4no6av",
        "advertiser_domain": null,
        "advertiser_user_id": 281623783,
        "automatically_select_bid": false,
        "bid_amount_local_micro": 10000,
        "bid_type": "MAX",
        "bid_unit": "VIEW",
        "campaign_id": "4il9s",
        "categories": [
            "IAB1"
        ],
        "charge_by": "VIEW",
        "created_at": "2016-03-17T19:02:24Z",
        "creative_source": "MANUAL",
        "currency": "USD",
        "deleted": false,
        "end_time": null,
        "id": "4o4rr",
        "include_sentiment": "POSITIVE_ONLY",
        "name": "preroll",
        "objective": "VIDEO_VIEWS_PREROLL",
        "optimization": "DEFAULT",
        "paused": false,
        "placements": [
            "ALL_ON_TWITTER"
        ],
        "primary_web_event_tag": null,
        "product_type": "MEDIA",
        "start_time": null,
        "total_budget_amount_local_micro": null,
        "tracking_tags": [],
        "updated_at": "2016-03-17T19:02:24Z"
    },
    "data_type": "line_item",
    "request": {
        "params": {
            "account_id": "4no6av",
            "bid_amount_local_micro": 10000,
            "campaign_id": "4il9s",
            "categories": [
                "IAB1"
            ],
            "name": "preroll",
            "objective": "VIDEO_VIEWS_PREROLL",
            "placements": [
                "ALL_ON_TWITTER"
            ],
            "product_type": "MEDIA"
        }
    }
}

Media creative for the line_item created not via twurl, but checking existence:

twurl -H ads-api.twitter.com "/0/accounts/4no6av/media_creatives/k0rm" | jsonpretty
{
    "data": {
        "account_media_id": "r3t",
        "approval_status": "ACCEPTED",
        "created_at": "2016-03-17T19:06:06Z",
        "deleted": false,
        "id": "k0rm",
        "landing_url": "",
        "line_item_id": "4o4rr",
        "serving_status": "ACTIVE",
        "updated_at": "2016-03-17T19:06:06Z"
    },
    "data_type": "media_creative",
    "request": {
        "params": {
            "account_id": "4no6av",
            "media_creative_id": "k0rm"
        }
    }
}

Then associate preroll_call_to_action:

twurl -X POST -H ads-api.twitter.com "/0/accounts/4no6av/preroll_call_to_action?line_item_id=4o4rr&call_to_action=VISIT_SITE&call_to_action_url=https://4cinsights.com" | jsonpretty
{
    "errors": [
        {
            "code": "ROUTE_NOT_FOUND",
            "message": "The requested resource could not be found"
        }
    ],
    "request": {
        "params": {}
    }
}

Let us know if anything above seems wrong and/or how to proceed.


Twitter Ads API V1 - Unable to access Sandbox API's CTA Preroll Endpoint
#2

Thanks for reporting this.

This is a mistake in the documentation, and it has since been updated. The call should be to POST accounts/:account_id/preroll_call_to_actions, with actions pluralized. The request should work in that case.


#3

@hwz, this is still an issue while attempting to access the new endpoint. See the below topic: