Skip to main content

User follow someone

User Follow someone

POST /api/following/

Request Headers

fieldRequiredheaders Descriptionexample
web3mq-request-pubkeyYesyour login keyapir's public key59daabd77706ba022ceaed10e4275bd6
didkeyYesyour did_type + ":" + did_valueeth:0xa1b1233fdfde

Request Payload

Parameters in JSON bodyTypeRequiredParameters Description
useridstringYes
target_useridstringYes
actionstringfollow or cancel
timestampintYestimestamp milliseconds
did_typestringYeseth or startknet
did_signaturestringYeswallet signature
did_pubkeystringNostarknet pubkey (if did_type equal starknet)
sign_contentstringYeswallet signing content
contentstringNofollow content

Body json params

let wallet_address = "your wallet_address"
let wallet_type = Ethereum // or StarkNet
let nonce = sha3_224(userid + action + target_userid + timestamp) // hex format

let sign_content = `
Web3MQ wants you to sign in with your ${wallet_type} account:
${wallet_address}

For follow signature

Nonce: ${nonce}
Issued At: ${moment().utc().local().format('DD/MM/YYYY hh:mm')}`;
`

let did_signature = wallet_signing(sign_content);
{
"userid": "your userid",
"target_userid": "target userid",
"action": "follow",
"did_type": "eth",
"did_signature": "<wallet signature>",
"sign_content": "<sign_content>",
"timestamp": 1656991509327
}

response

ParametersTypeAlways ReturnParameters Description
codeintYesresult code, 0 means success, other code see msg's contents
msgstringYesresult description
{
"code": 0,
"msg": "ok"
}