[英]How do I escape a Sharepoint column name in Microsoft Graph?
I'm performing the following request to update the value of "ExampleColumn#" for a Sharepoint Online item:我正在执行以下请求以更新 Sharepoint Online 项目的“ExampleColumn#”值:
PATCH https://graph.microsoft.com/v1.0/sites/{site_id}/lists/{list_id}/items/{item_id}补丁https://graph.microsoft.com/v1.0/sites/{site_id}/lists/{list_id}/items/{item_id}
With the following request body:使用以下请求正文:
{
"fields":{
"ExampleColumn#": 1
}
}
Returns a 400 bad request error, with the following message:返回 400 bad request 错误,并带有以下消息:
"message": "A metadata reference property was found in a JSON Light request payload. Metadata reference properties are only supported in responses"
"message": "在 JSON Light 请求负载中发现元数据参考属性。元数据参考属性仅在响应中受支持"
As I believe Odata requires the "#" symbol to be escaped, I've tried using percent-encoding which I couldn't get to work.由于我认为 Odata 需要转义“#”符号,因此我尝试使用无法开始工作的百分比编码。
Request Body:请求正文:
{
"fields":{
"ExampleColumn%23": 1
}
}
Response:回复:
"message": "Field 'ExampleColumn%23' is not recognized"
"message": "无法识别字段 'ExampleColumn%23'"
What should I be doing differently in my request body?我应该在我的请求正文中做些什么不同的事情?
@Zak, @扎克,
Please make sure the field in the request body is the correct internal name of that column.请确保请求正文中的字段是该列的正确内部名称。 I am able to update a column value in my SPO list via the below request:
我可以通过以下请求更新我的 SPO 列表中的列值:
You can get the field internal name through its setting page:您可以通过其设置页面获取字段内部名称:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.