API Documentation
get
http://api.iapp.co.th/qa-generator-th

Response Body

Name
Type
Description
QA
Array
Array of question and answer
question
String
Generated question from original text
answer
String
Gnerated answer from original text
context
String
Original text
number
Integer
Number of generated question
time_process
Float
time to process questions

Sample Request

cURL
Java Unirest
NodeJs Request
Objective C
PHP
Python
1
curl --location --request GET 'http://api.iapp.co.th/qa-generator-th?text=ผมพูดง่วงมาก&apikey=eufbCBjpYMaNbComOEycc52rX6ZqhbbN'
Copied!
1
Unirest.setTimeouts(0, 0);
2
HttpResponse<String> response = Unirest.get("http://api.iapp.co.th/qa-generator-th?text=ผมพูดง่วงมาก&apikey=eufbCBjpYMaNbComOEycc52rX6ZqhbbN")
3
.asString();
4
Copied!
1
var request = require('request');
2
var options = {
3
'method': 'GET',
4
'url': 'http://api.iapp.co.th/qa-generator-th?text=ผมพูดง่วงมาก&apikey=eufbCBjpYMaNbComOEycc52rX6ZqhbbN',
5
'headers': {
6
}
7
};
8
request(options, function (error, response) {
9
if (error) throw new Error(error);
10
console.log(response.body);
11
});
12
Copied!
1
#import <Foundation/Foundation.h>
2
3
dispatch_semaphore_t sema = dispatch_semaphore_create(0);
4
5
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://api.iapp.co.th/qa-generator-th?text=%E0%B8%9C%E0%B8%A1%E0%B8%9E%E0%B8%B9%E0%B8%94%E0%B8%87%E0%B9%88%E0%B8%A7%E0%B8%87%E0%B8%A1%E0%B8%B2%E0%B8%81&apikey=eufbCBjpYMaNbComOEycc52rX6ZqhbbN"]
6
cachePolicy:NSURLRequestUseProtocolCachePolicy
7
timeoutInterval:10.0];
8
9
[request setHTTPMethod:@"GET"];
10
11
NSURLSession *session = [NSURLSession sharedSession];
12
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
13
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
14
if (error) {
15
NSLog(@"%@", error);
16
dispatch_semaphore_signal(sema);
17
} else {
18
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
19
NSError *parseError = nil;
20
NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
21
NSLog(@"%@",responseDictionary);
22
dispatch_semaphore_signal(sema);
23
}
24
}];
25
[dataTask resume];
26
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
Copied!
1
<?php
2
3
$curl = curl_init();
4
5
curl_setopt_array($curl, array(
6
CURLOPT_URL => 'http://api.iapp.co.th/qa-generator-th?text=%E0%B8%9C%E0%B8%A1%E0%B8%9E%E0%B8%B9%E0%B8%94%E0%B8%87%E0%B9%88%E0%B8%A7%E0%B8%87%E0%B8%A1%E0%B8%B2%E0%B8%81&apikey=eufbCBjpYMaNbComOEycc52rX6ZqhbbN',
7
CURLOPT_RETURNTRANSFER => true,
8
CURLOPT_ENCODING => '',
9
CURLOPT_MAXREDIRS => 10,
10
CURLOPT_TIMEOUT => 0,
11
CURLOPT_FOLLOWLOCATION => true,
12
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
13
CURLOPT_CUSTOMREQUEST => 'GET',
14
));
15
16
$response = curl_exec($curl);
17
18
curl_close($curl);
19
echo $response;
20
Copied!
1
import requests
2
3
url = "http://api.iapp.co.th/qa-generator-th?text=ผมพูดง่วงมาก&apikey=eufbCBjpYMaNbComOEycc52rX6ZqhbbN"
4
5
payload={}
6
headers = {}
7
8
response = requests.request("GET", url, headers=headers, data=payload)
9
10
print(response.text)
Copied!
Last modified 1mo ago
Copy link