Saltar al contingut principal
PUT

Actualitzar un registre de temps de projecte

Scope:projects:projects.write
https://api.holded.com/api/v2/projects/{projectId}/times/{timeId}

Actualitza les dades d'un registre de temps d'un projecte.

Paràmetres

Paràmetres de ruta

timeIdstringobligatori

ID del registre de temps (ObjectId hexadecimal de 24 caràcters)

projectIdstringobligatori

ID del projecte (ObjectId hexadecimal de 24 caràcters)

Cos de la petició

object
durationinteger

Durada en segons

user_idstring

Identificador de l'usuari

descriptionstring | null

Descripció del treball fet

datestring<date> | null

Data del registre en format ISO 8601

task_idstring | null

Identificador de la tasca associada

cost_per_hourstring | null

Cost per hora

categorystring | null

Categoria del registre

Petició

python
import requests

url = "https://api.holded.com/api/v2/projects/{projectId}/times/{timeId}"
headers = {
    "Authorization": "Bearer YOUR_API_KEY",
    "Accept": "application/json",
}

payload = {
    "duration": 0,
    "user_id": "string",
    "description": "string",
    "date": "2024-01-15",
    "task_id": "string",
    "cost_per_hour": "string",
    "category": "string"
}
response = requests.put(url, headers=headers, json=payload)
print(response.json())

Respostes

Resposta

json
{
  "id": "string"
}

Respostes exitoses

200Registre de temps de projecte actualitzatapplication/json
object
idstring

Respostes d'error

400Sol·licitud incorrectaapplication/json
401API key no vàlida o no proporcionadaapplication/json
403Permisos insuficientsapplication/json
404Registre de temps no trobatapplication/json
422Error de validacióapplication/json
429Límit de sol·licituds exceditapplication/json