我試圖從Sharepoint的文檔列表中使用PHP和GetListItemChangesSinceToken獲取最新更改。我使用phpSPO作爲SDK,因爲沒有用於PHP的任何官方Sharepoint SDK。Sharepoint GetListItemChangesSinceToken PHP中的CURL請求
到目前爲止,我有這樣的:
$payload = array(
'query' => array(
'__metadata' => array('type' => 'SP.ChangeLogItemQuery'),
'ViewName' => '',
'QueryOptions'=> '<QueryOptions><Folder>Shared Documents</Folder></QueryOptions>'
)
);
$headers = array();
$headers["X-HTTP-Method"] = "MERGE";
$changes = $this->request->executeQueryDirect($this->settings->URL . "/_api/web/Lists/GetByTitle('Documents')/GetListItemChangesSinceToken", $headers, $payload);
將返回:{"error":{"code":"-2147467261, System.ArgumentNullException","message":{"lang":"en-US","value":"Value cannot be null.\r\nParameter name: query"}}}
我試圖改變X-HTTP-Method
和改變陣列,以適應記載JSON/XML請求(XML的JSON對象,來吧微軟)
謝謝你,所以**很多Vadim –