Search code examples
ibm-cloud

How to connect the back end and the front end and use the Discovery API in IBM cloud app services?


I am very new to using APIs so please excuse me. I am currently using a Python-Django App service from IBM cloud app services and the IBM Watson Discovery resouce. I have followed all the steps given here:

https://console.bluemix.net/docs/apps/tutorials/tutorial_web.html#before-you-begin

I have a machine that has docker and so the app got built successfully. However I am lost as to how I am supposed to get the front end ( which I am writing in bootstrap, javascript ) to connect to the backend and link the API.

EDIT For example : I want my app to accept documents, feed them in Discovery, extract the keywords and sentiments and display them in the UI. How do I know what to access from the server side code and what to link where in the UI.

It is a very broad question but its a compulsory project I need to do and I am clueless. Pleaassee Help !


Solution

  • Before you try to integrate an API, you will need to be familiar with Python and Django. If that is not the case, then you really need to go through a series of tutorials.

    Then before deploying to the cloud, you will be better off running your Django app locally on your laptop. Use pip to install the watson-developer-cloud pypi module and use the API documentation to build the python code in your Django application - https://www.ibm.com/watson/developercloud/discovery/api/v1/python.html?python#query

    If none of this makes sense, then you need to brush up on your knowledge of Python, Pip, and Django.

    When you have the app running on your machine, then you will be ready to package it up into either a docker image or cloud foundry container and deploy to the cloud.