Testing the News API with Postman
If you are looking for a quick and straightforward way of testing the News API and familiarizing yourself with its various endpoints and parameters, you may want to consider our Postman integration and our Query Builder).
Postman is a suite of tools for testing, building and documenting APIs which can be downloaded for free from here.
Once you've downloaded and installed Postman, follow the steps below to get up and running with the News API:
Step 1
Before starting, make sure you have created a News API account and have access to your App ID and Key. Click here to create a free account.
Step 2
Open Postman, and click on the Import button on the top left corner:
Step 3
In the Import dialog, click on the Import From Link button and paste the following URL into the input box, and click Import.
https://raw.githubusercontent.com/AYLIEN/apis/master/aylien/v5/news/api.yaml
Step 4
You will need to generate the Postman collection from the input yaml file you have imported. To do this, name your collection and click Generate Collection.
Once the schema is imported, you should be able to see a new collection on the left hand side.
Adding your API credentials
Once your schema is imported, the first step is to add your App ID and Key. Click on the List Stories endpoint in your collection, then click on Headers. This will reveal two fields (X-AYLIEN-NewsAPI-Application-ID
and X-AYLIEN-NewsAPI-Application-Key
) where you can add your credentials.
Step 5
After you've added your credentials, you'll need to replace the placeholder {{baseUrl}}
text with https://api.aylien.com/news
.
Now can configure your request and set its parameters by clicking on Params. Doing so reveals all the available parameters for any endpoint, allowing you to view or edit any of the parameters. Once you're finished, click on Send to submit the request and retrieve the results in JSON format in the box below.