Home Reference Source Test Repository

Typedef

Static Public Summary
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public

Static Public

public CollectionDocJSON: Object source

Properties:

NameTypeAttributeDescription
version string

The version of the Collection.Doc+JSON Hypermedia Type Specification being used by this document

href string

A unique identifier of the resource representation in the form of a Uniform Resource Identifier (URI)

attributes Object

A set of metadata attributes that represent the "state" of the resource in the form of key-value pairs; may be an empty object

items Array

A list of items associated with this document; may be an empty array

links Object

A map of resources that expose controls and communicate relationships with other documents; the keys describe the relationship to the current document, while the values are arrays of links

errors Array

A list of errors encountered in the process of creating and/or retrieving this document, intended to facilitate reliable debugging of client/server interactions

public Config: Object source

Properties:

NameTypeAttributeDescription
apiBaseUrl string
  • optional
  • default: 'https://api.npr.org'

DEPRECATED / NO LONGER IN USE: The NPR One API hostname and protocol, typically https://api.npr.org; in most cases, this does not need to be manually set by clients

apiVersion string
  • optional
  • default: 'v2'

DEPRECATED / NO LONGER IN USE: The NPR One API version, typically v2; in most cases, this does not need to be manually set by clients

authProxyBaseUrl string
  • optional

The full URL to your OAuth proxy, e.g. https://one.example.com/oauth2/

newDeviceCodePath string
  • optional
  • default: '/device'

The path to your proxy for starting a device_code grant (relative to authProxyBaseUrl)

pollDeviceCodePath string
  • optional
  • default: '/device/poll'

The path to your proxy for polling a device_code grant (relative to authProxyBaseUrl)

refreshTokenPath string
  • optional
  • default: '/refresh'

The path to your proxy for the refresh_token grant (relative to authProxyBaseUrl)

tempUserPath string
  • optional
  • default: '/temporary'

The path to your proxy for the temporary_user grant (relative to authProxyBaseUrl), not available to third-party clients

logoutPath string
  • optional
  • default: '/logout'

The path to your proxy for the POST /authorization/v2/token/revoke endpoint (relative to authProxyBaseUrl)

accessToken string
  • optional

The access token to use if not using the auth proxy

clientId string
  • optional

The NPR One API client_id to use, only required if using the auth proxy with the temporary_user grant type

advertisingId string
  • optional

The custom X-Advertising-ID header to send with most requests, not typically used by third-party clients

advertisingTarget string
  • optional

The custom X-Advertising-Target header to send with most requests, not typically used by third-party clients

subdomain string
  • optional

The custom subdomain to use for requests, not typically used by third-party clients

Properties:

NameTypeAttributeDescription
form-factor string
  • optional

The form-factor for the most appropriate display of or interaction with the resource, usually irrelevant unless there is more than one link of the same type

Properties:

NameTypeAttributeDescription
rel string
  • optional

The relation of the image to the content, which usually corresponds to the crop-type

height number
  • optional

The pixel height of the image

width number
  • optional

The pixel width of the image

Properties:

NameTypeAttributeDescription
content-type string
  • optional

The MIME-type of the resource

href string

The URI that represents the resource

public Logger: JsLogger source

public RecommendationAttributes: Object source

Properties:

NameTypeAttributeDescription
type string

The type of recommendation, usually audio. Can also be stationId, sponsorship, etc.

uid string

The universal identifier of the recommendation

title string

The title of the recommendation

skippable boolean

Whether or not the recommendation is skippable, usually true, but false for e.g. sponsorship

slug string
  • optional

A slug or category for the recommendation

provider string

The provider of the story, usually NPR. Can also be a member station or third-party podcast provider.

program string
  • optional

The program as part of which this recommendation aired

duration number

The duration of the audio according to the API; note that the actual duration can differ

date string

ISO-8601 formatted date/time; the date at which the story was first published

description string
  • optional

A short description of the recommendation

rationale string

The reason for recommending this piece to the listener

button string
  • optional

The text to display in a clickable button on a feature card

public StationAttributes: Object source

Properties:

NameTypeAttributeDescription
orgId string

The system's unique ID for this station, used across NPR One Microservices and NPR's other APIs

guid string

The system's internal unique identifier for a station, not typically used by other APIs or consumers

brand StationBrandData

An associative array of brand-related metadata for this station

eligibility StationEligibilityData

An associative array of eligibility-related metadata for this station

newscast StationNewscastData
  • optional

Metadata about the newscast for this station; newscasts are handled internally by other microservices such as the NPR One Listening Service, so this data should typically not be used by consumers

Metadata StationNetwork

about the network, if this station is part of a network

public StationBrandData: Object source

Properties:

NameTypeAttributeDescription
name string

The display name for the station. In most cases, this will be the same as call letters combined with band. When returning networks, it will return the network name (e.g. Minnesota Public Radio).

call string | null

The three-to-four-letter identifying code for this station. Please use this with caution; most stations prefer to be identified by their name in client applications instead of call.

frequency string | null

Where on the radio dial the station can be heard. If the band is AM, the frequency will be between 540 and 1600. If the band is FM, the frequency will be between 87.8 and 108.0.

band string | null

The subsection of the radio spectrum -- 'AM' or 'FM' -- where this station can be heard

tagline string

A short text-logo for the station

marketCity string

The city that the station is most closely associated with. This may or may not be the city the station is licensed in and it may or may not be the city that the station or the station's antenna is located in.

marketState string

The state that the station is most closely associated with. This may or may not be the state the station is licensed in and it may or may not be the state that the station or the station's antenna is located in.

public StationEligibilityData: Object source

Properties:

NameTypeAttributeDescription
nprOne boolean

Whether or not this organization is considered an NPR One station

musicOnly boolean

Whether or not this station only plays music

format string

The format of the programming on this station

status string

The status of the station within NPR's system, not typically used by consumers

public StationNetwork: Object source

Properties:

NameTypeAttributeDescription
currentOrgId string

The current station being viewed. Client applications should generally ignore this field.

usesInheritance boolean

Whether or not the current station inherits from a parent organization, also referred to as a network

inheritingFrom string
  • optional

The system' unique ID for the organization that the current station is inheriting from, if inheritance is on

name string

The display name for the current organization

tier1 StationNetworkTierOne
  • optional

The top-level organization, if this station is part of a network

public StationNetworkTierOne: Object source

Properties:

NameTypeAttributeDescription
id string

The unique identifier of the top-level organization in the network

usesInheritance boolean

Whether or not this station inherits from a parent organization, also referred to as a network

name string

The display name for the top-level organization in the network

status string

The status of the top-level organization within NPR's system, not typically used by consumers

tier2 Array<StationNetworkTierTwo>
  • optional

One or more stations that are hierarchical children of this organization

public StationNetworkTierThree: Object source

Properties:

NameTypeAttributeDescription
id string

The unique identifier of a tier 3 organization in the network

usesInheritance boolean

Whether or not this station inherits from a parent organization, also referred to as a network

name string

The display name for a tier 3 organization in the network

public StationNetworkTierTwo: Object source

Properties:

NameTypeAttributeDescription
id string

The unique identifier of a tier 2 organization in the network

usesInheritance boolean

Whether or not this station inherits from a parent organization, also referred to as a network

name string

The display name for a tier 2 organization in the network

tier3 Array<StationNetworkTierThree>
  • optional

One or more stations that are hierarchical children of this organization

public StationNewscastData: Object source

Properties:

NameTypeAttributeDescription
id string

The ID of the newscast that should be played for this station; this is handled internally by other microservices such as the NPR One Listening Service, so this field should typically not be used by consumers

recency null | number

How often the newscast should be played, in minutes; a value of null implies no information is available, and sensible defaults should be used

public UserAffiliation: Object source

Properties:

NameTypeAttributeDescription
id number

A unique identifier for the aggregation (program)

title string
  • optional

The display name of the aggregation (program)

href string

A link that can be followed to get content from this aggregation (program)

following boolean

Whether or not the user is following the aggregation. When changing affiliation status, the client is expected to toggle this value and then send the entire object back.

rating number
  • optional

The user's average rating for this affiliation on a scale of 0-1. Absent if user never listened to the aggregation.

daysSinceLastListen number
  • optional

The number of days since a user last listened to a story from this aggregation. Absent if user never listened to the aggregation.

public UserAttributes: Object source

Properties:

NameTypeAttributeDescription
id string

Some unique identifier for the user

email string

The user's email address

firstName string

The user's first name

lastName string

The user's last name

cohort UserCohort

The user's cohort (an experimental grouping for User Experience A/B Testing)

organizations Array<UserOrganization>

User's chosen NPR Member Station(s)

affiliations Array<UserAffiliation>

Programs, shows, and podcasts that the user has positively interacted with

public UserCohort: Object source

Properties:

NameTypeAttributeDescription
id string

A short ID for this cohort

name string

A text string identifying the cohort, useful for metrics

directory string

For internal use only; represents the current configuration file being used by the Listening Service

public UserOrganization: Object source

Properties:

NameTypeAttributeDescription
id string

Some unique identifier for the organization

displayName string

A short displayable text field for the end user, strictly text

call string

Station call letters

city string

A short description of the station's main market city

logo string
  • optional

Station logo image URL

donationUrl string
  • optional

The URL to a website where users may make a donation to support the station