Crear registro de tiempo en Toggl Track, con una API

Crea un registro de tiempo para el usuario conectado. Requiere workspace, workspace_id, created_with y start. Para un temporizador en marcha, envía duration -1; para trabajo pasado, envía duration en segundos o stop.

Identificador
toggl_create_time_entry

La llamada

POST https://connect.reportei.com/api/tools/toggl_create_time_entry/execute
Authorization: Bearer <merchant token>
x-customer-token: <customer token>
Content-Type: application/json
Accept: application/json

{
  "customer_toolkit": "<connection UUID>",
  "arguments": {
    "workspace": 1,
    "workspace_id": 1,
    "created_with": "<created_with>",
    "start": "<start>"
  }
}

Tu sistema envía el id de la conexión de tu cliente y los argumentos de la tool. Los headers son los mismos de toda la API de Connect: el token de tu producto y el token de tu cliente.

Parámetros

Las descripciones de los parámetros siguen la documentación oficial de la app, en inglés.

ParámetroTipoObligatorioDescripción
workspaceintegerSíId of the workspace: the default_workspace_id from Get me, the workspace_id of a project from List projects, or the wid of a client from List clients. Send it in workspace_id too.
workspace_idintegerSíThe same workspace id as workspace, from Get me, List projects or List clients. Toggl asks for it in the path and in the body.
created_withstringSíName of the application creating the entry, such as the name of your app. Toggl requires it.
startstringSíStart of the entry, in UTC, as yyyy-MM-ddTHH:mm:ssZ.
durationintegerNoDuration in seconds. A negative value, preferably -1, starts a running timer.
stopstringNoEnd of the entry, in UTC, as yyyy-MM-ddTHH:mm:ssZ. With duration, it must match start plus duration.
descriptionstringNoWhat was done.
project_idintegerNoId of the project, from List projects.
tagsarrayNoTag names. A name that does not exist yet becomes a new tag.
billablebooleanNoTrue when the time is billable. Paid plans only.

Conexiones posibles

Tu cliente conecta su cuenta de Toggl Track una sola vez, con uno de los modos de abajo. La misma conexión sirve para todas las tools del toolkit.

Usuario y contraseña

Tu cliente ingresa las credenciales de la app en una pantalla de Connect, o tu sistema las envía con POST /api/customer-toolkits, sin pantalla.

La respuesta

Si la llamada tiene éxito, Connect conserva el status y el cuerpo de la respuesta de la app. Los errores HTTP devueltos por la app usan el objeto {error, api_error}; la autenticación o validación pueden fallar antes de la ejecución. El header X-Toolkit-Execution-Id identifica la ejecución registrada, disponible en GET /api/tools/executions/{uuid}.

Lista para agentes de IA

El input de esta tool es un JSON Schema, disponible en GET /api/tools/toggl_create_time_entry. Se convierte en la definición de tool de tu agente sin conversión.

Otras tools de Toggl Track

Ver las 13 tools

Toolkits de la misma categoría

Ver los 100 toolkits

Mira Connect aplicado a tu producto.

Pruébalo durante 15 días sin tarjeta, o cuéntale tu caso a nuestro equipo.