@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api HHS Media Services API
@version 2
@endpoints 31
@hint download_for_search
@toc resources.json(1), resources(30)

@group resources.json
@endpoint GET /resources.json
@desc Get Resources by search query
@required {q: any # The search query supplied by the user}
@returns(200) "Returns the list of Resources matching the search query 'q'.<p>The search query 'q' is a Lucene query.<br>The syntax for a Lucene query can be found <a href="http://lucene.apache.org/core/2_9_4/queryparsersyntax.html">here</a>."
@errors {400: Invalid ID, 500: Internal Server Error}

@endgroup

@group resources
@endpoint GET /resources/campaigns.json
@desc Get Campaigns
@optional {max: any # The maximum number of records to return, offset: any # The offset of the records set to return for pagination, sort: any # * Set of fields to sort the records by.}
@returns(200) Returns the list of Campaigns.
@errors {400: Bad Request, 500: Internal Server Error}

@endpoint GET /resources/campaigns/{id}.json
@desc Get Campaign by ID
@required {id: any # The id of the record to look up}
@returns(200) Returns the Campaign identified by the 'id'.
@errors {400: Invalid ID, 500: Internal Server Error}

@endpoint GET /resources/campaigns/{id}/media.json
@desc Get MediaItems by Campaign ID
@required {id: any # The id of the campaign to find media items for}
@optional {sort: any # The name of the property to which sorting will be applied, max: any # The maximum number of records to return, offset: any # The offset of the records set to return for pagination}
@returns(200) Returns the list of MediaItems for the Campaign identified by the 'id'.
@errors {400: Bad Request, 500: Internal Server Error}

@endpoint GET /resources/campaigns/{id}/syndicate.{format}
@desc Get MediaItems for Campaign
@required {id: any # The id of the record to look up}
@optional {displayMethod: any # Method used to render an html request. Accepts one: [mv, list, feed]}
@returns(200) Renders the list of MediaItems associated with the Tag identified by the 'id'.
@errors {400: Invalid ID, 500: Internal Server Error}

@endpoint GET /resources/languages.json
@desc Get Languages
@optional {max: any # The maximum number of records to return, offset: any # Return records starting at the offset index., sort: any # The name of the property to which sorting will be applied}
@returns(200) Returns the list Languages.
@errors {400: Bad Request, 500: Internal Server Error}

@endpoint GET /resources/languages/{id}.json
@desc Get Language by ID
@required {id: any # The id of the language to look up}
@returns(200) Returns the Language identified by the 'id'.
@errors {400: Invalid ID, 500: Internal Server Error}

@endpoint GET /resources/media.json
@desc Get MediaItems
@optional {max: any # The maximum number of records to return, offset: any # The offset of the records set to return for pagination., sort: any # * Set of fields to sort the records by., order: any # * The ascending or descending order., mediaTypes: any # Find all media items belonging to the specified media type[s]., name: any # Find all media items containing the provided name, case insensitive., collectionId: any # Restrict filtering to media items in a specific collection., nameContains: any # Find all media items containing the partial name, case insensitive., descriptionContains: any # Find all media items containing the provided partial description, case insensitive., sourceUrl: any # Find all media items which have the provided sourceUrl, case insensitive., sourceUrlContains: any # Find all media items which contain the provided partial sourceUrl, case insensitive., customThumbnailUrl: any # Find all media items which have the provided customThumbnailUrl, case insensitive., customThumbnailUrlContains: any # Find all media items which contain the provided partial customThumbnailUrl, case insensitive., dateContentAuthored: any # Find all media items authored on the provided day (RFC 3339, time ignored)., dateContentUpdated: any # Find all media items updated on the provided day (RFC 3339, time ignored)., dateContentPublished: any # Find all media items published on the provided day (RFC 3339, time ignored)., dateContentReviewed: any # Find all media items reviewed on the provided day (RFC 3339, time ignored)., dateSyndicationCaptured: any # Find all media items syndicated on the provided day (RFC 3339, time ignored)., dateSyndicationUpdated: any # Find all media items updated through the syndication system on the provided day, (RFC 3339, time ignored)., contentAuthoredSinceDate: any # Find all media items authored since the provided day (RFC 3339, time ignored)., contentAuthoredBeforeDate: any # Find all media items authored before the provided day (RFC 3339, time ignored)., contentAuthoredInRange: any # Find all media items authored between the provided start and end days (RFC 3339, comma separated, time ignored)., contentUpdatedSinceDate: any # Find all media items updated since the provided day (RFC 3339, time ignored)., contentUpdatedBeforeDate: any # Find all media items updated before the provided day (RFC 3339, time ignored)., contentUpdatedInRange: any # Find all media items updated between the provided start and end days (RFC 3339, comma separated, time ignored)., contentPublishedSinceDate: any # Find all media items updated since the provided day (RFC 3339, time ignored)., contentPublishedBeforeDate: any # Find all media items published before the provided day (RFC 3339, time ignored)., contentPublishedInRange: any # Find all media items published between the provided start and end days (RFC 3339, comma separated, time ignored)., contentReviewedSinceDate: any # Find all media items reviewed since the provided day (RFC 3339, time ignored)., contentReviewedBeforeDate: any # Find all media items reviewed before the provided day (RFC 3339, time ignored)., contentReviewedInRange: any # Find all media items reviewed between the provided start and end days (RFC 3339, comma separated, time ignored)., syndicationCapturedSinceDate: any # Find all media items authored since the provided day (RFC 3339, time ignored)., syndicationCapturedBeforeDate: any # Find all media items authored before the provided day (RFC 3339, time ignored)., syndicationCapturedInRange: any # Find all media items authored between the provided start and end days (RFC 3339, comma separated, time ignored)., syndicationUpdatedSinceDate: any # Find all media items updated since the provided day, (RFC 3339, time ignored)., syndicationUpdatedBeforeDate: any # Find all media items updated before the provided day, (RFC 3339, time ignored)., syndicationUpdatedInRange: any # Find all media items updated between the provided start and end days, (RFC 3339, comma separated, time ignored)., syndicationVisibleSinceDate: any # Find all media items visible since the provided day, (RFC 3339, time ignored)., syndicationVisibleBeforeDate: any # Find all media items visible before the provided day, (RFC 3339, time ignored)., syndicationVisibleInRange: any # Find all media items visible between the provided start and end days, (RFC 3339, comma separated, time ignored)., languageId: any # Find all media items written in the language specified by Id., languageName: any # Find all media items written in the language specified by name, case insensitive., languageIsoCode: any # Find all media items written in the language specified by 639-2 isoCode , case insensitive., hash: any # Find all media items which match the provided hash, case insensitive., hashContains: any # Find all media items which match the provided partial hash, case insensitive., sourceId: any # Find all media items that belong to the source specified by Id., sourceName: any # Find all media items that belong to the source specified by name, case insensitive., sourceNameContains: any # Find all media items that belong to the source specified by partial name, case insensitive., sourceAcronym: any # Find all media items that belong to the source specified by acronym, case insensitive., sourceAcronymContains: any # Find all media items that belong to the source specified by partial acronym, case insensitive., tagIds: any # Find only media items tagged with the specified tag Ids., restrictToSet: any # Find only media from within the supplied list of Ids., createdBy: any # Find all media items containing the createdBy value.}
@returns(200) Returns the list of MediaItems matching the specified query parameters.
@errors {400: Bad Request, 500: Internal Server Error}

@endpoint GET /resources/media/featured.json
@desc Get the list of featured content in the syndication system
@optional {sort: any # The name of the property to which sorting will be applied, max: any # The maximum number of records to return, offset: any # Return records starting at the offset index.}
@returns(200) Get the list of featured content in the syndication system
@errors {400: Bad Request, 500: Internal Server Error}

@endpoint GET /resources/media/mostPopularMedia.{format}
@desc Get MediaItems by popularity
@optional {max: any # The maximum number of records to return, offset: any # The offset of the records set to return for pagination.}
@returns(200) Returns the list of MediaItems with the highest ratings.
@errors {400: Bad Request, 500: Internal Server Error}

@endpoint GET /resources/media/searchResults.json
@desc Get MediaItems by search query
@required {q: any # The search query supplied by the user}
@optional {max: any # The maximum number of records to return, offset: any # The offset of the records set to return for pagination.}
@returns(200) Returns the list of MediaItems matching the search query 'q'.<p>Please enter keyword or URL in search query 'q'.
@errors {400: Bad Request, 500: Internal Server Error}

@endpoint GET /resources/media/{id}.json
@desc Get MediaItem by ID
@required {id: any # The id of the record to look up}
@returns(200) Returns the MediaItem identified by the 'id'.
@errors {400: Invalid ID, 500: Internal Server Error}

@endpoint GET /resources/media/{id}/content
@desc Get content for MediaItem
@required {id: any # The id of the media to show content for.}
@optional {calledByBuild: any # The method that called this method}
@returns(200) Returns the raw content (html, image, etc...) for the MediaItem identified by the 'id'.
@errors {400: Invalid ID, 500: Internal Server Error}

@endpoint GET /resources/media/{id}/embed.json
@desc Get embed code for MediaItem
@required {id: any # The id of the media to get embed code for.}
@optional {flavor: any # Currently supports 'iframe', defaults to 'javascript'., width: any # The width of the generated iframe., height: any # The height of the generated iframe., iframeName: any # The name of the iframe element, excludeJquery: any # Should a reference to the JQuery Library be omitted?, excludeDiv: any # Should the div to insert content into be omitted?, divId: any # Should the div to insert content into have a specific name?, displayMethod: any # Method used to render an html request. Accepts one: [mv, list, feed]}
@returns(200) Returns the javascript or iframe embed code for the MediaItem identified by 'id'.
@errors {400: Bad Request, 500: Internal Server Error}

@endpoint GET /resources/media/{id}/preview.jpg
@desc Get Tag by ID
@required {id: any # The id of the media to get a preview for.}
@returns(200) Returns the JPG preview, where applicable, for the MediaItem identified by the 'id'.
@errors {400: Invalid ID, 500: Internal Server Error}

@endpoint GET /resources/media/{id}/relatedMedia.{format}
@desc Get related MediaItems by ID
@required {id: any # The id of the media item to get related media for}
@optional {max: any # The maximum number of records to return, offset: any # Return records starting at the offset index., sort: any # The name of the property to which sorting will be applied}
@returns(200) Returns the list of MediaItems related to the MediaItem identified by the 'id'.
@errors {400: Bad Request, 500: Internal Server Error}

@endpoint GET /resources/media/{id}/syndicate.{format}
@desc Get syndicated content for MediaItem
@required {id: any # The id of the media to show embed code for.}
@optional {cssClass: any # The css class to target for extraction., stripStyles: any # Remove in-line styles from content., stripScripts: any # Remove script tags from content., stripImages: any # Remove image tags from content., stripBreaks: any # Remove break tags from content., stripClasses: any # Remove class attributes from content (except 'syndicate')., font-size: any # Set font size (in points) of p, div, and span tags., imageFloat: any # Accepts valid CSS float options, such as 'left' or 'right'. Will inject a style into the content before rendering., imageMargin: any # Accepts 4 CSV values representing pixel sizes of margin similar to CSS. Default format is 'north,east,south,west' - for example '0,10,10,0' would put a 10 pixel margin on the right and bottom sides of an image. Will inject a style into the content before rendering., autoplay: any # If content is a video, the embeded video will auto play when loaded., rel: any # If content is a video, related items will be shown at the end of playback.}
@returns(200) Returns the syndicated content for a given MediaItem in the specified 'format' (HTML or JSON).
@errors {400: Invalid ID, 500: Internal Server Error}

@endpoint GET /resources/media/{id}/thumbnail.jpg
@desc Get JPG thumbnail for MediaItem
@required {id: any # The id of the media to get a thumbnail for.}
@returns(200) Returns the JPG thumbnail, where applicable, for the MediaItem identified by the 'id'.
@errors {400: Invalid ID, 500: Internal Server Error}

@endpoint GET /resources/media/{id}/youtubeMetaData.json
@desc Get Youtube metadata for MediaItem
@required {id: any # The id of the video to show meta data for.}
@returns(200) Returns the Youtube metadata, where applicable, for the MediaItem identified by the 'id'.
@errors {400: Invalid ID, 500: Internal Server Error}

@endpoint GET /resources/mediaTypes.{format}
@desc Get MediaTypes
@returns(200) Returns the list of available MediaTypes.
@errors {400: Invalid ID, 500: Internal Server Error}

@endpoint GET /resources/sources.json
@desc Get Sources
@optional {max: any # The maximum number of records to return, offset: any # Return records starting at the offset index., sort: any # The name of the property to which sorting will be applied}
@returns(200) Returns the list of Sources.
@errors {400: Invalid ID, 500: Internal Server Error}

@endpoint GET /resources/sources/{id}.json
@desc Get Source by ID
@required {id: any # The id of the source to look up}
@returns(200) Returns the Source identified by the 'id'.
@errors {400: Invalid ID, 500: Internal Server Error}

@endpoint GET /resources/sources/{id}/syndicate.{format}
@desc Get MediaItems for Source
@required {id: any # The id of the record to look up}
@optional {displayMethod: any # Method used to render an html request. Accepts one: [mv, list, feed]}
@returns(200) Renders the list of MediaItems associated with the Source identified by the 'id'.
@errors {400: Invalid ID, 500: Internal Server Error}

@endpoint GET /resources/tags.{format}
@desc Get Tags
@optional {sort: any # The name of the property to which sorting will be applied, max: any # The maximum number of records to return, offset: any # Return records starting at the offset index., name: any # Return tags[s] matching the supplied name, nameContains: any # Return tags which contain the supplied partial name., mediaId: any # Return tags associated with the supplied media id., typeId: any # Return tags belonging to the supplied tag type id., typeName: any # Return tags belonging to the supplied tag type name.}
@returns(200) Returns the list of Tags matching the specified query parameters in the specified 'format'.
@errors {400: Bad Request, 500: Internal Server Error}

@endpoint GET /resources/tags/tagLanguages.{format}
@desc Get TagLanguages
@returns(200) Returns the list of TagLanguages
@errors {400: Invalid ID, 500: Internal Server Error}

@endpoint GET /resources/tags/tagTypes.{format}
@desc Get MediaItems for Tag
@returns(200) Renders the list of MediaItems associated with the Tag identified by the 'id'.
@errors {400: Invalid ID, 500: Internal Server Error}

@endpoint GET /resources/tags/{id}.{format}
@desc Get Tag by ID
@required {id: any # The id of the record to look up}
@returns(200) Returns the Tag identified by the 'id' in the specified 'format'.
@errors {400: Invalid ID, 500: Internal Server Error}

@endpoint GET /resources/tags/{id}/media.{format}
@desc Get MediaItems for Tag
@required {id: any # The id of the tag to look up}
@optional {sort: any # The name of the property to which sorting will be applied, max: any # The maximum number of records to return, offset: any # Return records starting at the offset index.}
@returns(200) Returns the list of MediaItems associated with the Tag identified by the 'id'.
@errors {400: Bad Request, 500: Internal Server Error}

@endpoint GET /resources/tags/{id}/related.{format}
@desc Get related Tags by ID
@required {id: any # The id of the tag to look up}
@optional {sort: any # The name of the property to which sorting will be applied, max: any # The maximum number of records to return, offset: any # Return records starting at the offset index.}
@returns(200) Returns the list of Tags related to the Tag identified by the 'id' in the specified format.
@errors {400: Bad Request, 500: Internal Server Error}

@endpoint GET /resources/tags/{id}/syndicate.{format}
@desc Get MediaItems for Tag
@required {id: any # The id of the record to look up}
@optional {displayMethod: any # Method used to render an html request. Accepts one: [mv, list, feed]}
@returns(200) Renders the list of MediaItems associated with the Tag identified by the 'id'.
@errors {400: Invalid ID, 500: Internal Server Error}

@endpoint GET /resources/userMediaLists/{id}.json
@desc Get UserMediaList by ID
@required {id: any # The id of the record to look up}
@optional {displayMethod: any # Method used to render an html request. Accepts one: [mv, list, feed]}
@returns(200) Get a specific user media list by 'id'.
@errors {400: Invalid ID, 500: Internal Server Error}

@endgroup

@end
