5. Add Tenant SettingsΒΆ
The following tenant settings are used to get a response from the top headlines endpoint. Review the endpoint documentation for more information about the endpoint.
In Sitecore, open Content Editor.
Navigate to sitecore > system > Data Exchange > Data Exchange Tenant for News API > Tenant Settings.
Add RESTful Tenant Settings.
Hint
This template is a command template. It does not prompt for the item name. The command template assigns the item name automatically.
Navigate to sitecore > system > Data Exchange > Data Exchange Tenant for News API > Tenant Settings > RESTful > Headers.
Add Request Header with the following field values:
Name
Value
Name
Accept JSON
Display Name
Accept: application/json
Header Name
Accept
Header Value
application/json
Add Request Header with the following field values:
Name
Value
Name
X-Api-Key
Header Name
X-Api-Key
Header Value
Note
Add API key created in Get News API Key step.
Navigate to sitecore > system > Data Exchange > Data Exchange Tenant for News API > Tenant Settings > RESTful > Parameters.
Add Request Parameter with the following field values:
Name
Value
Name
Sources
Parameter Name
{sources}
Parameter Value
Note
Select source from news source.
Tip
The sources value can be added to the resource url; however, using parameters provide the flexibility to reuse in other settings.
Navigate to sitecore > system > Data Exchange > Data Exchange Tenant for News API > Tenant Settings > RESTful > Resources.
Add Resource with the following field values:
Name
Value
Name
/v2/top-headlines?sources={sources}
Method
GET
Headers
sitecore > system > Data Exchange > Data Exchange Tenant for News API > Tenant Settings > RESTful > Headers > Accept JSON
sitecore > system > Data Exchange > Data Exchange Tenant for News API > Tenant Settings > RESTful > Headers > X-Api-Key
Parameters
sitecore > system > Data Exchange > Data Exchange Tenant for News API > Tenant Settings > RESTful > Parameters > Sources
Navigate to sitecore > system > Data Exchange > Data Exchange Tenant for News API > Tenant Settings > RESTful > Applications.
Add Application with the following field values:
Name
Value
Name
News API
Base Url