这里只是举个例子。
import time, requests, json
from hashlib import md5

url = "............"  #写真实的ApiUrl的地址

#说明：这些参数根据所对应的接口所需参数来，这里的举例是CreateSample接口
topicid = 1  # 项目编号  
whid = 1  # 任务编号    
whname = '1'  # 任务名称  
#说明结束

appkey = "............" #appkey为登陆成功时返回的Token值
secret = "..............." #密码md5加密
headers = {
	'Content-Type': 'application/json',
	'appkey': appkey,
}
nowTime = int(round(time.time() * 1000))

#这里就是CreateSample的参数写法
method = "CreateSample"
lst = []
lst.append(f"appkey={appkey}")
lst.append(f"time={nowTime}")
lst.append(f"method={method}")
tmp = "".join(sorted(lst)) + secret
sign = md5(tmp.encode("utf-8")).hexdigest()
headers = headers.copy()
headers["method"] = method
headers["time"] = str(nowTime)
headers["sign"] = sign

#在这里就是参数的内容了
xingming = '张三'  # 姓名
xnmobile  ='13123456789' # 手机号码
jsondata = '{"sample":{"id":"","topicid":"%s","ruleid":"%s","name":"%s","number":"%s"}}' % (str(topicid), str(whid), xingming, xnmobile)
print(jsondata)
jsondata = jsondata.encode("utf-8")
try:
	r = requests.post(url, headers=headers, data=jsondata)
	result = json.loads(r.text)
	print(result)
except Exception as e:
	print(str(e))