New York Times (Independent Publisher) (#1193)

* New York Times (Independent Publisher)

Initial Commit

* New York Times (Independent Publisher)

Updated readme

* New York Times (Independent Publisher)

Updated readme.

* New York Times (Independent Publisher)

Changes request by Srikanth
This commit is contained in:
RoyPaarMS 2021-11-01 20:36:42 -05:00 коммит произвёл GitHub
Родитель cad4f623be
Коммит 7be64f10c8
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 528 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,479 @@
{
"swagger": "2.0",
"info": {
"version": "1.0.0",
"title": "New York Times",
"description": "The New York Times allows anyone to search articles by keyword, date, section, and popularity. This connector allows a user to pull this data into their app, flow, or report.",
"contact": {
"name": "Roy Paar",
"email": "roypaar@microsoft.com"
}
},
"host": "api.nytimes.com",
"basePath": "/svc/",
"schemes": [
"https"
],
"consumes": [],
"produces": [
"application/json"
],
"security": [
{
"API Key": []
}
],
"paths": {
"/search/v2/articlesearch.json": {
"get": {
"summary": "Returns a list of articles based on keyword search",
"description": "Search for NYT articles by keywords.",
"operationId": "ArticleSearch",
"parameters": [
{
"name": "q",
"in": "query",
"description": "Query",
"required": true,
"type": "string",
"x-ms-summary": "Keyword"
},
{
"name": "begin_date",
"in": "query",
"description": "Begin date (e.g. 20120101)",
"required": false,
"type": "string",
"pattern": "^\\d{8}$",
"x-ms-summary": "Begin date (e.d. 20120101)"
},
{
"name": "end_date",
"in": "query",
"description": "End date (e.g. 20121231)",
"required": false,
"type": "string",
"pattern": "^\\d{8}$",
"x-ms-summary": "End date (e.g. 20121231)"
}
],
"tags": [
"Article Search"
],
"responses": {
"200": {
"description": "An array of articles.",
"schema": {
"type": "object",
"properties": {
"status": {
"type": "string"
},
"copyright": {
"type": "string"
},
"response": {
"type": "object",
"properties": {
"docs": {
"type": "array",
"items": {
"$ref": "#/definitions/Article"
}
},
"meta": {
"type": "object"
}
}
}
}
}
},
"401": {
"description": "Unauthorized request. Make sure api-key is set."
},
"429": {
"description": "Too many requests. You reached your per minute or per day rate limit."
}
}
}
},
"/topstories/v2/{section}.json": {
"get": {
"summary": "Returns a list of top stories by section",
"description": "The Top Stories service returns an array of articles currently on the specified section.",
"operationId": "TopStories",
"parameters": [
{
"name": "section",
"in": "path",
"description": "The section the story appears in.",
"required": true,
"type": "string",
"default": "home",
"x-ms-summary": "The section the store appears in.",
"enum": [
"arts",
"automobiles",
"books",
"business",
"fashion",
"food",
"health",
"home",
"insider",
"magazine",
"movies",
"nyregion",
"obituaries",
"opinion",
"politics",
"realestate",
"science",
"sports",
"sundayreview",
"technology",
"theater",
"t-magazine",
"travel",
"upshot",
"us",
"world"
],
"x-ms-url-encoding": "single"
}
],
"tags": [
"Top Stories"
],
"responses": {
"200": {
"description": "An array of articles.",
"schema": {
"type": "object",
"properties": {
"status": {
"type": "string"
},
"copyright": {
"type": "string"
},
"section": {
"type": "string"
},
"last_updated": {
"type": "string"
},
"results": {
"type": "array",
"items": {
"$ref": "#/definitions/Article"
}
}
}
}
},
"401": {
"description": "Unauthorized request. Make sure api-key is set."
},
"429": {
"description": "Too many requests. You reached your per minute or per day rate limit."
}
}
}
},
"/mostpopular/v2/viewed/{period}.json": {
"get": {
"summary": "Returns a list of most viewed articles on NYTimes.com by time period",
"description": "Returns an array of the most viewed articles on NYTimes.com for specified period of time (1 day, 7 days, or 30 days).",
"operationId": "MostViewed",
"parameters": [
{
"name": "period",
"in": "path",
"description": "Time period of 1, 7, or 30 days.",
"required": true,
"type": "integer",
"enum": [
1,
7,
30
],
"default": 1,
"x-ms-summary": "Time period of 1, 7, or 30 days.",
"x-ms-url-encoding": "single"
}
],
"tags": [
"Most Popular"
],
"responses": {
"200": {
"description": "An array of articles.",
"schema": {
"type": "object",
"properties": {
"status": {
"type": "string",
"description": "API response status (e.g. OK)."
},
"copyright": {
"type": "string",
"description": "Copyright message."
},
"results": {
"type": "array",
"items": {
"$ref": "#/definitions/ViewedArticle"
},
"description": "Array of articles."
}
}
}
},
"401": {
"description": "Unauthorized request. Make sure api-key is set."
},
"429": {
"description": "Too many requests. You reached your per minute or per day rate limit."
}
}
}
}
},
"definitions": {
"Article": {
"type": "object",
"properties": {
"web_url": {
"type": "string"
},
"snippet": {
"type": "string"
},
"print_page": {
"type": "string"
},
"source": {
"type": "string"
},
"headline": {
"$ref": "#/definitions/Headline"
},
"keywords": {
"type": "array",
"items": {
"$ref": "#/definitions/Keyword"
}
},
"pub_date": {
"type": "string"
},
"document_type": {
"type": "string"
},
"news_desk": {
"type": "string"
},
"type_of_material": {
"type": "string"
},
"_id": {
"type": "string"
},
"score": {
"type": "integer"
},
"uri": {
"type": "string"
}
}
},
"Headline": {
"type": "object",
"properties": {
"main": {
"type": "string"
},
"kicker": {
"type": "string"
},
"content_kicker": {
"type": "string"
},
"print_headline": {
"type": "string"
},
"name": {
"type": "string"
},
"seo": {
"type": "string"
},
"sub": {
"type": "string"
}
}
},
"Keyword": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"value": {
"type": "string"
},
"major": {
"type": "string"
}
}
},
"ViewedArticle": {
"type": "object",
"properties": {
"url": {
"type": "string",
"description": "Article's URL."
},
"adx_keywords": {
"type": "string",
"description": "Semicolon separated list of keywords."
},
"column": {
"type": "string",
"description": "Deprecated. Set to null."
},
"section": {
"type": "string",
"description": "Article's section (e.g. Sports)."
},
"byline": {
"type": "string",
"description": "Article's byline (e.g. By Thomas L. Friedman)."
},
"type": {
"type": "string",
"description": "Asset type (e.g. Article, Interactive, ...)."
},
"title": {
"type": "string",
"description": "Article's headline (e.g. When the Cellos Play, the Cows Come Home)."
},
"abstract": {
"type": "string",
"description": "Brief summary of the article."
},
"published_date": {
"type": "string",
"description": "When the article was published on the web (e.g. 2021-04-19)."
},
"source": {
"type": "string",
"description": "Publisher (e.g. New York Times)."
},
"des_facet": {
"type": "array",
"items": {
"type": "string"
},
"description": "Array of description facets (e.g. Quarantine (Life and Culture))."
},
"org_facet": {
"type": "array",
"items": {
"type": "string"
},
"description": "Array of organization facets (e.g. Sullivan Street Bakery)."
},
"per_facet": {
"type": "array",
"items": {
"type": "string"
},
"description": "Array of person facets (e.g. Bittman, Mark)."
},
"geo_facet": {
"type": "array",
"items": {
"type": "string"
},
"description": "Array of geographic facets (e.g. Canada)."
},
"media": {
"type": "array",
"items": {
"$ref": "#/definitions/Media"
},
"description": "Array of images."
},
"uri": {
"type": "string",
"description": "An article's globally unique identifier."
}
}
},
"Media": {
"type": "object",
"properties": {
"type": {
"type": "string",
"description": "Asset type (e.g. image)."
},
"subtype": {
"type": "string",
"description": "Asset subtype (e.g. photo)."
},
"caption": {
"type": "string",
"description": "Media caption."
},
"copyright": {
"type": "string",
"description": "Media credit."
},
"media-metadata": {
"type": "array",
"items": {
"$ref": "#/definitions/MediaMetadata"
},
"description": "Media metadata (url, width, height, ...)."
}
}
},
"MediaMetadata": {
"type": "object",
"properties": {
"url": {
"type": "string",
"description": "Image's URL."
},
"format": {
"type": "string",
"description": "Image's crop name."
}
}
}
},
"securityDefinitions": {
"API Key": {
"type": "apiKey",
"in": "query",
"name": "api-key"
}
},
"x-ms-connector-metadata": [
{
"propertyName": "Website",
"propertyValue": "https://nytimes.com"
},
{
"propertyName": "Privacy policy",
"propertyValue": "https://www.nytimes.com/privacy/privacy-policy"
},
{
"propertyName": "Categories",
"propertyValue": "Lifestyle and Entertainment"
}
]
}

Просмотреть файл

@ -0,0 +1,23 @@
{
"properties": {
"connectionParameters": {
"api_key": {
"type": "securestring",
"uiDefinition": {
"displayName": "apikey",
"description": "The apikey for this api",
"tooltip": "Provide your apikey",
"constraints": {
"tabIndex": 2,
"clearText": false,
"required": "true"
}
}
}
},
"iconBrandColor": "#da3b01",
"capabilities": [],
"publisher": "Roy Paar",
"stackOwner": "New York Times"
}
}

Просмотреть файл

@ -0,0 +1,26 @@
# New York Times
The New York Times allows anyone to search articles by keyword, date, section, and popularity. This connector allows a user to pull this data into their app, flow, or report.
## Publisher: Roy Paar
## Prerequisites
This API uses an API key. Register on the NYTimes Developer Portal (https://developer.nytimes.com/) for a free account. Then create an application. Then add the following three APIs to the application. Copy and paste the API key into the Power Platform connection.
1. Article Search API - Use the Article Search API to look up NYTimes articles by keyword.
2. Top Stories API - The Top Stories API returns an array of NYTimes articles currently on the specified section.
3. Most Popular API - The Most Popular API returns the most popular articles on NYTimes.com based on views.
## Supported Operations
### Article Search
Get a list of articles by keyword. Enter a keyword into the 'q' field and optionally filter by begin_date or end_date.
### Top Stories
Get a list of top stories by section. Available sections are arts, automobiles, books, business, fashion, food, health, home, insider, magazine, movies, nyregion, obituaries, opinion, politics, realestate, science, sports, sundayreview, technology, theater, t-magazine, travel, upshot, us, and world.
### Most Viewed
Get a list of articles by popularity (number of views). Choose a time period of 1, 7, or 30 days.
## API Documentation
https://developer.nytimes.com/apis
## Known Issues and Limitations
None.