API Documentation

Thai TTS API Request

Kaitom Voice Request

get
https://api.iapp.co.th
/thai-tts-kaitom/tts
Kaitom Voice

Kaitom Voice Sample Used Option and Fields Parameter

cURL
Java-Unirest
NodeJS-Request
Objective C
PHP
Python
1
curl --location --request GET 'https://api.iapp.co.th/thai-tts-kaitom/tts?text={Your Text}' \
2
--header 'apikey: {Your API Key}'
Copied!
1
Unirest.setTimeouts(0, 0);
2
HttpResponse<String> response = Unirest.get("https://api.iapp.co.th/thai-tts-kaitom/tts?text={Your Text}")
3
.header("apikey", "{Your API Key}")
4
.asString();
Copied!
1
var request = require('request');
2
var options = {
3
'method': 'GET',
4
'url': 'https://api.iapp.co.th/thai-tts-cee/tts?text={Your Text}',
5
'headers': {
6
'apikey': '{Your API Key}'
7
},
8
form: {
9
10
}
11
};
12
request(options, function (error, response) {
13
if (error) throw new Error(error);
14
console.log(response.body);
15
});
Copied!
1
#import <Foundation/Foundation.h>
2
3
dispatch_semaphore_t sema = dispatch_semaphore_create(0);
4
5
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://api.iapp.co.th/thai-tts-kaitom/tts?text={Your Text}"]
6
cachePolicy:NSURLRequestUseProtocolCachePolicy
7
timeoutInterval:10.0];
8
NSDictionary *headers = @{
9
@"apikey": @"{Your API Key}"
10
};
11
12
[request setAllHTTPHeaderFields:headers];
13
[request setHTTPBody:postData];
14
15
[request setHTTPMethod:@"GET"];
16
17
NSURLSession *session = [NSURLSession sharedSession];
18
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
19
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
20
if (error) {
21
NSLog(@"%@", error);
22
dispatch_semaphore_signal(sema);
23
} else {
24
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
25
NSError *parseError = nil;
26
NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
27
NSLog(@"%@",responseDictionary);
28
dispatch_semaphore_signal(sema);
29
}
30
}];
31
[dataTask resume];
32
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
Copied!
1
<?php
2
require_once 'HTTP/Request2.php';
3
$request = new HTTP_Request2();
4
$request->setUrl('https://api.iapp.co.th/thai-tts-kaitom/tts?text={Your Text}');
5
$request->setMethod(HTTP_Request2::METHOD_GET);
6
$request->setConfig(array(
7
'follow_redirects' => TRUE
8
));
9
$request->setHeader(array(
10
'apikey' => '{Your API Key}'
11
));
12
try {
13
$response = $request->send();
14
if ($response->getStatus() == 200) {
15
echo $response->getBody();
16
}
17
else {
18
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
19
$response->getReasonPhrase();
20
}
21
}
22
catch(HTTP_Request2_Exception $e) {
23
echo 'Error: ' . $e->getMessage();
24
}
Copied!
1
import requests
2
3
url = "https://api.iapp.co.th/thai-tts-kaitom/tts?text={Your Text}"
4
5
payload={}
6
headers = {
7
'apikey': '{Your API Key}'
8
}
9
10
response = requests.request("GET", url, headers=headers, data=payload)
11
12
print(response.text)
Copied!

Cee Thai Celebrity Voice Request

get
https://api.iapp.co.th
/thai-tts-cee/tts
Cee Thai Celebrity Voice

Cee Voice Sample Used Option and Fields Parameter

cURL
Java - Unirest
NodeJs - Request
Objective C
PHP
Python
1
curl --location --request GET 'https://api.iapp.co.th/thai-tts-cee/tts?text={Your Text}' \
2
--header 'apikey: {Your API Key}'
Copied!
1
Unirest.setTimeouts(0, 0);
2
HttpResponse<String> response = Unirest.get("https://api.iapp.co.th/thai-tts-cee/tts?text={Your Text}")
3
.header("apikey", "{Your API Key}")
4
.asString();
Copied!
1
var request = require('request');
2
var options = {
3
'method': 'GET',
4
'url': 'https://api.iapp.co.th/thai-tts-cee/tts?text={Your Text}',
5
'headers': {
6
'apikey': '{Your API Key}'
7
},
8
form: {
9
10
}
11
};
12
request(options, function (error, response) {
13
if (error) throw new Error(error);
14
console.log(response.body);
15
});
Copied!
1
#import <Foundation/Foundation.h>
2
3
dispatch_semaphore_t sema = dispatch_semaphore_create(0);
4
5
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://api.iapp.co.th/thai-tts-cee/tts?text={Your Text}"]
6
cachePolicy:NSURLRequestUseProtocolCachePolicy
7
timeoutInterval:10.0];
8
NSDictionary *headers = @{
9
@"apikey": @"{Your API Key}"
10
};
11
12
[request setAllHTTPHeaderFields:headers];
13
[request setHTTPBody:postData];
14
15
[request setHTTPMethod:@"GET"];
16
17
NSURLSession *session = [NSURLSession sharedSession];
18
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
19
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
20
if (error) {
21
NSLog(@"%@", error);
22
dispatch_semaphore_signal(sema);
23
} else {
24
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
25
NSError *parseError = nil;
26
NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
27
NSLog(@"%@",responseDictionary);
28
dispatch_semaphore_signal(sema);
29
}
30
}];
31
[dataTask resume];
32
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
Copied!
1
<?php
2
require_once 'HTTP/Request2.php';
3
$request = new HTTP_Request2();
4
$request->setUrl('https://api.iapp.co.th/thai-tts-cee/tts?text={Your Text}');
5
$request->setMethod(HTTP_Request2::METHOD_GET);
6
$request->setConfig(array(
7
'follow_redirects' => TRUE
8
));
9
$request->setHeader(array(
10
'apikey' => '{Your API Key}'
11
));
12
try {
13
$response = $request->send();
14
if ($response->getStatus() == 200) {
15
echo $response->getBody();
16
}
17
else {
18
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
19
$response->getReasonPhrase();
20
}
21
}
22
catch(HTTP_Request2_Exception $e) {
23
echo 'Error: ' . $e->getMessage();
24
}
Copied!
1
import requests
2
3
url = "https://api.iapp.co.th/thai-tts-cee/tts?text={Your Text}"
4
5
payload={}
6
headers = {
7
'apikey': '{Your API Key}'
8
}
9
10
response = requests.request("GET", url, headers=headers, data=payload)
11
12
print(response.text)
Copied!