Skip to main content

Create a draft

This page discusses how to create a new Draft document on Issuu

Creating a draft document

Issuu API

This method corresponds to calling HTTP POST https://api.issuu.com/v2/drafts.
API documentation: https://api.issuu.com/v2/reference/#post-/drafts

To create a new draft, we can use the Drafts.CreateDraftAsync operation provided by the API client.

public async Task CreateDraftDocumentAsync(CancellationToken ct)
{
var draft = new Draft();

var response = await _client.Drafts.CreateDraftAsync(draft, ct);
if (response.IsSuccess && response.HasData)
{
var document = response.Data;
// Do something with the document.
}
}

There are a number of optional parameters that you can provide at this stage for a draft:

var draft = new Draft(
title: "",
description: "",
fileUrl: "",
access: DocumentAccess.Private,
type: DocumentType.Other,
confirmCopyright: false,
downloadable: false,
preview: false,
showDetectedLinks: false,
originalPublishDate: null,
scheduledTime: null
);
ParameterTypeDefaultNotes
titlestringnullThe title of your document
descriptionstringnullThe description of your document
fileUrlstringnullUnsure, Issuu API documentation is incomplete
accessDocumentAccessPrivateThe access type. Private are only accessible on URLs. Public are accessible through search and recommendations
typeDocumentTypeOtherThe document type. One of Editorial, Book, Promotional or Other
confirmCoprightboolfalseUnsure, Issuu API documentation is incomplete
downloadableboolfalseAfter publishing, will readers be able to download the document?
previewboolfalseIs this document a preview of a larger document?
showDetectedLinksboolfalseDuring the conversion phase, hyperlinks can be collated and displayed alongside the document
originalPublishDateDateTimeOffset?nullIf the document was originally published previously, this date can be made public alongside the document
scheduledTimeDateTimeOffset?nullSet the date you wish the draft to be automatically published. If this is not provided, the draft will need to be manually published

A successful response for this operation will contain a draft Document:

if (response.IsSuccess && response.HasData)
{
var document = response.Data;
// Do something with the document.
}

All Issuu document responses will be the same, but different values may be populated based on the document state.

For a complete runthrough of the Document type, see Documents.

Note on Publishing

You will not be able to publish a draft, until its associated document is uploaded and converted.