Sentiment Analysis

POST https://openapi.akool.com/api/open/v3/content/analysis/sentiment

Request Headers

ParameterValueDescription
AuthorizationBearer tokenYour API Key used for request authorization. You can get from https://openapi.akool.com/api/open/v3/getToken api.

Body Attributes

ParameterTypeValueDescription
urlStringThe video url or image url.
typeNumber1: image 2:video
languageStringWhen type=2, the language of the video needs to be provided。 Supplying the input language in ISO-639-1 format
webhookUrlStringCallback url address based on HTTP request.

Response Attributes

ParameterTypeValueDescription
codeint1000Interface returns business status code(1000:success)
msgStringInterface returns status information
dataObject{ "_id": "", "status": 1 }_id: Interface returns data, status: the status of video: [1:queueing, 2:processing, 3:completed, 4:failed]

Example

Body

{
   
    "type":1,   // 1:image 2:video
    "url":"https://drz0f01yeq1cx.cloudfront.net/1714023431475-food.jpg",
    "webhookUrl":"http://localhost:3004/api/v3/webhook"
}

Request

Response

{
    "code": 1000,
    "msg": "OK",
    "data": {
        "create_time": 1710757900382,
        "uid": 101690,
        "type": 1,
        "status": 1,   // current status of content: 【1:queueing(The requested operation is being processed),2:processing(The requested operation is being processing),3:completed(The request operation has been processed successfully),4:failed(The request operation processing failed)】
        "webhookUrl": "http://localhost:3007/api/open/v3/test/webhook",
        "result": "",
        "_id": "65f8180c24d9989e93dde3b6",
        "__v": 0
    }
}

Get analysis Info Result

GET https://openapi.akool.com/api/open/v3/content/analysis/infobyid?_id=662df7928ee006bf033b64bf

Request Headers

ParameterValueDescription
AuthorizationBearer tokenYour API Key used for request authorization. You can get from https://openapi.akool.com/api/open/v3/getToken api.

Query Attributes

ParameterTypeValueDescription
_idStringNULLvideo db id: You can get it based on the _id field returned by https://openapi.akool.com/api/open/v3/content/analysis/sentiment .

Response Attributes

ParameterTypeValueDescription
codeint1000Interface returns business status code(1000:success)
msgStringOKInterface returns status information
dataObject{ status:1, _id:"", result:"" }video_status: the status of video:【1:queueing, 2:processing, 3:completed, 4:failed】 result: sentiment analysis result【POSITIVE related information, NEGATIVE related information】 _id: Interface returns data

Example

Request

Response


{
    "code": 1000,
    "msg": "OK",
    "data": {
        "_id": "662e20b93baa7aa53169a325",
        "uid": 100002,
        "status": 3,
        "result": "POSITIVE"
    }
}

Response Code Description

Please note that if the value of the response code is not equal to 1000, the request is failed or wrong
ParameterValueDescription
code1000Success
code1003Parameter error or Parameter can not be empty
code1008The content you get does not exist
code1009You do not have permission to operate
code1101Invalid authorization or The request token has expired
code1102Authorization cannot be empty
code1200The account has been banned
code1201create audio error, please try again later
code1202The same video cannot be translated lipSync in the same language more than 1 times
code1203video should be with audio