Skip to content

How to call the HOP service I created?

Konstantinos Panayiotou edited this page Jul 28, 2016 · 4 revisions

As previously stated here we provide and maintain API(s) for the following programming languages:

  • Python
  • JavaScript
  • C++

For simplicity, we will describe the procedure of calling a HOP Web Service using the python rapp-platform-api.

We assume that you have previously read on How-to-write-the-API-for-a-HOP-Service and implemented the respective Cloud Message class.

Usage of the Python implementation of the rapp-platform-api is also described here

You can also use curl cli to make calls to the RAPP Platform Web Services. An example of calling the ontology_subclasses_of web service, using curl-cli is presented below:

curl -X POST -d 'json={"ontology_class":"Oven", "recursive": true}' -H "Accept-Token:rapp_token" localhost:9001/hop/ontology_subclasses_of
POST /hop/ontology_subclasses_of HTTP/1.1
Host: localhost:9001
User-Agent: curl/7.49.1
Accept: */*
Accept-Token:rapp_token
Content-Length: 49
Content-Type: application/x-www-form-urlencoded

json={"ontology_class":"Oven", "recursive": true}

HTTP/1.1 200 Ok

Content-Length: 211
Connection: keep-alive
Content-type: application/json; charset=UTF-8
Server: Hop

{"results":["http://knowrob.org/kb/knowrob.owl#Oven","http://knowrob.org/kb/knowrob.owl#MicrowaveOven","http://knowrob.org/kb/knowrob.owl#RegularOven","http://knowrob.org/kb/knowrob.owl#ToasterOven"],"error":""}
Clone this wiki locally