NAV
javascript

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:

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

allprojects {
    repositories {
        google()  
        mavenCentral()
        maven { url 'https://jitpack.io' } <- add this line
    }
}

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
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)
FTechIOEManager.startRecord(referText, accent, extraData);

Stop record

FTechIOEManager.stopRecord();

IOS SDK

Install SDK IOS

Dowload SDK

You can download here

Add existing frameworks

  1. In the project navigator, select your project
  2. Select your target
  3. Select the "Build Phases" tab
  4. Open "Link Binaries With Libraries" expander
  5. Click the + button
  6. Click the Add Other...
  7. 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
    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)
FTechIOEManager.instance().startRecord(referenceText: "")

Stop record

    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.