2.7-Image File Upload
1. Overview
Interface name: Picture upload
Version number: v1.0.0
2. Information
Request method: POST
Request URL: https://DOMAIN/openapi/v1/knowledge/image/
Domain: Refer to "Service address description"
3. Request parameters
Note: The request is in form, application/form-data
Request header http header field:
Parameter name
Type
Required
Description
cybertron-robot-key
string
Yes
Robot key
cybertron-robot-token
string
Yes
Robot token
Request body field:
Parameter name
Type
Required
Description
username
string
Yes
User account
image
file
yes
picture file
type
string
No
textRepresents for knowledge pictures of paragraph text,qaExpress QA Q&A knowledge pictures
4. Response field description
HTTP status code: 200 OK
Response field description:
Field Name
Type
Description
code
string
"000000" is normal, other exceptions
message
string
Status description
data
object
message body
5. Example
Request Example:
curl 'https://_DOMAIN_/openapi/v1/knowledge/image/' \
-H 'cybertron-robot-key: l8ia2IOc************Z724%2BU%3D' \
-H 'cybertron-robot-token: MTc0Mzk5************************************************cGRCUTg9' \
-X POST \
-F 'username=me@host.com' \
-F 'image=@path/to/image.png' \
-F 'type=text'Response example:
{
"code": "000000",
"message": "success",
"data": "1703855155961feb0a-91b9-4b22-a2b8-908fa08ae9d3kungfu.jpg"
}