import{_ as s,c as a,a as n,o as e}from"./app-Dgsdh8A6.js";const d={};function l(o,t){return e(),a("div",null,t[0]||(t[0]=[n(`

加入老粉计划

https://api.bilibili.com/x/v1/contract/add_contract

请求方式:POST

是否需要登录:

认证方式:Cookie(SESSDATA)

正文参数 (application/x-www-form-urlencoded):

参数名类型内容必要性备注
aidstr空串
up_midstrUP主UID必要
sourcestr4
scenestr105
platformstrweb
mobi_appstrpc
csrfstr用户csrf必要

json回复:

根对象:

字段名类型内容备注
codenum响应码0:成功
158001:不满足条件
messagestr0
ttlnum1
dataobj信息本体

data对象

字段名类型内容备注
allow_messagebooltrue
input_textstrUP主加油!看好你噢~
input_titlestr感谢你对UP主的特别支持,“老粉”可期!私信留言鼓励下TA吧~

示例:

curl --location --request POST 'https://api.bilibili.com/x/v1/contract/add_contract' \\
--header 'Cookie: SESSDATA=xxx' \\
--header 'Content-Type: application/x-www-form-urlencoded' \\
--data-urlencode 'up_mid=2' \\
--data-urlencode 'csrf=xxx'
点击查看
{
  "code": 0,
  "message": "0",
  "ttl": 1,
  "data": {
    "allow_message": true,
    "input_text": "UP主加油!看好你噢~",
    "input_title": "感谢你对UP主的特别支持,“老粉”可期!私信留言鼓励下TA吧~"
  }
}

老粉计划发送留言

https://api.bilibili.com/x/v1/contract/add_message

请求方式:POST

认证方式:Cookie (SESSDATA)

正文参数 (application/x-www-form-urlencoded):

参数名类型内容必要性备注
aidstr空串
up_midstrUP主UID必要
sourcestr4
scenestr105
contentstr留言内容必要
csrfstr用户csrf必要

json回复:

根对象:

字段名类型内容备注
codenum响应码0:成功
158005:您跟up主还不是契约关系
messagestr0
ttlnum1
dataobj信息本体

data对象

字段名类型内容备注
success_toaststr提交成功,UP主已收到留言~

示例:

curl --location --request POST 'https://api.bilibili.com/x/v1/contract/add_message' \\
--header 'Cookie: SESSDATA=xxx' \\
--header 'Content-Type: application/x-www-form-urlencoded' \\
--data-urlencode 'up_mid=2' \\
--data-urlencode 'content=..' \\
--data-urlencode 'csrf=xxx'
点击查看
{
  "code": 0,
  "message": "0",
  "ttl": 1,
  "data": {
    "success_toast": "提交成功,UP主已收到留言~"
  }
}
`,29)]))}const c=s(d,[["render",l]]),p=JSON.parse('{"path":"/docs/user/contract.html","title":"加入老粉计划","lang":"zh-CN","frontmatter":{},"git":{"updatedTime":1749972386000,"contributors":[{"name":"SocialSisterYi","username":"SocialSisterYi","email":"1440239038@qq.com","commits":1,"url":"https://github.com/SocialSisterYi"},{"name":"SessionHu","username":"SessionHu","email":"102411014+SessionHu@users.noreply.github.com","commits":1,"url":"https://github.com/SessionHu"}],"changelog":[{"hash":"ffba41758237c897b75e0c650c208b54469e6560","time":1749972386000,"email":"102411014+SessionHu@users.noreply.github.com","author":"SessionHu","message":"fix(user/contract.md): missing ~"},{"hash":"7d89ece2ac46425810647c4ac92acf5f3721cb68","time":1676998806000,"email":"1440239038@qq.com","author":"SocialSisterYi","message":"🚀调整项目结构"}]},"filePathRelative":"docs/user/contract.md"}');export{c as comp,p as data};