edoc content services Guide
Breadcrumbs

Replace a file with a new file version

Method and endpoint

POST /Documents/{documentId}

You can use the POST /Documents/{documentId} method and endpoint to replace the file of an existing document in the destination system with a new version of the file. You only need to send the new file as a Base64-String in the FileContentBase64 property.

When replacing a file with a new file version, you can edit the properties of the document at the same time.

If the process was successful, only the HTTP status 204 No Content is returned in response.

Example of a request

JSON
POST /Documents/762f8698-f605-4de5-89fb-6f5fff3435fd
Accept: */ *
oduleId: sharepoint
ConnectionString: targetHost=https://test.sharepoint.com;User=MyUserName;Password=MyPassword;ListId=MyListId;

{
  "fileContentBase64": "dGVzdCAwMg0KMTExMQ0KMjIyMg0KMzMzMzMzDQo0NDQ0NDQ0DQo1NTU1NTU1NQ0KNjY2NjY2NjY2DQo3Nzc3Nzc3Nzc3Nw0KODg4ODg4ODg4ODg4OA0KOTk5OTk5OTk5OTk5OTk=",
  "category": "dc4af18a-dd54-4735-bad5-92517e8653f2",
  "fileName": "MyFile.txt",
  "properties": {
    "TenantId": [
      "4567"
    ],
    "Tenant_x0020_Name": [
      "Yet Another Tenant"
    ]
  }
}