跳转到内容
EN

Add a reviewer to a work

Code Mode: praxis.studio.works.reviewers.create

HTTP: POST /studio/v1/works/{work}/reviewers

Put one of this organization’s service agents on the work’s reviewer roster, with the kind it reviews as: expert writes a scored report, audience fills a screening card. Every round sent from now on asks every roster member of that round’s kind, so add only agents that should judge every round of this work. A person makes this change, and an agent calling it is refused with PERMISSION_DENIED. Pass the agent id as /v1/agents returns it (agent_…). The agent must be a service agent of this organization: anything else, including an absent id and another organization’s agent, answers REVIEWER_NOT_SERVICE_AGENT. An agent already on the roster answers REVIEWER_ALREADY_ADDED; change its kind with the update operation instead.

签名

praxis.studio.works.reviewers.create(args:{path:{/** e.g. "wu-gang" */ work:string};body:{/** Service agent of this organization to add, by the agent_ id /v1/agents returns for it; the agent must exist in this organization and be a service agent, or the e.g. "agent_0b6f3c2e-6d1a-4f2b-9c47-2e8a5d1f7a30" */ agent:string;/** Kind this reviewer reviews as on this roster: expert writes a scored report, audience fills a screening card. e.g. "audience" */ kind:"expert"|"audience"}}):Promise<{/** Identifier of the reviewer agent, and the value the reviewer path segment takes. e.g. "agent_0b6f3c2e-6d1a-4f2b-9c47-2e8a5d1f7a30" */ agent:string;/** Resource kind marker, always studio.reviewer for this shape. e.g. "studio.reviewer" */ object:string;/** Identifier of the work this roster belongs to; a reviewer is on one work's roster and has no address outside it. e.g. "wk_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ work:string;/** Kind this reviewer reviews as on this roster, which decides which rounds ask it and what it is asked for. e.g. "audience" */ kind:"expert"|"audience";/** Display name of the reviewer agent, such as 宝妈, shown where a person reads the roster. e.g. "宝妈" */ name:string}>;

参数

名称位置类型必填说明
workpathstring是The work being addressed, either its organization-unique slug or its wk_ identifier; a slug case is what a person would say, and a renamed slug still resolves through its old value.

请求体

必填内容类型说明
是application/jsonThe reviewer to add: the agent and the kind it reviews as on this roster.

响应

状态码内容类型说明
201application/jsonThe reviewer as it now stands on the roster, with its display name.
400application/jsonINVALID_PARAMS means a field is missing, malformed or not allowed for this resource; correct the named field and repeat the call.
401application/jsonThe API key is missing, invalid or carries no organization; send a valid organization key in the Authorization header.
403application/jsonPERMISSION_DENIED means the caller is not a person of this organization: the reviewer roster, the review settings and cancelling a round are the owner’s decisions and an agent cannot make them. Report what needs to change to the person who owns the work instead of repeating the call.
404application/jsonWORK_NOT_FOUND means no work in this organization matches that slug or identifier; use the value from the work list, or resolve a loose name first.
409application/jsonREVIEWER_NOT_SERVICE_AGENT means that agent is not a service agent of this organization, so it cannot review; add one of the organization’s service agents instead. REVIEWER_ALREADY_ADDED means the agent is already on this work’s roster, so change its kind with the update operation rather than adding it again.
500application/jsonINTERNAL means the request could not complete; re-read the resource before retrying a write, because the write may already have landed.