使用api Graph PATCH ItemLIST更改_moderationStatus

时间:2018-02-15 16:47:01

标签: microsoft-graph

我在SharePoint云中有一个库,启用了批准文档。

如果我获得driveItem我们有这个元数据(或列)

{
  "listItem": {
    "@odata.etag": "\"b703fa06-c8b3-4c4d-a040-81a4b669aa11,3\"",
    "createdBy": { "user": { "displayName": "Aplicación de SharePoint" } },
    "createdDateTime": "2018-02-15T16:34:07Z",
    "eTag": "\"b703fa06-c8b3-4c4d-a040-81a4b669aa11,3\"",
    "id": "22",
    "lastModifiedBy": { "user": { "displayName": "Aplicación de SharePoint" } },
    "lastModifiedDateTime": "2018-02-15T16:35:36Z",
    "parentReference": { "id": "33755d91-0fbc-4a34-9c22-21f40ac8c8c4" },
    "webUrl":
      "https://urledu.sharepoint.com/tic/des_sandbox/sandbox/carpeta1/Prueba99909.txt",
    "contentType": { "id": "0x010100C92034EAF842434C87D307911CD02133" },
    "fields@odata.context":
      "https://graph.microsoft.com/v1.0/$metadata#drives('b%21OiwKOJ9B2UWRCcUUiuOVQfrBmRNkSaZImpGjMixaC6ubsEH6hKfDQJAR5YY5RyEj')/root/listItem/fields/$entity",
    "fields": {
      "@odata.etag": "\"b703fa06-c8b3-4c4d-a040-81a4b669aa11,3\"",
      "FileLeafRef": "Prueba99909.txt",
      "pfnumero@odata.type": "#Single",
      "pfnumero": 19898,
      "prueba1_texto": "hola",
      "_ModerationStatus": 2,
      "id": "22",
      "ContentType": "Documento",
      "Created": "2018-02-15T16:34:07Z",
      "AuthorLookupId": "1073741822",
      "Modified": "2018-02-15T16:35:36Z",
      "EditorLookupId": "1073741822",
      "_CheckinComment": "",
      "LinkFilenameNoMenu": "Prueba99909.txt",
      "LinkFilename": "Prueba99909.txt",
      "DocIcon": "txt",
      "FileSizeDisplay": "1510",
      "ItemChildCount": "0",
      "FolderChildCount": "0",
      "_ComplianceFlags": "",
      "_ComplianceTag": "",
      "_ComplianceTagWrittenTime": "",
      "_ComplianceTagUserId": "",
      "_CommentCount": "",
      "_LikeCount": "",
      "AppAuthorLookupId": "9",
      "AppEditorLookupId": "9",
      "Edit": "0",
      "_UIVersionString": "3.0",
      "ParentVersionStringLookupId": "22",
      "ParentLeafNameLookupId": "22"
    }
  }
}

但是,当我尝试使用_ModerationStatus修改PATCHhttps://graph.microsoft.com/v1.0/sites/{siteId}/lists/{listId}/items/{itemId}时,使用正文:

{
  "fields": {
    "pfnumero": "19898",
    "prueba1_texto": "hola",
    "_ModerationStatus": "2"
  }
}

API返回:

{
  "error": {
    "code": "invalidRequest",
    "message": "Field '_ModerationStatus' is not recognied",
    "innerError": {
      "request-id": "a842ec39-439c-43cb-a022-adcf688dabb5",
      "date": "2018-02-15T16:36:18"
    }
  }
}

0 个答案:

没有答案