Logs

As the name suggest, Log is a Main model in Block-Auth. On this page, we'll dive into the different logs endpoints you can use to manage logs programmatically. We'll look at how to query the users.

The logs model

The logs model contains all the information about your logs, such as the hash, the user, the app, the service, and the timestamp.

Properties

  • Name
    id
    Type
    string
    Description

    Unique identifier for the User.

  • Name
    app_id
    Type
    number
    Description

    The app id.

  • Name
    state
    Type
    string
    Description

    The state of the log transaction (initial, approved, cancelled, pending, confirmed, reverted)

  • Name
    hash
    Type
    string
    Description

    The hash of the log transaction.

  • Name
    block_number
    Type
    number
    Description

    The block number of the log transaction.

  • Name
    status
    Type
    number
    Description

    The status of the log transaction.

  • Name
    pre_params
    Type
    object
    Description

    The JSON pre_params of the log transaction. Refers to the UI params.

  • Name
    params
    Type
    object
    Description

    The JSON params of the log transaction. Refers to the API params.

  • Name
    response
    Type
    object
    Description

    The JSON response of the log transaction. Refers to the Blockchain response.

  • Name
    method
    Type
    string
    Description

    The method of the log transaction. Can be one of the following: signin, signup, signout.

  • Name
    created_at
    Type
    string
    Description

    The creation date of the log transaction.

  • Name
    updated_at
    Type
    string
    Description

    The update date of the log transaction.

  • Name
    deleted_at
    Type
    string
    Description

    The deletion/cancellation date of the log transaction.

  • Name
    fromService
    Type
    string
    Description

    The service that the log transaction is coming from. Can be one of the following: google, metamask, blockauth, phantomp, microsoft.

  • Name
    app_name
    Type
    string
    Description

    The app name of the log transaction.

  • Name
    app_domain
    Type
    string
    Description

    The app domain of the log transaction.


GET/api/logs

Get a list of logs

This endpoint allows you to get a list of logs. You can filter the logs by page, limit, and services.

API - logs

GET
/api/logs?page=1&limit=100
curl --location 'https://api.block-auth.io/api/logs?page=1&limit=100' \
--header 'Authorization: Bearer your_access_token_here' \
--data ''

Response

{
    "success": true,
    "message": {
        "pages": "1",
        "items": [
            {
                "id": 2,
                "app_id": 1,
                "state": "approved",
                "hash": "0x352259aa17809c348a6f9360bb668200ae6153cfe331595b1f56c3f69045cfca",
                "block_number": 1461,
                "status": 1,
                "pre_params": {
                    "appKey": "app.61b0ee79-98b5-5ak6-9dad-c42f1553b7f9",
                    "appName": "BlockAuth",
                    "iconUrl": "https://dashboard.block-auth.io/img/blockauth_logo.png",
                    "fromService": "blockauth",
                    "action": "signin",
                    "to": "authDashboard",
                    "domain": "dashboard.block-auth.io"
                },
                "params": {},
                "response": {},
                "method": "signin",
                "created_at": "2024-04-07T16:23:56.000Z",
                "updated_at": "2024-04-07T16:24:05.000Z",
                "deleted_at": null,
                "fromService": "blockauth",
                "app_name": "BlockAuth",
                "app_domain": "dashboard.block-auth.io"
            },
            {
                "id": 1,
                "app_id": 1,
                "state": "approved",
                "hash": "0x4cf28d81167bb4c2652f7e2103158c9dd9023a90ea540691553d43c9303daa7d",
                "block_number": 783,
                "status": 1,
                "pre_params": {
                    "appKey": "app.61b0ee79-98b5-5ak6-9dad-c42f1553b7f9",
                    "appName": "BlockAuth",
                    "iconUrl": "https://dashboard.block-auth.io/img/blockauth_logo.png",
                    "fromService": "blockauth",
                    "action": "signup",
                    "to": "authDashboard",
                    "domain": "dashboard.block-auth.io"
                },
                "params": {},
                "response": {},
                "method": "signup",
                "created_at": "2024-04-07T15:46:51.000Z",
                "updated_at": "2024-04-07T15:50:11.000Z",
                "deleted_at": null,
                "fromService": "blockauth",
                "app_name": "BlockAuth",
                "app_domain": "dashboard.block-auth.io"
            }
        ],
        "total": 2
    }
}

Was this page helpful?