![]() ![]() We can use the Feeds Extensible Parsers module to parse the JSON. Feeds Extensible Parsers moduleīecause the Breaking Bad API returns to us a JSON response, we need a JSON parsing system in Drupal. This will be the module doing most of the work and processing to import the items from the JSON API into Drupal. Feeds moduleįirst of all, we need to install the Feeds module. I will not be covering how to do that, but will say for this example, I used the Drupal 8 Quickstart provided by DDev-Local for my local environment setup. This assumes you have a running Composer-based Drupal installation already. Authentication with Feeds is outside the scope of this post. Under normal circumstances and real projects, APIs will typically be locked down and only accessible with an authenticated user. This API is free and open to use for the public and is great for testing purposes. It appears the API just returns an array of JSON objects, which obviously are Breaking Bad characters and various attributes about the characters. The Breaking Bad API offers a few different endpoints, but I decided to use the Characters endpoint as the source that will be imported as Drupal Character nodes. The 3rd party API I chose to use for the purposes of this blog post is about one of my favorite TV shows that you’ve probably heard of, Breaking Bad. In this blog post, I wanted to document my journey of how I was able to get Feeds to import into Drupal 8 from a 3rd party API that provides JSON data. Most of the resources, however, are specific to XML and RSS feeds. Navigate to the edit screen and check out some of your newly imported content.There are many resources online around using the Feeds module in Drupal 8 to import data from a 3rd party API. If all went well, your new content should now exist as nodes in Drupal.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |