Overview

public. Export a page to the specified format

Uri Parameters
NameTypeDescription
pageidstringeither an integer page ID, "home", or "=" followed by a double uri-encoded page title
Query Parameters
NameTypeDescription
format{pdf, html}?export format (pdf|html)
Return Codes
NameValueDescription
BadRequest400Invalid input parameter or request body
Forbidden403Read access to the page is required
NotFound404Requested page could not be found
Ok200The request completed successfully

Message Format

None

Implementation Notes

The Content-Disposition, Content-Length, and Content-Type headers provide information about the retrieved file.

Code Samples

The following code example exports the page called "Page_Title" to a pdf and saves it in the caller's temporary directory:

Plug p = Plug.New("http://deki-hayes/@api/deki");
p.At("users", "authenticate").WithCredentials("admin", "password").Get();
DreamMessage msg = p.At("pages", "=Page_Title", "export").With("format", "pdf").Get();
using (FileStream fs = System.IO.File.OpenWrite(Path.GetTempPath() + msg.ContentDisposition.FileName)) {
    byte[] fileData = msg.AsBytes();
    fs.Write(fileData, 0, fileData.Length);
}
Tag page
Viewing 2 of 2 comments: view all
This API feature is not supported in 8.08.
Posted 20:40, 27 Sep 2008
Way is this function not supported anymore??
Posted 18:49, 7 Nov 2008
Viewing 2 of 2 comments: view all
You must login to post a comment.