Acrescenta um resultado-chave
POST/api/goals/objectives/{objectiveId}/key-results
- Auth
- Jeton requis
- Clé d’API:
- Clé d’API non acceptée
- X-CommunityId
X-CommunityIdEnvoyez le X-CommunityId de la communauté où l’opération a lieu.
Les descriptions des endpoints viennent directement de la spécification de l’API et sont en portugais pour l’instant. L’interface autour est traduite.
Quem administra o objetivo, com o ciclo aberto; até 20 por objetivo. Mesmas regras de tipo e alvo da criação.
Paramètres
| Nom | Emplacement | Type | Description |
|---|---|---|---|
objectiveIdobligatoire | path | string (uuid) |
En-têtes
| Nom | Type | Description |
|---|---|---|
X-CommunityIdfacultatif | string (uuid) | ID da comunidade em que a operação acontece. Obrigatório na maioria dos endpoints com escopo de comunidade. |
Corps de la requête application/json
| Nom | Type | Description |
|---|---|---|
titleobligatoire | string | max 200 |
ownerIdfacultatif | string (uuid) | |
unitfacultatif | PERCENT | NUMBER | CURRENCY | |
directionfacultatif | INCREASE | DECREASE | MAINTAIN | DELIVERABLE | |
initialValuefacultatif | number | |
targetValuefacultatif | number | |
minValuefacultatif | number | |
maxValuefacultatif | number | |
weightfacultatif | number |
Réponses
| Statut | Description |
|---|---|
201 | O objetivo, com os KRs. |
400 | Requisição inválida — falha de validação. |
401 | Token ausente, inválido ou expirado; token de outra comunidade (o `X-CommunityId` ou o `communityId` do corpo não é o do token); token antigo ou de uma sessão encerrada (troca de senha, convite aceito). Nesses casos a mensagem pede para entrar de novo (`auth.signInAgain`). |
403 | Autenticado, mas sem permissão para esta operação. |
404 | Recurso não encontrado. |
409 | Conflito com o estado atual do recurso. |
422 | `targetInvalid`, dono sem acesso, mais de 20. |
500 | Erro interno do servidor. |
Exemple curl
curl -X POST "https://api.memberfy.net/api/goals/objectives/<objectiveId>/key-results" \
-H "Authorization: Bearer $TOKEN" \
-H "X-CommunityId: $COMMUNITY_ID" \
-H "Content-Type: application/json" \
-d '{"title":"string"}'