View a Tugboat API Key's History

Returns the activity history of a Tugboat API Key, or a set of API Keys.

Arguments

  • key - Required
    The ID of the key for which to retrieve the history.

  • type - Optional
    The type of event to return. If not specified, all events are returned. This can be a single type, or an array of types.

  • before - Optional
    Only return events that occurred before this date. A Date object is expected.

  • after - Optional
    Only return events that occurred after this date. A Date object is expected.

  • limit - Optional
    Only return the last N events.

Example

socket.emit('tugboat', 'keys', 'history', args, callback);

Output

single

[
    {
        "_id": "58f771e2c133890001015481",
        "updatedAt": "2017-04-19T14:19:14.289Z",
        "createdAt": "2017-04-19T14:19:14.289Z",
        "key": "58f771e2c133890001015480",
        "type": "activity",
        "data": {
            "event": "create",
            "args": { "name": "", "key": "9oogl7lz3jevbtgxmdpeeqa3iyy7jtel" },
            "authkey": "0"
        },
        "id": "58f771e2c133890001015481"
    }
]

array

[
    [
        {
            "_id": "58f771e2c133890001015481",
            "updatedAt": "2017-04-19T14:19:14.289Z",
            "createdAt": "2017-04-19T14:19:14.289Z",
            "key": "58f771e2c133890001015480",
            "type": "activity",
            "data": {
                "event": "create",
                "args": {
                    "name": "",
                    "key": "9oogl7lz3jevbtgxmdpeeqa3iyy7jtel"
                },
                "authkey": "0"
            },
            "id": "58f771e2c133890001015481"
        }
    ],
    [
        {
            "_id": "58f7b12f557a62000105e53e",
            "updatedAt": "2017-04-19T18:49:19.876Z",
            "createdAt": "2017-04-19T18:49:19.876Z",
            "key": "58f7b12f557a62000105e53d",
            "type": "activity",
            "data": {
                "event": "create",
                "args": {
                    "name": "",
                    "key": "gbmzyovujhkr0sxofypfkliftnhwxaoz"
                },
                "authkey": "0"
            },
            "id": "58f7b12f557a62000105e53e"
        }
    ]
]

Errors

  • 1001: No Keys Found
    Returned if the requested keys either do not exist, or the requestor does not have permission to view the history.

  • 1002: No key ID provided
    The required key argument was not included in the request.

results matching ""

    No results matching ""