/admin/api
and may be restricted to a userEvery call to an API endpoint not located under /oauth requires the access_token parameter to be set.
You can use Authorization Code + Access Token (for humans) or User Credentials (for scripts) to get one.
Be aware that you might get an invalid_token error after an hour, in which case you should refresh your token.
Prompts the user to authorize your client to access papilio with their profile. If the user isn't logged in yet, they will be promted to provide their credentials as well.
Redirects the user to the redirect URI specified in your client's settings, e.g:
http://my.app.com/authorized?code=3f3a8611a369237a7da296a5c8f717789b967b8c&state=xyz
Use this authorization code to get an access token. Or if the user has explicitly denied access you'll get:
_http://my.app.com/authorized?error=access_denied&errordescription=...&state=xyz
Request an access token using a previously obtained authorization code.
Requires Basic Auth with your client_id as the username and the client_secret as the password.
{ "access_token": "5bb2cc6b3c8abfdee1e36d807cffc66346b896cf",
"expires_in": 3600,
"token_type": "Bearer",
"refresh_token": "d872f90159216f56f9224012a3186afaab8fa258"}
or invalid_grant if the authorization code is invalid or has expired
Request an access token directly with a user's username and password. Only recommended for scripts.
Requires Basic Auth with your client_id as the username and the client_secret as the password.
{ "access_token": "5bb2cc6b3c8abfdee1e36d807cffc66346b896cf",
"expires_in": 3600,
"token_type": "Bearer",
"refresh_token": "d872f90159216f56f9224012a3186afaab8fa258"}
or invalid_user if the provided credentials are invalid or not allowed to use with this client.
Request a new token if the old one has expired after an hour. Refresh tokens expire after 30 days.
Requires Basic Auth with your client_id as the username and the client_secret as the password.
{ "access_token": "12d6ba98f806343803c0c446ff0abcfda1302545",
"expires_in": 3600,
"token_type": "Bearer"}
Get properties of an order. Requires
for orders that don't belong to you."order": {
"id": "51038",
"title": "Inserat Bebbi Jazz",
"preview": "https:\/\/server.net\/data\/4\/orders\/51038\/live.jpg"
"status": "288",
"owner": "1",
"template": "33",
"lang": "de", // ISO 639-1
"quality": "300", // DPI
"color_space": "cmyk",
"format": "adsizer",
"dimension": {
"unit": "mm",
"width": "138",
"height": "210"
},
"created": "2013-03-12 16:13",
"modified": "2013-03-12 16:14",
"released": "2013-03-12 16:14",
"delivered": "2013-03-12 16:14",
"filesize": "12738560", // bytes
"pages": "1",
"pin": "37g6m",
"remark": "This is my demo order",
"released_by": 8 // controller, if any
"reject_reason": "typo in headline" // if rejected
"upload_name": "manually_layouted_file.eps" // if format is _manual_
"translation_of": "345" // original order of translation if any
}
Note: Status codes should be unset for the next step unless they are marked "sticky"
open = 1; // order may be edited, "sticky" until released
precontroll = 2; // optional workflow for manual orders before layouting
layout = 4; // layouting of a manual (e.g. not automatically renderable) order
control = 8; // waiting to be released by a controller
rejected = 16; // controller has rejected the order, "sticky" until released
released = 32; // controller has released the order, "sticky" forever
released = 64; // second controller (two-man rule, optional)
delivery_pending = 128; // order is ready to be downloaded (or "in print")
delivered = 256; // order has been downloaded (or been mailed), "sticky" forever
charged = 512; // order was charged (for per-PDF licensing)
exported = 1024;// charge has been exported to an external system (e.g. SAP)
Set properties of an order. Requires
(or ) for orders that don't belong to you. Changing the status manually requires in any case.{"success": "true"}
Delete an order. Requires
(or ) for orders that don't belong to you. Note that you can only delete an order that:These restrictions apply so that orders don't suddenly disappear from workflows.
{"success": "true"}
or forbidden if the above conditions are not met.
Render a preview PDF (72 DPI) of the order. Requires
for those that don't belong to you.An inline application/pdf (or internal_server_error if the order could not be rendered)
Download an order (usually a PDF). Requires
for orders that don't belong to you.The file is streamed as an attachment with
or forbidden if the order isn't downloadable (due to status or ownership)
Note that a PIN basically makes an order public, so anyone who knows it can download the file.
Request a PIN to be created of this order. Requires
for orders that don't belong to you.{"pin": "h58d2", "path": "http://papilio.my.net/pin/"}
Combine path + pin to get a "user readable" PIN link.
Download an order (usually a PDF) that has been made public with a PIN code.
Streamed the same way /order/download is, bad_request for a malformed PIN or not_found if there's no such PIN.
Delete the PIN of an order. Requires
for orders that don't belong to you.{"success": "true"}
Tip: You can use the arguments of /order here as well to get additional information.
List all completed orders of your user (i.e. not open and not deleted)
{"count": 42, "orders": [{"id"; "56789", "title": "some order", ...}, {...}]}
List the completed orders of all users, limited to a {year} (e.g. 2014, default is current year).
Requires .
{"count": 42, "orders": [{"id"; "56789", "title": "some order", ...}, {...}]}
List all deleted orders. Requires
.{"count": 42, "orders": [{"id"; "56789", "title": "some order", ...}, {...}]}
Search for orders with specific properties (with {mode} and (default) or or). Requires
.Note: date types support range search using _before and/or _after, e.g. created_after
{"count": 42, "orders": [{"id"; "56789", "title": "some order", ...}, {...}]}
List orders that need to be layouted by a human. Requires
.{"count": 42, "orders": [{"id"; "56789", "title": "some order", ...}, {...}]}
Use /order/download/{id} in order to get the automatically rendered PDF on which you should base the manual adaptation.
List orders that need to be printed and sent. Requires
Note that the orders will contain additional fields:
{"count": 42, "orders": [{"id"; "56789", "title": "some order", ...}, {...}]}
Use /order/download/{id} to get the high end PDF suitable for printing.
List orders that need to be translated. Requires
Note: The owner field is used to denote who's working on a translation. If it is null the task has not been assigned yet and you can claim it.
In order to claim or edit an order, send the user to /translation/edit/{id}
{"count": 42, "orders": [{"id"; "56789", "title": "some order", ...}, {...}]}
List of orders that the user has completed. Requires
for users other than the current one.{"count": 42, "orders": [{"id"; "56789", "title": "some order", ...}, {...}]}
List of messages that the user (or blank for the current user) has received.
Requires
for users other than yours.{
"count":42,
"messages":[
{
"id": "2460",
"title": "some subject",
"body": "some <strong>text</strong>",
"sent": true,
"read": true,
"timestamp": "2014-10-22 13:37",
"sender": {"id":"186","first_name":"Joe", ... } // user object
},
{...}
]
}
List of messages that the user (or blank for the current user) has sent.
Requires
for users other than yours.{
"count":42,
"messages":[
{
"id": "2461",
"title": "some subject",
"body": "some <strong>text</strong>",
"sent": true,
"read": false,
"timestamp": "2014-10-22 17:37",
"recipient": {"id":"186","first_name":"Joe", ... } // user object
},
{...}
]
}
Marks the message with the {id} as read.
{"success": "true"}
or forbidden if the message doesn't belong to you
Get information about a specific template.
Notes: To create a new order from a template, simply send the user to /edit/create/{id}
{"template": {
"id": "34",
"title": "Inserat A4 hoch",
"preview": "https:\/\/server.net\/data\/4\/preview\/t_34_preview.jpg",
"dimension": {
"unit": "mm",
"width": "210",
"height": "297"
},
"parent": "16", // template group to which it belongs to
"order": "2", // sort order within the template groups
"pages": "1",
"languages": ["de", "fr", "it"],
"quality": ["150", "300"], // available output DPI
"color_space": ["gray", "cmyk"],
"delivery": "download", // download or postage
"price": "0"
}}
or forbidden if you don't have the permission to see the template,
or not_found if the template doesn't exist or is not active.
Notes:
Get a list of templates and template groups that are children of the template group with this {id}. Omit the group parameter to get all children of the root node. Requires
.{
"count": 42,
"children": [
{
"id": "8",
"title": "Some group",
"status": "2",
"order": "0",
"type": "group",
"multiprev": "0",
"examples": "0",
"preview": "/data/4/preview/t_34"
},
{
"id": "10",
"title": "Some template",
"status": "2",
"order": "20",
"type": "template",
"multiprev": "0",
"examples": "0",
"preview": "/data/4/preview/t_34"
},
...
],
"parents": [ // in that order, for breadcrumbs et al.
{"id": "1", "title": "top group"},
{"id": "7", "title": "sub group"} // you are here
]
}
Get a complete, nested array of all the template groups and their templates. Requires
.{"nested": [
[
{
"id": "8",
"title": "Top level group",
"status": "2",
"order": "0",
"type": "group",
"multiprev": "0",
"examples": "0",
"preview": "/data/4/preview/g_8"
},
[
[
{
"id": "16",
"title": "Sub group",
"status": "2",
"order": "1",
"type": "group",
"multiprev": "0",
"examples": "0",
"preview": "/data/4/preview/g_16"
},
[...]
],
{
"id": "35",
"title": "Template in top level group",
"status": "2",
"order": "19",
"type": "template",
"multiprev": "0",
"examples": "0",
"preview": "/data/4/preview/t_35"
}
]
],
[...],
{
"id": "36",
"title": "Template on top level",
"status": "2",
"order": "20",
"type": "template",
"multiprev": "0",
"examples": "0",
"preview": "/data/4/preview/t_36"
}
]}
Get all the example publications (orders) of the template with this {id}. If no {lang} parameter is present, the current language will be used. Requires
.{"count": 7, "orders": [{"id"; "8739", "title": "some order", ...}, {...}]}
Search available templates and example publications for a given {term}.
Note that this also searches in template groups and will return its direct children in case of a match.
{
"count": 7,
"templates":[{"id": "49","title": "some template", ...}, {...}],
"examples": [{"id"; "8739", "title": "some order", ...}, {...}]
}
Format:
{
"error": "invalid_token",
"error_description": "The access token provided has expired"
}
General:
Oauth:
Generic HTTP errors may also be thrown by the framework, where the error will start with httperror{number}