Skip to content

Product Download Token API

Introduction

Methods to request product download tokens from Open Publishing API.

Request parameters

external_identifiers

[Optional] Adds additional external tracking id.

custom_text

[Optional] Adds custom text.

internal_remark

[Optional] Adds internal remarks.

valid_from

[Optional] Token becomes valid from the specified date.

valid_till

[Optional] Token becomes invalid at the specified date.

require_login

[Optional] Defines whether the user needs to be logged-in to download. If not specified false will be set by default.

download_quota

[Optional] Sets the maximum number of downloads.

max_lifetime

[Optional] Sets max token lifetime. Expects following values:

  • 1-hour

  • 5-hours

  • 1-day

  • 2-days

  • 1-week

  • 1-month

  • unlimited

By default: unlimited will be set.

language

[Optional] Sets the download page language. Expects ISO 639-2 code. e.g. ger

name

[Optional] Sets the name of the token recipient

email

[Optional] Sets the email of the token recipient

number_of_tokens

[Optional] Number of tokens to generate. If not specified 10 download tokens will be generated by default.

recipients

[Optional] Array of email recipients, expects an array of recipients:

[
    {
        "name": "Name",
        "email": "email@example.com"
    }
]

Single download token generation

Generates a single download token.

POST /rpc/v2/products/<ID>/download_token/single

Specific request

Request
POST /rpc/v2/products/<ID>/download_token/single
{
    "external_identifiers": [
        {
            "type": "external-identifier-type",
            "value": "external-identifier-value"
        }
    ],
    "custom_text": "custom-text",
    "internal_remark": "internal-remark",

    "valid_from": "2023-10-14T01:01:01",
    "valid_till": "2023-10-16T01:01:01",
    "require_login": true,
    "download_quota": 10,
    "max_lifetime": "2-days",
    "language": "ger",
    "name": "Bob",
    "email": "bob@example.com",
}
Response
{
    "items": [
        {
            "download_quota": 10,
            "max_lifetime": 172800,
            "recipient_email": "Bob",
            "recipient_name": "bob@example.com",
            "require_login": true,
            "token": "FKR7LUDFM8L6",
            "url": "https://<brand>.openpublishing.com/free/FKR7LUDFM8L6",
            "valid_from": "2023-10-14T01:01:01",
            "valid_till": "2023-10-16T01:01:01"
        }
    ]
}

Minimal request

Request
POST /rpc/v2/products/<ID>/download_token/single
{}
Response
{
    "items": [
        {
            "download_quota": null,
            "max_lifetime": null,
            "recipient_email": null,
            "recipient_name": null,
            "require_login": false,
            "token": "45K4GDL75GSG",
            "url": "https://<brand>.openpublishing.com/free/45K4GDL75GSG",
            "valid_from": null,
            "valid_till": null
        }
    ]
}

Bulk download token generation

Generates bulk download tokens.

POST /rpc/v2/products/<ID>/download_token/bulk

Specific request

Request
POST /rpc/v2/products/<ID>/download_token/bulk
{
    "external_identifiers": [
        {
            "type": "external-identifier-type",
            "value": "external-identifier-value"
        }
    ],
    "custom_text": "custom_text",
    "internal_remark": "internal_remark",
    "valid_from": "2023-10-14T01:01:01",
    "valid_till": "2023-10-16T01:01:01",
    "require_login": true,
    "download_quota": 10,
    "max_lifetime": "2-days",
    "language": "ger",
    "number_of_tokens": 2
}
Response
{
    "items": [
        {
            "download_quota": 10,
            "max_lifetime": 172800,
            "recipient_email": null,
            "recipient_name": null,
            "require_login": true,
            "token": "FF3K4TTT2J6W",
            "url": "https://<brand>.openpublishing.com/free/FF3K4TTT2J6W",
            "valid_from": "2023-10-14T01:01:01",
            "valid_till": "2023-10-16T01:01:01"
        },
        ...
    ]
}

Minimal request

Request
POST /rpc/v2/products/<ID>/download_token/bulk
{}
Response
{
    "items": [
        {
            "download_quota": null,
            "max_lifetime": null,
            "recipient_email": null,
            "recipient_name": null,
            "require_login": false,
            "token": "45K4GDL75GSG",
            "url": "https://<brand>.openpublishing.com/free/45K4GDL75GSG",
            "valid_from": null,
            "valid_till": null
        },
        ...
    ]
}

Mailing list download token generation

Generates download tokens for a recipient list.

POST /rpc/v2/products/<ID>/download_token/mailing_list

Specific request

Request
POST /rpc/v2/products/<ID>/download_token/mailing_list
{
    "external_identifiers": [
        {
            "type": "external-identifier-type",
            "value": "external-identifier-value"
        }
    ],
    "custom_text": "custom_text",
    "internal_remark": "internal_remark",
    "valid_from": "2023-10-14T01:01:01",
    "valid_till": "2023-10-16T01:01:01",
    "require_login": true,
    "download_quota": 10,
    "max_lifetime": "2-days",
    "language": "ger",
    "recipients": [
        {
            "name": "Bob",
            "email": "bob@example.com"
        }
    ]
}
Response
{
    "items": [
        {
            "download_quota": 10,
            "max_lifetime": 172800,
            "recipient_email": "bob@example.com",
            "recipient_name": "Bob",
            "require_login": true,
            "token": "LSV89KC65S6A",
            "url": "https://<brand>.openpublishing.com/free/LSV89KC65S6A",
            "valid_from": "2023-10-14T01:01:01",
            "valid_till": "2023-10-16T01:01:01"
        }
    ]
}

Minimal request

Request
POST /rpc/v2/products/<ID>/download_token/mailing_list
{
    "recipients": [
        {
            "name": "Bob",
            "email": "bob@example.com"
        }
    ]
}
Response
{
    "items": [
        {
            "download_quota": null,
            "max_lifetime": null,
            "recipient_email": "bob@example.com",
            "recipient_name": "Bob",
            "require_login": false,
            "token": "QTGLBTX3KVXK",
            "url": "https://<brand>.openpublishing.com/free/QTGLBTX3KVXK",
            "valid_from": null,
            "valid_till": null
        }
    ]
}