本文介绍了使用VSTS Rest API,如何更新Markdown小部件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用此REST API 来更新VSTS仪表板上的"Markdown"小部件.
I'm trying to use this REST API to Update a "Markdown" widget on a dashboard in VSTS.
使用下面的JSON
主体,按示例获取Value cannot be null
(请参见下文)?
Using the below JSON
body, per the sample, I'm getting Value cannot be null
(see below)?
JSON
{
"id": "3b52e9ed-576e-4985-82ae-8e80b22a4b4d",
"eTag": "1",
"name": "Markdown",
"size": {"rowSpan":2; "columnSpan":2},
"settings": "# AAAAK Markdown\nAdd content using the markdown widget.\n- **Bold**\n- *Italic*\n- [Links]()",
"settingsVersion": "@{major=1; minor=0; patch=0}",
"dashboard": {
"eTag": "35"
},
"contributionId": "ms.vss-dashboards-web.Microsoft.VisualStudioOnline.Dashboards.MarkdownWidget"
}
提琴手Request
/Response
Fiddler Request
/Response
我的目标仅仅是找到&使用新的显示内容更新Markdown小部件.这是一个新创建的小部件,所以eTag=1
是我通过Get Dashboard和WidgetId
进行验证的,而eTag=35
是Dashboard.
My goal is simply to find & update a Markdown widget with new display content. It's a newly created widget, so eTag=1
, which I verified with a Get Dashboard along with the WidgetId
, and the eTag=35
is what the Dashboard is.
推荐答案
更改此行:
"size": {"rowSpan":2; "columnSpan":2},
到
"size": {"rowSpan":2, "columnSpan":2},
这篇关于使用VSTS Rest API,如何更新Markdown小部件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!