This is part 1 to build an event management application called EventQuarry, integrated into Slack, using API management, event-based APIs in OpenWhisk, Google Sheets API, IBM Watson to create a Conversation bot.
- Create API Connect API v1.0.0
- Publish the API
- Create an OpenWhisk action
- Connect API Connect to OpenWhisk
This tutorial uses the OpenWhisk service and the API Connect service on http://bluemix.net, the IBM Cloud. Create an account on IBM Bluemix to run this tutorial.
1. Create API Connect API v1.0.0
- Go to the Bluemix Catalog, find the API Connect service,
- Create the API Connect service and open the API Connect service, this will take you by default to the ‘Drafts’ view in the ‘Designer’ perspective,
- In the ‘Drafts’ view there are a ‘Designer’ and an ‘Explore’ perspective,
- In addition to the ‘Drafts’ view, there is a ‘Sandbox’ view in the ‘Catalog’, which is where you see the ‘Products’. Currently, there are no Products yet, we only created a Draft,
- Open the API Connect Drafts
- Add a New API titled ‘<username>-slackapp’
- Title: ‘<username>-slackapp’
- Name: ‘<username>-slackapp’
- Base Path: /slackapp
- Version: 1.0.0
Click the ‘Create API’ button,
In the ‘Design’ tab, click the ‘Paths’,
March 11, 2017
api, api connect, bluemix, dev, open api specification, openwhisk
Read more >
- Setup Details
- Add Watson AlchemyAPI
- Add Cloudant DB
- Login to Bluemix, in a separate tab login to Github,
- In Bluemix open Catalog->Boilerplates and create a ‘Node.js Cloudant DB Web Starter’ Boilerplate, named ‘<username>-nodejs-app1’, click CREATE
- Go to ‘Overview’, scroll down to ‘Continuous delivery’ and click ‘Enable’
- In the ‘Toolchain Settings’, change the name of the Toolchain to ‘<username>-nodejs-app1’, and click Create,
- If the Github THINK or CODE icon displays a configuration error, from the block’s dropdown icon in the topright, click the ‘Configure’ link to correct the configuration of your Github account,
- Go to your Github account and make sure that the repository for the new Bluemix app is created successfully,
- Copy the Git URL, on localhost open a commandline terminal, change to your development directory and clone the new repository,
git clone https://github.com/remkohdev/remkohdev-nodejs-app1.git
- Open the project directory in your favorite editor,
- Open the ‘package.json’ file and change the ‘name’ property to ‘<username>-nodejs-app1’,
- From the commandline, in your project directory,
git add .
commit -m "change package.json name property"
January 8, 2017
api, bluemix, cloudant, dev, node.js, node.js, watson
Read more >
An extended version of this tutorial, adding a Cloudant NoSQL Database and D3js data visualization, is available here.
- Bluemix account
- Github account
- Create the StarterApp
- Add the Toolchain or Continuous Integration (CI)
- REST API Primer
- Authentication in REST API
- Getting the Bluemix Configuration
- Add the AlchemyData News API Client
- Add a Web Form
- Implement the AlchemyData News API Request
- Create Authorization Header for Basic Auth
1. Create the StarterApp
November 22, 2016
api, bluemix, dev, java, watson
Read more >
You must have Python installed. Check to see if you have Python installed from the commandline:
Table of Contents:
- Create a Starterapp
- Git Clone and Setup
- Create Additional Folders and Files
- Commit and Push Changes to Repository, Build and Deploy
- Create an AlchemyAPI service
- Create a Cloudant NoSQL service
- Add the Basic Workflow for Request-Response
- Get News using AlchemyAPI
- Create Helper Functions
- Save Responses in Cloudant
- Parse Response for D3js
- Draw the Line Chart in D3js
You can import AlchemyAPI requests into Postman with this Postman collection.
The source code for the application can be viewed or cloned from Github.
1. Create a Starterapp
- Go to Catalog > Boilerplates
- Click the ‘Python Flask’ starterapp
- For name enter <username>-newssentiment
- Go to Overview
- Under ‘Continuous Integration’ click ‘Add GIT Repo and Pipeline’ to add a DevOps platform, select ‘Populate the repo with the starterapp packageand enable Build & Deploy pipeline’ > Click Continue > Click ‘CLOSE’.
- Click ‘EDIT CODE’.
- The very first time you login to the ‘DevOps’ environment you will need to pick a username for the ‘DevOps’ environment.
- In the left menu of icons, click the top folder icon, and click ‘Git URL’ to copy the Git repository url.
- If you prefer to edit in the online editor in Bluemix, click ‘EDIT CODE’ button and then click the second pencil icon in the left menu of icons.
- I will continue to work on localhost instead.
September 25, 2016
api, bluemix, cloudant, d3js, data visualization, dev, python, watson
Read more >
(updated: 20170319) WIP
This is part 3 in a series to build a sample application called QAVideos using API Connect. QAVideos is a Question and Answer application that uses videos instead of text. Think of QAVideos as StackOverflow meets Youtube. QAVideos will use LoopBack, API Connect, Open API Initiative (OAI formerly Swagger.io), OpenWhisk, Object Storage.
- In part 1 ‘QAVideos (Part 1), Adding User Management to Node.js’, I added User Management to a Node.js app using API Connect.
- In part 2 ‘QAVideos (Part 2), Adding a Custom Model and ORM in Node.js‘, I added a custom data model, i.e. a Video model, and used ORM to persist the model to a PostgreSQL database.
- In part 3 ‘QAVideos (Part 3), Extend Model and Using Open API Initiative (OAI) in Node.js‘, I extend the built-in User model with a Member, add a Question and Answer based on the Video model, and add a Sticker, while using the Open API Specification to define and manage the application and APIs.
- In next parts, the idea is to add other possibly features: deploy the OAI definition file to Bluemix via API Connect, add Object Storage for Video support, create an Ionic/Apache Cordova based mobile client, add an automated build, deployment and test script, add a Content Delivery Network (CDN) to the backend, add event-driven OpenWhisk APIs, containerize the application, add chat, and possibly more.
- Node, npm, and API Connect must be installed,
- Check if the ‘apic’ tool is installed, by running ‘apic -v’ from the commandline. If not installed, follow the installation instructions, here.
- Get the source code from part 2 of this tutorial.
- Test if QAVideos (part 2) is running correctly by typing ‘apic start’ in the root directory, open a browser and go to ‘http://0.0.0.0:4001’ in your browser.
Table of Content
- The OAI Definition File
- Create the Extended Data Model
Open API Initiative (OAI, based on Swagger)
The OAI is based on Swagger.io, an API Framework. The OAI is an open API definition standard. Frameworks like API Connect use the OAI definition file to generate the server, client, data model and documentation.
July 29, 2016
Read more >