reposync/issue_sync/add_gitlink_issue.py

22 lines
735 B
Python

import requests
import json
url = "https://gitlink.org.cn/api/v1/xumingyang21/reposyncer2/issues.json"
payload = json.dumps({
"status_id": 1, #status对应 1对应新增 2对应正在解决 3对应已解决
"priority_id":2, #priority对应 1对应低 2对应正常 3对应高优先级
"subject": "issue自动同步10",
"description": "123455好吧",
})
# 替换为您的实际访问令牌
access_token = 'zo07-W-W6vnU1mvQhVhIdfyyVY3K1R1piil_jfvS1bg'
headers = {
'Authorization': f'Bearer {access_token}', # 使用 Bearer 标记
'User-Agent': 'Apifox/1.0.0 (https://apifox.com)',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)