优化连接不上时创建表
This commit is contained in:
+22
-11
@@ -27,15 +27,26 @@ class DingAPI():
|
||||
return token
|
||||
|
||||
|
||||
def send_message(self, message):
|
||||
data = {
|
||||
"msgtype": "text",
|
||||
"text": {
|
||||
"content": message
|
||||
def card_create(self, data):
|
||||
"""
|
||||
创建并投放卡片
|
||||
return: response(dict)
|
||||
"""
|
||||
url = 'https://api.dingtalk.com/v1.0/card/instances/createAndDeliver'
|
||||
|
||||
headers = {
|
||||
'x-acs-dingtalk-access-token': data["token"],
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
}
|
||||
headers = {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
response = requests.post(self.url, json=data, headers=headers)
|
||||
return response.status_code
|
||||
|
||||
data = {
|
||||
"cardTemplateId": "cee2715f-001d-41cb-8fcd-3be18be9fbf5.schema",
|
||||
"outTrackId": "",
|
||||
"cardData":"",
|
||||
"openSpaceId":"dtv1.card//IM_GROUP.4210192048793363",# 场域id
|
||||
}
|
||||
response = requests.post(url, json=data, headers=headers)
|
||||
return response.json()
|
||||
|
||||
def get_
|
||||
|
||||
|
||||
Reference in New Issue
Block a user