Introduction
Welcome to the Kittn API! You can use our API to access Kittn API endpoints, which can get information on various cats, kittens, and breeds in our database.
We have language bindings in Shell, Ruby, Python, and JavaScript! You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right.
This example API documentation page was created with Slate. Feel free to edit it and use it as a base for your own API's documentation.
Authentication
To call the APIs, we will have to init the SDK with the parameters ClientID and SecretKey taken when you create the Application on CMS for partners according to the following instructions:
- Log in to CMS Partner with the username/password provided (https://fcloud-partner-cms.ftech.ai)
- Buy a service package
- Create App
Server Integrator
After integrating the SDK, the Fcloud service supports server-server callbacks to help get request information as quickly and accurately as possible.
Web SDK
Android SDK
Install SDK Android
Setup gradle maven
- With Gradle v1.x - v5.x
Open
build.grade
file and add maven line like below
allprojects {
repositories {
google()
mavenCentral()
maven { url 'https://jitpack.io' } <- add this line
}
}
- With Gradle v6.x+
Open
setting.gradle
file and add maven line like below
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
repositories {
google()
mavenCentral()
maven { url 'https://jitpack.io' } <- add this line
}
}
Open file app/build.grade then add sdk
dependencies {
...
implementation "com.github.ftechmobile:ioe-sdk-android:1.0.7"
}
Init in file Application
override fun onCreate() {
super.onCreate()
...
FTechIOEManager.init(this)
}
SDK Android Integration
Init
Param | Type | Description |
---|---|---|
appId | String | Application id |
secretKey | String | IOE secret key |
- After successful initial, the SDK returns a status resulting in the
onSuccess()
callback. Handling of successful initial here. - When initial fails, it will be processed at callback
onFail()
.
FTechIOEManager.initRecord(appId, secretKey, new IFTechIOECallback<Boolean>() {
@Override
public void onSuccess(Boolean info) {
}
@Override
public void onFail(APIException error) {
}
@Override
public void onCancel() {
}
});
Register callback
After registration, the SDK will return the corresponding status in the callback
Status | Description |
---|---|
onStart | Called at start record |
onRecording | Called while in process recording |
onFail | Called when an error occurs in process recording |
onComplete | Called when completed record process and return evaluate result |
FTechIOEManager.registerRecordingListener(new IFTechRecordingCallback() {
@Override
public void onStart() {
}
@Override
public void onRecording() {
}
@Override
public void onFail(@NonNull APIException error) {
}
@Override
public void onComplete(@NonNull StopRecordIOEResponse result) {
}
});
SDK Android Feature
Start record
Param | Type | Description |
---|---|---|
referenceText | String | Pronunciation reference text |
languageAccent | LanguageAccent | Pronunciation language accent |
extraData | String | Attach data (Optional) |
- Used to start record for IOE evaluate pronunciation
- When successful start, the SDK starts entering the recording state, it will be called on
onStart()
in recording callback. Handling start record successfully here. - When start record fails, it will be processed at callback
onFail()
in recording callback.
FTechIOEManager.startRecord(referText, accent, extraData);
Stop record
- Used to stop record and start evaluate pronunciation process
- When successful evaluate, the SDK will be return evaluate result on
onComplete()
in recording callback. Handling stop record successfully here. - When stop record and evaluate fails, it will be processed at callback
onFail()
in recording callback.
FTechIOEManager.stopRecord();
IOS SDK
Install SDK IOS
Dowload SDK
You can download here
Add existing frameworks
- In the project navigator, select your project
- Select your target
- Select the "Build Phases" tab
- Open "Link Binaries With Libraries" expander
- Click the
+
button - Click the
Add Other...
- Select
FSound.xcframework
framework
SDK IOS Integration
Init
Param | Type | Description |
---|---|---|
appId | String | Application id |
secretKey | String | IOE secret key |
FTechIOEManager.instance().initRecord(appId: "", key: "")
Register callback
After registration, the SDK will return the corresponding status in the callback
Status | Description |
---|---|
initRecord | Call when init success |
onStart | Called at start record |
onRecording | Called while in process recording |
onFail | Called when an error occurs in process recording |
onComplete | Called when completed record process and return evaluate result |
- Implement
FTechIOEManagerDelegate
func initRecord(success: Bool) {
}
func onStart() {
}
func onRecording() {
}
func onFailure(error: FSoundError) {
}
func onCompletionRecord(data: StopRecordIOEResponse) {
}
SDK IOS Feature
Start record
Param | Type | Description |
---|---|---|
referenceText | String | Pronunciation reference text |
languageAccent | LanguageAccent | Pronunciation language accent (Optional - Default English accent) |
extraData | String | Attach data (Optional) |
- Used to start record for IOE evaluate pronunciation
- When start record fails, it will be processed at callback
onFail()
in recording callback.
FTechIOEManager.instance().startRecord(referenceText: "")
Stop record
- Used to stop record and start evaluate pronunciation process
- When successful evaluate, the SDK will be return evaluate result on
onComplete()
in recording callback. Handling stop record successfully here. - When stop record and evaluate fails, it will be processed at callback
onFail()
in recording callback.
FTechIOEManager.instance().stopRecord()
Errors
The Kittn API uses the following error codes:
Error Code | Meaning |
---|---|
400 | Bad Request -- Your request is invalid. |
401 | Unauthorized -- Your API key is wrong. |
403 | Forbidden -- The kitten requested is hidden for administrators only. |
404 | Not Found -- The specified kitten could not be found. |
405 | Method Not Allowed -- You tried to access a kitten with an invalid method. |
406 | Not Acceptable -- You requested a format that isn't json. |
429 | Too Many Requests -- You're requesting too many kittens! Slow down! |
500 | Internal Server Error -- We had a problem with our server. Try again later. |
503 | Service Unavailable -- We're temporarily offline for maintenance. Please try again later. |