跳转到内容
EN

Unpublish a content

Code Mode: praxis.content.contents.unpublish

HTTP: POST /content/v1/contents/{content_id}/unpublish

Take a published content offline without deleting it or losing a version. No playback opens on it afterwards, while capabilities already issued run out by themselves within their lifetime (at most 3000 seconds). Publishing it again with a version brings it back. Only a published content can be unpublished; any other state answers 409 CONTENT_INVALID_STATE. Returns the content with status unpublished and its live_version kept for the next publish.

签名

praxis.content.contents.unpublish(args:{path:{content_id:string}}):Promise<{/** Object type, always content. */ type?:"content";/** Content id (cnt_…) that every read, write and playback call on this content takes. */ id?:string;/** Content kind; video is the only kind today. */ kind?:"video";/** Merchant-facing title, set on create or update and shown by the Kit player when show_title is true. */ title?:string;/** Publication state: draft before the first publish, published while a version is live, unpublished after an unpublish, archived after an archive and final in tha */ status?:"draft"|"published"|"unpublished"|"archived";/** Version number a playback plays, or null when nothing is live (draft or unpublished). */ live_version?:number|null;/** Highest version number, made by each settings save; publish with no version pins this one. */ latest_version?:number;/** Whether Media has every wanted rendition of the pinned asset version: processing while transcoding starts or is running, ready when a publish can go live, faile */ readiness?:"processing"|"ready"|"failed";/** The settings of the latest version, as this read returns them. */ settings?:{/** The asset this content publishes and how it follows it. */ source?:{/** Media library id (lib_…) holding the asset, from praxis.media. */ library_id?:string;/** Media asset id (ast_…) to publish, from praxis.media. */ asset_id?:string;/** Version of that asset this content pins; defaults to 1 and is used unless follow_new_versions is true. */ asset_version?:number;/** Whether a playback follows the asset newest version instead of pinning asset_version; false by default. */ follow_new_versions?:boolean;/** Output heights wanted from Media, one of 480, 720 or 1080 each and no repeat; defaults to 480, 720 and 1080, and a change asks Media to transcode what is missin */ renditions?:Array<480|720|1080>};/** How a playback is authorized; a playback reads this group from the latest version, so a change takes effect at once. */ access?:{/** Lifetime of each playback capability in seconds, from 100 to 3000; defaults to 600 and a capability never outlives the 3000 second ceiling. */ capability_seconds?:number;/** Whether the delivered renditions are encrypted; false by default. */ encryption?:boolean;/** Page origins allowed to open a playback, for example https://school.example.com, at most 20 entries; each must be a canonical https origin (http://localhost is */ allowed_origins?:Array<string>};/** How the Kit renders the player; a playback reads this group from the live version. */ player?:{/** Poster image URL shown before playback starts; null by default. */ poster?:string|null;/** Whether the player shows the content title; true by default, and when false the playback title is null. */ show_title?:boolean;/** Player accent colour as */ accent_color?:string|null;/** Quality the player starts with; auto by default, or one output height that this content actually has, one of 480, 720 or 1080. e.g. "auto" */ default_quality?:"auto"|480|720|1080;/** Playback speeds the player offers, each between 0.25 and 4 and the list must contain 1; defaults to 0.75, 1, 1.25, 1.5 and 2. */ speeds?:Array<number>;/** Whether the player shows storyboard previews while scrubbing; true by default. */ storyboard?:boolean;/** Whether the player starts playing without a click; false by default. */ autoplay?:boolean;/** Whether the player resumes at the position the end user left; true by default. */ remember_position?:boolean};/** Free text about the content, at most 2000 characters; empty by default. */ description?:string};/** RFC 3339 time the content was created. */ create_time?:string;/** RFC 3339 time of the last change; list results are ordered by it, newest first. */ update_time?:string;/** RFC 3339 time of the first publish, or null for a content never published. */ publish_time?:string|null;/** RFC 3339 time the content was archived, or null while it is not archived. */ archive_time?:string|null}>;

参数

名称位置类型必填说明
content_idpathstring是Content id (cnt_…) from praxis.content.contents.create or praxis.content.contents.list; a content of another organization answers CONTENT_NOT_FOUND.

响应

状态码内容类型说明
200application/jsonThe content with status unpublished; its live version is kept.
400application/jsonINVALID_PARAMS: the request is not shaped the way this face accepts — an unknown or misspelled field, a repeated query parameter, a value outside its allowed range (for example capability_seconds outside 100 to 3000 or a rendition other than 480, 720 or 1080), or a body that is not a JSON object. The error names the field at fault and what it accepts; correct that field and send the request again.
401application/jsonThe credential is missing, malformed or expired. Merchant routes answer UNAUTHENTICATED when the API key or session names no organization; the playback door answers ACCESS_TOKEN_EXPIRED when the end-user token cannot be verified and SIGN_IN_EXPIRED or SIGN_IN_REVOKED when the sign-in behind it is over. Send a valid API key, or sign the end user in again for a fresh access token, then retry.
404application/jsonThe reference does not name a content this organization owns: CONTENT_NOT_FOUND for an unknown, foreign or archived content id, VERSION_NOT_FOUND for a version number that does not exist, SOURCE_NOT_FOUND when the library or asset behind a source is gone. Read the current id from praxis.content.contents.list (or praxis.media for the asset) and retry with that; never construct an id.
409application/jsonCONTENT_INVALID_STATE: the act is not allowed in the content current state — an archived content is final, unpublish needs a published content, archive needs a draft or unpublished one. SOURCE_NOT_READY: Media is still transcoding a wanted rendition of the pinned asset version, so a publish is refused; wait until readiness is ready and publish again.
502application/jsonUPSTREAM_UNAVAILABLE: a dependency refused the call — Media (the transcoder or the manifest issuer) or, for a playback, the end-user token verifier. Nothing was written; retry later, and if it persists report the time and the request path.
503application/jsonUPSTREAM_UNAVAILABLE: this face is not usable in this environment — the CONTENT service binding is unwired, or the anonymous rate limiter is unavailable or misconfigured so the door fails closed. Use an environment where the face is wired, or retry when the dependency is back.