Spiritme
  1. files
Spiritme
  • avatars
    • avatars_list
      GET
  • batch-video-templates
    • batch_video_templates_list
      GET
    • batch_video_templates_create
      POST
    • batch_video_templates_retrieve
      GET
  • batch-videos
    • batch_videos_list
      GET
    • batch_videos_create
      POST
    • batch_videos_retrieve
      GET
  • files
    • files_list
      GET
    • files_create
      POST
    • files_retrieve
      GET
    • files_destroy
      DELETE
    • files_children_list
      GET
  • schema
    • schema_retrieve
      GET
  • tts
    • tts_languages_list
      GET
    • tts_voices_list
      GET
  • users
    • users_current_retrieve
      GET
    • users_current_destroy
      DELETE
  • videos
    • videos_list
      GET
    • videos_create
      POST
    • videos_retrieve
      GET
    • videos_update
      PUT
    • videos_destroy
      DELETE
    • videos_publish_create
      POST
  1. files

files_create

开发环境
http://dev-cn.your-api-server.com
开发环境
http://dev-cn.your-api-server.com
POST
/api/files/
files
Allowed mime types {'image': ('image/png', 'image/jpeg', 'image/webp'), 'video': ('video/mp4', 'video/quicktime'), 'audio': ('audio/mp3', 'audio/x-mp3', 'audio/mpeg', 'audio/x-wav'), 'pdf': ('application/pdf',), 'pptx': ('application/vnd.ms-powerpoint', 'application/vnd.openxmlformats-officedocument.presentationml.presentation')}.
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'http://dev-cn.your-api-server.com/api/files/' \
--header 'Authorization;' \
--form 'file=@""'
响应示例响应示例
{
    "id": 0,
    "cd": "2019-08-24T14:15:22Z",
    "name": "string",
    "status": "created",
    "tag": "general",
    "type": "image",
    "mime_type": "string",
    "size": 0,
    "duration": 0,
    "width": 0,
    "height": 0,
    "file": "http://example.com",
    "compressed_file": "http://example.com",
    "mock_video_file": "http://example.com",
    "preview": "http://example.com",
    "thumbnail": "http://example.com",
    "generated_script": "string"
}

请求参数

Header 参数
Authorization
string 
必需
默认值:
Token <api-key>
Body 参数multipart/form-data
name
string  | null 
可选
Title of file
<= 200 字符
tag
enum<string> 
可选
枚举值:
generalassetspeechpresentation_pagescenescene_previewbackground
默认值:
general
示例值:
general
file
file 
File
必需
generate_script_from_content
boolean 
只写可选
Generate script for presentation based on pages content
prompt
string  | null 
只写可选
<= 1500 字符

返回响应

🟢201成功
application/json
Body
id
integer 
只读必需
cd
string <date-time>
Created datetime
只读必需
name
string  | null 
可选
Title of file
<= 200 字符
status
enum<string> 
只读必需
枚举值:
createdprocessingreadyprocessing_error
tag
enum<string> 
可选
枚举值:
generalassetspeechpresentation_pagescenescene_previewbackground
默认值:
general
type
enum<string> 
只读必需
枚举值:
imagevideoaudiopdfpptx
mime_type
string 
只读必需
size
integer  | null 
File size
只读必需
duration
number <double> | null 
只读必需
Duration of audio or video
width
integer  | null 
只读必需
Width of image or video
height
integer  | null 
只读必需
Height of image or video
file
string <uri>
File
必需
compressed_file
string <uri> | null 
只读必需
Compressed file
mock_video_file
string <uri> | null 
只读必需
Mock video file
preview
string <uri> | null 
只读必需
Preview of image or video
thumbnail
string <uri> | null 
只读必需
Thumbnail for image or video
generated_script
string  | null 
只读必需
修改于 2024-03-28 09:50:16
上一页
files_list
下一页
files_retrieve
Built with