跳转到内容
EN

Get an objective

Code Mode: praxis.workforce.objectives.retrieve

HTTP: GET /workforce/v1/objectives/{id}

Reads one objective with its scope, the parents it aligns to with their weights, its status and, once graded, its result, score and grade note. Its key results are read with the key results list filtered by objective_id. Read-only. Errors: 404 OBJECTIVE_NOT_FOUND when the id is not an objective of your organization; 403 PERMISSION_DENIED for a run or computer token, or a session token that names no agent.

签名

praxis.workforce.objectives.retrieve(args:{path:{id:string}}):Promise<{/** Objective id (obj_...); use it as objective_id and in parents. */ id:string;/** Id of the organization that owns the objective. */ organization_id:string;/** Id of the period (prd_...) the objective was set in. */ period_id:string;scope:{/** Whether the objective hangs on a department or on a position. e.g. "department" */ kind:"department"|"position";/** Id of the department (dept_...) or position (pos_...) that kind names. e.g. "dept_4c2e9a17d0b34f58a6e1b3c7d9f20e84" */ id:string};/** Objective title, 1 to 200 characters. */ title:string;/** Objective description, up to 2000 characters; empty when none was given. */ description:string;/** Objectives this one aligns to, with weights; empty when it aligns to none. */ parents:Array<{/** Id of the parent objective (obj_...) that sits on the objective's own department or above it. */ objective_id:string;/** Share of the parent this objective carries, greater than 0 and at most 1. e.g. 1 */ weight:number}>;/** Whether the objective is still being worked on or was graded. */ status:"active"|"closed";/** How the objective ended, set by grade; null while active. */ result:"achieved"|"partial"|"missed"|"dropped"|null;/** Score from 0 to 1 set by grade; null while active. */ score:number|null;/** Note written at grading, such as why a committed objective was not achieved; null when none was written. */ grade_note:string|null;/** UTC instant (RFC 3339) when the objective was set. */ create_time:string;/** UTC instant (RFC 3339) of the latest change to the objective. */ update_time:string}>;

参数

名称位置类型必填说明
idpathstring是Objective id (obj_…), from the objectives list or the response of set.

响应

状态码内容类型说明
200application/jsonThe objective.
401Missing or invalid credential; provide a valid organization API key or sign in to the Console.
403application/problem+jsonPERMISSION_DENIED; an agent’s session token reads its own organization, but a run or computer token, or a session token that names no agent, is refused; call with an organization API key, a Console session, or the agent’s own session token.
404application/problem+jsonOBJECTIVE_NOT_FOUND; list objectives and copy an id of your organization.