【发布时间】:2022-12-10 07:34:43
【问题描述】:
我正在尝试使用 python 来自动化常见的 Monday 任务。我可以在看板中创建项目,但列 (type=tag) 没有更新。
我使用了这个教程: https://support.monday.com/hc/en-us/articles/360013483119-API-Quickstart-Tutorial-Python#
这是我正在执行的 graphql 代码:
query = 'mutation ($device: String!, $columnVals: JSON!) { create_item (board_id:<myboardid>, item_name:$device, column_values:$columnVals) { id } }'
vars = {'device': device,
'columnVals': json.dumps({
'cloud_name6': {'text': cloudname} # this is where i want to add a tag. cloud_name6 is id of the column.
})
}
data = {'query' : query, 'variables' : vars}
r = requests.post(url=apiUrl, json=data, headers=headers) print(r.json())
我尝试将 id 更改为 title 作为 Json 字符串中的键,但没有成功。我获取了现有项目并尝试添加准确的 json 字符串,但仍然没有成功。我也试过下面的 json 数据但没有任何运气
'columnVals': json.dumps({
'cloud_name6': cloudname
})
知道查询有什么问题吗?
【问题讨论】:
标签: api automation graphql monday.com