QAnswer

QAnswer

  • Docs
  • API
  • Community
  • Blog

›Tutorial (API)

Introduction

  • Introduction

Quick Intro

  • Create a Playground
  • Create our first node
  • Create our first relation
  • My creativity ....
  • Learning a bit ....
  • Making it prettier
  • Free me in the WWW

Tutorial (UI)

  • Part 1 (RDF to QA)
  • Part 2 (Signup and Login)
  • Part 3 (Upload and index)
  • Part 4 (Query)
  • Part 5 (Feedback and train)
  • Part 6 (Contextual information)
  • Part 7 (Additional services)

Tutorial (API)

  • Part 1 (API)
  • Part 2 (Signup and Login)
  • Part 3 (Upload and index)
  • Part 4 (Query)
  • Part 5 (Feedback and train)
  • Part 6 (Contextual information)
  • Part 7 (Additional services)

Requirements

  • Requirements
  • Requirement 1
  • Requirement 2
  • Requirement 3 (Optional)

Terms of Use

  • Terms of use

Tutorial: Signup and Login

We have seen in the previus section which is the relation between your RDF data and the questions you can answer with it. To index your RDF dataset you need to signup to the QAnswer platform. This can be done using the following code snippets:

cURL
Java
JavaScript
curl -X POST \
'http://qanswer-core1.univ-st-etienne.fr/api/user/signup' \
-H 'Content-Type: application/json' \
-d '{"name": "NAME", "email":"EMAIL", "username":"USERNAME", "password":"PASSWORD"}'
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"name\": \"NAME\", \"email\":\"EMAIL\", \"username\":\"USERNAME\", \"password\":\"PASSWORD\"}");
Request request = new Request.Builder()
.url("http://qanswer-core1.univ-st-etienne.fr/api/user/signup")
.post(body)
.addHeader("Content-Type", "application/json")
.build();

Response response = client.newCall(request).execute();
var settings = {
"async": true,
"crossDomain": true,
"url": "http://qanswer-core1.univ-st-etienne.fr/api/user/signup",
"method": "POST",
"headers": {
"Content-Type": "application/json",
},
"processData": false,
"data": "{\"name\": \"NAME\", \"email\":\"EMAIL\", \"username\":\"USERNAME\", \"password\":\"PASSWORD\"}"
}

$.ajax(settings).done(function (response) {
console.log(response);
});

After you will directly be able to login. This can be done using the following code snippets:

cURL
Java
JavaScript
curl -X POST \
'http://qanswer-core1.univ-st-etienne.fr/api/user/signin' \
-H 'Content-Type: application/json' \
-d '{"usernameOrEmail": "USERNAME", "password":"PASSWORD"}'
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"usernameOrEmail\": \"USERNAME\", \"password\":\"PASSWORD\"}");
Request request = new Request.Builder()
.url("http://qanswer-core1.univ-st-etienne.fr/api/user/signin")
.post(body)
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();
var settings = {
"async": true,
"crossDomain": true,
"url": "http://qanswer-core1.univ-st-etienne.fr/api/user/signin",
"method": "POST",
"headers": {
"Content-Type": "application/json",
},
"processData": false,
"data": "{\"usernameOrEmail\": \"USERNAME\", \"password\":\"PASSWORD\"}"
}

$.ajax(settings).done(function (response) {
console.log(response);
});

After logging in you will get a Bearer token that you have to use for all subsequent calls to identify with respect to the service.

← Part 1 (API)Part 3 (Upload and index) →
Docs
Getting StartedAPI ReferenceTerms of use
Community
Twitter
More
GitHubStar
Us
Imprint
Copyright © 2021 QAnswer