The following code snippets are examples of calling the Rebuild API using Python. The requests library is used to execute calls to the API.
In this example files are loaded from the OS and a request with the content type of 'application/json' is formed. The request is then sent to the API using the POST method. The JSON body also contains the content management flags.
The rebuilt file is returned as Base64, decoded by the client and written to disk.
In this example the contents of the raw file are uploaded in a body with a content type of 'multipart/form-data'. The content management flags are serialised and sent as part of the form.
The rebuilt file contents are returned to the client and written to disk.