JSON API

The first version of MAN has been launched and open-sourced. For subsequent deployment and API documentation, please refer to the documents on Github

Basic API

addressmethodparameter describe

/api/pin/{numberOrId}

GET

PIN number or PIN id

Get PIN Details by PIN Number or PIN ID

/api/address/pin/list/{addressType/{address}

GET

address addressType :creator,owner

Retrieve the list of PINs created or owned by the specified address.

/api/address/pin/root/{address}

GET

address

Get PIN Root by Address

/api/node/child/{pinId}

GET

pinId

Get Child Node by PIN ID

/api/node/parent/{pinId}

GET

pinId

Get Parent Node by PIN ID

/api/info/address/{address}

GET

address

Get MetaID Info by Address

/api/info/rootId/{rootId}

GET

rootId

Get MetaID Info by Root ID

/api/pin/content/{numberOrId}

GET

PIN number or PIN id

Get PIN Content by PIN Number or PIN ID

/api/getAllPinByParentPath

GET

page,limit,parentPath

Get All Pins by Parent Path

generalQuery

General query for protocols data, supporting data retrieval in get, count, and sum methods.

Endpoint: /api/generalQuery

method: POST

{
    "collection": "pins", // Name of the collection to query, required
    "action": "sum", // Query operation, supports get, count, sum
    "filterRelation": "or", // Query condition relationship, supports or, and. Currently does not support mixing.
    "field": [
        "number" // Field(s) to return in the query, required for sum operation
    ],
    // Query conditions
    "filter": [
        {
            "operator": "=", // Condition operator, supports =, >, >=, <, <=
            "key": "number", // Field to apply the condition
            "value": 1 // Value to query
        },
        {
            "operator": "=",
            "key": "number",
            "value": 2
        }
    ],
    "cursor": 0, // Starting point for returning data
    "limit": 1, // Number of data records to return
    "sort": [
        "number", // Field to sort by
        "desc" // Order, supports asc, desc
    ]
}

Successful Response Example

{
    "code": 1, // Success code 1
    "message": "ok", // Response message
    "data": [ // Data content
        {
            "_id": "65e96a276bff93b007c02b16",
            "isLike": "1",
            "likeTo": "32c6d91b6fb3f6746258d83f1fe8fb32f19c2a3e0071847b6046f01c938ca20bi0",
            "pinAddress": "tb1pss8ce6tgupnhmfj8u9h4saue48upucu04c7549tzal6n67v8njyst7e0fx",
            "pinId": "3943f7fa4c8496ced9ff722ae5bbdd57ad7b84a383304890b41f21e12f11086bi0",
            "pinNumber": 69
        }
    ]
}

Failed Response Example

{
    "code": -1, // Failure code
    "message": "Data not found", // Reason for failure
    "data": null
}

Last updated