v1

latestSwagger 2.02026-07-1422117.6 KB
sponsorship

Request VAST sponsorship units

Not for use by NPR One clients (for whom sponsorship is already integrated into the Listening Service), this endpoint is designed to be used by our other client applications to request sponsorship on behalf of a user. Sponsorship units are returned in the form of VAST XML. It is worth noting that this endpoint attempts to always return XML, even in the case of exceptions.

The default behavior of this endpoint is asynchronous; on an initial request, a call to our external sponsorship provider is placed on a queue, which is typically processed within 3 minutes. Once the sponsorship call is received and processed, the returned sponsorship units are placed in a cache on our server for the current user. Subsequent calls to this endpoint will return VAST sponsorship units from this cache until tracking information is submitted, which removes the ad from the cache and will automatically request additional ads asynchronously if there are fewer than a certain number remaining in the cache.

For development purposes, it's worth noting that there is currently no way to clear a user's cache without submitting some form of tracking.

get/v2/ads

Query parameters

forceResultboolean

Whether to force a synchronous call to our external sponsorship provider; the default behavior is asynchronous.

adCountinteger

How many sponsorship units to request in one call; if left unspecified, the default behavior is to return only 1.

Headers

Authorizationstring required

Your access token from the Authorization Service. Should start with Bearer, followed by a space, followed by the token.

X-Advertising-IDstring

A device-specific advertising identifier, if possible. Apple's IDFA is an example.

Response

Request completed successfully; a VAST XML document is returned. Note that this response will only be returned if either force=true was passed in the querystring, or a call to get sponsorship was previously made, and ads now exist in the cache for this user; otherwise, the 202 response is returned.

All 2 operations