跳到内容
Influence
Esc
↑↓导航↵打开⌘J预览

确认二进制图片上传

使用原始JPEG、PNG或WebP字节(最多3,145,728字节),确认已准备好的mediaImport上传描述符。字节长度和SHA-256必须与描述符一致。对于文件引用或更大的本地文件,请使用文档说明的素材工具及SDK分段上传流程。

POST/api/v1/media/import
授权
AuthorizationBearer令牌 · header必需

具有限定权限范围的Influence API密钥,或受支持的OAuth访问令牌。不要将凭据放入URL或工具输入。

请求头参数
X-Publish-ConfirmationConfirmationCapability必需

prepare返回的confirmationCapability原值。仅通过此请求头,在expiresAt之前,连同相同的输入一起发送。

最小长度:32 · 最大长度:4096 · 匹配^[A-Za-z0-9._~-]+$
Idempotency-KeyIdempotencyKey必需

调用方生成的重试标识。响应结果不确定时,请保留此幂等键、确认凭据和输入。

最小长度:16 · 最大长度:200 · 匹配^[A-Za-z0-9._:-]+$
X-Publish-Uploadstring必需

已准备好的mediaImport输入中,upload经encodeURIComponent(JSON.stringify(upload))处理后的值。解码后的对象遵循BinaryUploadDescriptor;编码后的请求头最多为4,096个字符。

最大长度:4096
请求体
必需application/octet-stream
string<binary>
响应
200

素材操作结果;请检查ok和素材状态。

仅满足以下一项:
object
okboolean必需
outputJsonValue | null必需
展开属性
至少满足以下一项:
string
string
number
number
boolean
boolean
null
null
JsonValue[]
JsonValue类型的数组
循环引用JsonValue。
object
object
toolNamestring必需
允许值:adAuditQuoteadAuditStartadAuditGetadAuditListsearchfetchprofileGetconnectionStatusGetaccountListcampaignGetcampaignListcampaignDraftSavemediaListmediaImportmediaUploadCreatemediaUploadPartmediaUploadCompletemediaUploadGetmediaUploadAbortmediaGetcampaignReviewcampaignReviewGetcampaignReviewExecutecampaignScheduleBatchReviewcampaignScheduleBatchExecutescheduleListbrandContextGetinsightsAccountListinsightsPostListinsightsRefreshcampaignPlanGetcampaignPlanGenerateimageGenerationQuoteimageGenerationStartimageGenerationListintegrationListgroupListintegrationSchemadevtoOrganizationListdevtoTagListdiscordChannelListdiscourseCategoryListdiscourseTagListdiscourseTopicSearchdribbbleTeamListghostAuthorListghostNewsletterListghostTagListghostTierListhashnodePublicationListlemmyCommunitySearchlistmonkListsGetlistmonkTemplateListmattermostChannelListmeweGroupListpinterestBoardListredditSubredditRequirementsGetredditSubredditSearchslackChannelListteamsChannelListtiktokCreatorInfoGetvkDestinationListwhopCompanyListwhopExperienceListwordpressCategoryListwordpressPostTypeListwordpressTagListwrapcastChannelSearchintegrationSchedulePostToolpostsListToolpostSettingsTool
ToolError
errorobject必需
展开属性
codestring必需
允许值:AI_SCHEDULING_LIMIT_REACHEDAI_SCHEDULING_UNAVAILABLEINVALID_INPUTFORBIDDENNOT_FOUNDCONFLICTFEATURE_DISABLEDCONFIRMATION_REQUIREDCONFIRMATION_INVALIDUPSTREAM_FAILEDNEEDS_REVIEWINTERNAL
messagestring必需
最小长度:1 · 最大长度:2048
retryableboolean必需
okboolean必需
toolNamestring必需
允许值:adAuditQuoteadAuditStartadAuditGetadAuditListsearchfetchprofileGetconnectionStatusGetaccountListcampaignGetcampaignListcampaignDraftSavemediaListmediaImportmediaUploadCreatemediaUploadPartmediaUploadCompletemediaUploadGetmediaUploadAbortmediaGetcampaignReviewcampaignReviewGetcampaignReviewExecutecampaignScheduleBatchReviewcampaignScheduleBatchExecutescheduleListbrandContextGetinsightsAccountListinsightsPostListinsightsRefreshcampaignPlanGetcampaignPlanGenerateimageGenerationQuoteimageGenerationStartimageGenerationListintegrationListgroupListintegrationSchemadevtoOrganizationListdevtoTagListdiscordChannelListdiscourseCategoryListdiscourseTagListdiscourseTopicSearchdribbbleTeamListghostAuthorListghostNewsletterListghostTagListghostTierListhashnodePublicationListlemmyCommunitySearchlistmonkListsGetlistmonkTemplateListmattermostChannelListmeweGroupListpinterestBoardListredditSubredditRequirementsGetredditSubredditSearchslackChannelListteamsChannelListtiktokCreatorInfoGetvkDestinationListwhopCompanyListwhopExperienceListwordpressCategoryListwordpressPostTypeListwordpressTagListwrapcastChannelSearchintegrationSchedulePostToolpostsListToolpostSettingsTool
400

请求无效。不接受查询参数。工具验证失败时可能使用工具错误封装结构。

至少满足以下一项:
TransportError
errorobject必需
展开属性
codestring必需
messagestring必需
retryableboolean必需
ToolError
errorobject必需
展开属性
codestring必需
允许值:AI_SCHEDULING_LIMIT_REACHEDAI_SCHEDULING_UNAVAILABLEINVALID_INPUTFORBIDDENNOT_FOUNDCONFLICTFEATURE_DISABLEDCONFIRMATION_REQUIREDCONFIRMATION_INVALIDUPSTREAM_FAILEDNEEDS_REVIEWINTERNAL
messagestring必需
最小长度:1 · 最大长度:2048
retryableboolean必需
okboolean必需
toolNamestring必需
允许值:adAuditQuoteadAuditStartadAuditGetadAuditListsearchfetchprofileGetconnectionStatusGetaccountListcampaignGetcampaignListcampaignDraftSavemediaListmediaImportmediaUploadCreatemediaUploadPartmediaUploadCompletemediaUploadGetmediaUploadAbortmediaGetcampaignReviewcampaignReviewGetcampaignReviewExecutecampaignScheduleBatchReviewcampaignScheduleBatchExecutescheduleListbrandContextGetinsightsAccountListinsightsPostListinsightsRefreshcampaignPlanGetcampaignPlanGenerateimageGenerationQuoteimageGenerationStartimageGenerationListintegrationListgroupListintegrationSchemadevtoOrganizationListdevtoTagListdiscordChannelListdiscourseCategoryListdiscourseTagListdiscourseTopicSearchdribbbleTeamListghostAuthorListghostNewsletterListghostTagListghostTierListhashnodePublicationListlemmyCommunitySearchlistmonkListsGetlistmonkTemplateListmattermostChannelListmeweGroupListpinterestBoardListredditSubredditRequirementsGetredditSubredditSearchslackChannelListteamsChannelListtiktokCreatorInfoGetvkDestinationListwhopCompanyListwhopExperienceListwordpressCategoryListwordpressPostTypeListwordpressTagListwrapcastChannelSearchintegrationSchedulePostToolpostsListToolpostSettingsTool
401

Bearer凭据缺失、无效或已过期。

errorobject必需
展开属性
codestring必需
messagestring必需
retryableboolean必需
403

凭据缺少所需权限。

errorobject必需
展开属性
codestring必需
messagestring必需
retryableboolean必需
404

供程序调用的API或请求的工具不可用。

errorobject必需
展开属性
codestring必需
messagestring必需
retryableboolean必需
413

请求超过字节数限制。

errorobject必需
展开属性
codestring必需
允许值:AI_SCHEDULING_LIMIT_REACHEDAI_SCHEDULING_UNAVAILABLEINVALID_INPUTFORBIDDENNOT_FOUNDCONFLICTFEATURE_DISABLEDCONFIRMATION_REQUIREDCONFIRMATION_INVALIDUPSTREAM_FAILEDNEEDS_REVIEWINTERNAL
messagestring必需
最小长度:1 · 最大长度:2048
retryableboolean必需
okboolean必需
toolNamestring必需
允许值:adAuditQuoteadAuditStartadAuditGetadAuditListsearchfetchprofileGetconnectionStatusGetaccountListcampaignGetcampaignListcampaignDraftSavemediaListmediaImportmediaUploadCreatemediaUploadPartmediaUploadCompletemediaUploadGetmediaUploadAbortmediaGetcampaignReviewcampaignReviewGetcampaignReviewExecutecampaignScheduleBatchReviewcampaignScheduleBatchExecutescheduleListbrandContextGetinsightsAccountListinsightsPostListinsightsRefreshcampaignPlanGetcampaignPlanGenerateimageGenerationQuoteimageGenerationStartimageGenerationListintegrationListgroupListintegrationSchemadevtoOrganizationListdevtoTagListdiscordChannelListdiscourseCategoryListdiscourseTagListdiscourseTopicSearchdribbbleTeamListghostAuthorListghostNewsletterListghostTagListghostTierListhashnodePublicationListlemmyCommunitySearchlistmonkListsGetlistmonkTemplateListmattermostChannelListmeweGroupListpinterestBoardListredditSubredditRequirementsGetredditSubredditSearchslackChannelListteamsChannelListtiktokCreatorInfoGetvkDestinationListwhopCompanyListwhopExperienceListwordpressCategoryListwordpressPostTypeListwordpressTagListwrapcastChannelSearchintegrationSchedulePostToolpostsListToolpostSettingsTool
429

已超过速率限制,可以重试请求。

errorobject必需
展开属性
codestring必需
messagestring必需
retryableboolean必需
503

API或其上游执行环节不可用。

errorobject必需
展开属性
codestring必需
messagestring必需
retryableboolean必需
请求
curl -X POST 'https://influence.so/api/v1/media/import' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'X-Publish-Confirmation: stringstringstringstringstringst' \
  -H 'Idempotency-Key: stringstringstri' \
  -H 'X-Publish-Upload: string' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/octet-stream' \
  -d 'string'
响应
{
  "ok": true,
  "output": "string",
  "toolName": "adAuditQuote"
}