TLOCK API Documentation
TLOCK provides REST and gRPC APIs for interacting with the decentralized social media platform. All APIs are automatically generated from Protocol Buffer definitions and follow Cosmos SDK standards.
Base Configuration
Chain ID : localchain-1 (testnet) / tlock-1 (mainnet)
Cosmos SDK Version : v0.50
Tendermint Version : v0.38
REST API : http://localhost:1317 (local) / https://api.tlock.org (mainnet)
RPC : http://localhost:26657 (local) / https://rpc.tlock.org (mainnet)
gRPC : localhost:9090 (local) / grpc.tlock.org:443 (mainnet)
TLOCK uses Cosmos SDK standard authentication with cryptographic signatures. No API keys required.
Transaction Signing
All write operations require proper transaction signing using your wallet's private key.
Periodic Allowance
Users with granted periodic allowances can perform transactions without holding TOK tokens.
Post Module APIs
Query Endpoints (GET)
Get Module Parameters
Response : Module configuration parameters
Resolve Name
Parameters :
address: User's wallet address
Response :
Get Home Posts
Parameters :
page_size: Number of posts per page
Response :
Get First Page Home Posts
Parameters :
page_size: Number of posts per page
Search Topics
Parameters :
matching: Search term for topic matching
Response :
Get Topic Posts
Parameters :
topic_id: Topic identifier
Get Specific Post
Parameters :
Response :
Get User Created Posts
Parameters :
address: User's wallet address
Get Likes I Made
Get Saves I Made
Get Likes Received
Get Comments
Parameters :
Get Comments Received
Get Activities Received
Get Categories
Response :
Get Topics by Category
Get Category by Topic
Get Category Posts
Get Following Posts
Get Following Topics
Check if Following Topic
Response :
Get Uncategorized Topics
Get Vote Option
Get Topic Image
Get Topic Details
Get Trending Keywords
Get Trending Topics
Get Paid Post Image
Transaction Endpoints (POST)
All transaction endpoints require proper Cosmos SDK transaction formatting and signing.
Create Post
Endpoint : /cosmos/tx/v1beta1/txs Message Type : MsgCreatePost
Message Structure :
Like Post
Message Type : MsgLikeRequest
Unlike Post
Message Type : MsgUnlikeRequest
Comment on Post
Message Type : MsgCommentRequest
Quote Post
Message Type : MsgQuotePostRequest
Repost
Message Type : MsgRepostRequest
Save Post
Message Type : MsgSaveRequest
Cast Vote on Poll
Message Type : CastVoteOnPollRequest
Follow Topic
Message Type : MsgFollowTopicRequest
Grant Allowance from Module
Message Type : MsgGrantAllowanceFromModuleRequest
Profile Module APIs
Query Endpoints (GET)
Get Module Parameters
Get Profile
Response :
Get Profile Avatar
Get Following List
Get Followers List
Get Follow Relationship
Response :
Relationship codes: 0-No relationship; 1-A follows B; 2-B follows A; 3-Mutual follows
Get Mention Suggestions
Get Activities Received Count
Search Users
Check if Admin
Transaction Endpoints (POST)
Add/Update Profile
Message Type : MsgAddProfileRequest
Follow User
Message Type : MsgFollowRequest
Unfollow User
Message Type : MsgUnfollowRequest
Add Admin
Message Type : MsgAddAdminRequest
Manage Admin
Message Type : MsgManageAdminRequest
Standard Cosmos SDK APIs
TLOCK includes all standard Cosmos SDK modules with their respective APIs:
Base Path : /cosmos/bank/v1beta1/
Endpoints : balances, supply, metadata, etc.
Base Path : /cosmos/auth/v1beta1/
Endpoints : accounts, params
Base Path : /cosmos/staking/v1beta1/
Endpoints : validators, delegations, unbonding
Governance Module
Base Path : /cosmos/gov/v1beta1/
Endpoints : proposals, votes, params
Distribution Module
Base Path : /cosmos/distribution/v1beta1/
Endpoints : rewards, commission
Fee Grant Module
Base Path : /cosmos/feegrant/v1beta1/
Endpoints : channels, connections, clients
Transaction Broadcasting
Transaction Query
Data Structures
CategoryResponse
Standard HTTP Status Codes
400 : Bad Request - Invalid parameters
404 : Not Found - Resource doesn't exist
500 : Internal Server Error
Transaction Errors
Validation Errors
Authentication Errors
Query Endpoints : 1000 requests per hour per IP
Transaction Endpoints : 100 transactions per hour per address
Search Endpoints : 500 requests per hour per IP
Swagger/OpenAPI
Local : http://localhost:1317/swagger/
Mainnet : https://api.tlock.org/swagger/
Support and Resources
Cosmos SDK Docs : https://docs.cosmos.network
Protocol Buffers : https://developers.google.com/protocol-buffers
GitHub : https://github.com/Tlock-org/tlock
This API documentation is automatically generated from Protocol Buffer definitions and reflects the actual implementation in the codebase.
Last updated 2 months ago