Here you will find the full API, services and action parameter documentation. We also have a Swagger page, useful to test a little but not fully configured (missing headers for EnrichedImages and Clicks, so it won't work, multipart stuff a little handmade...). You can find it here: https://api.onprint.com/Swagger
Request AccessTo get access to our services, you will need an account.
To request an account to our development team, please fill in that request form.
Contact UsShould you have any feedback or question please feel free to contact us.
LTU uses OAuth2 as authentication standard. First, a token must be retrieved from a token endpoint, and then any call to the API, except the EnrichedImage and Click endpoints, must specify OAuth2 authentication type and token in the header. We will explain it more in detail below.
The first step at login is to get a token using the standard OAuth2 request, also with a header containing the ApiKey. Username and password must be provided as a formData content. Example of form-data:
`grant_type=password&username=toto@onprint.com&password=test`
The content-type of the POST request must be application/x-www-form-urlencoded
The ApiKey Header must be provided as follows. It will return a Json containing user information and the token :
ApiKey:xxx
The token is in the field: access_token
The token has an expiration date, also available in the response.
Once we have the token to connect, we will use OAuth authentication for every API call, except the ones described below. The header must be built as follows:
Authorization: Bearer AQAAANCMnd8BFdERjHoAwE_Cl-sBAAAAHufd(…)
These endpoints are for image search or user creation / password recovery. As they do not require authentication, the ApiKey header (as well as others, see details in each endpoint part) will have to be set.
Objects in the platform are organized in nodes. Here are the main rules:
3 roles can be used in the LTU API. A user can have one or more roles.
Here is a list of the main Return Codes in use in the application.
Standard response for successful HTTP requests. The actual response will depend on the request method used. In a GET request, the response will contain an entity corresponding to the requested resource. Example of use: in resource Folder, in GET /api/Folders/{id}, if the folder is found it is returned in the response body with return code 200.
The request has been fulfilled, resulting in the creation of a new resource. Example of use: in resource Document, in POST /api/Documents, if the document could be created with no errors, return code is 201. The new document is returned in the response body.
The server successfully processed the request and is not returning any content. Example of use: in resource EnrichedImage, in POST /api/EnrichedImages, if the request was successful but no corresponding image was recognized, or did not contain any action, the return code is 204. Another example: in resource DocumentLanguage, in PUT /api/DocumentLanguages, if the language was correctly added to the document, the return code is 204.
The server cannot or will not process the request due to an apparent client error. Example of use: in resource Icon, in PUT /api/Icons/{id}, if the image that is sent in the request is too large, the server will not be able to process the request and will respond 400.
When authentication is required and has failed or has not yet been provided. Example of use: in any resource that needs authentication, if the Authorization header is not set, the server will respond 401.
The request was a valid request, but the server is refusing to respond to it. Example of use: in resource Account, in GET /api/accounts?organizationId={id}, if the user role does not allow him/her to see the organization, the response will be 403.
The requested resource could not be found but may be available in the future. Example of use: in resource Action, in POST /api/Actions, If the given parent DocumentId does not lead to an existing document, the server will say that the resource cannot be found and return 404.
This error should not happen, but can be raised when we did not handle properly something on the server side. Sometimes because of a bad request, or a bug. If you encounter this, please contact LTU.
Property | Type | Description | Comment |
---|---|---|---|
Id | Guid | Read-Only, generated | |
ParentId | Guid | ||
DefaultLanguage | String | Default language used for scan | |
Name | String | ||
ContentType | String | MIME ContentType | Read-Only |
Pages | Int | Pages count | Read-Only |
ActionCount | Int | Action Count | Read-Only |
Status | String | (see below) Can only be from active to inactive and back | |
Cover | String | Document Cover thumbnail URL | Read-Only |
DateCreated | DateTime | Read-Only | |
DateModified | DateTime | Read-Only |
The POST method is used to create a document by sending the document file and its properties. The request body content type must be Multipart (multipart/form-data). The content is made of a File data (file) and a Form data (document).
In the URL, a parameter named async can be set like this: POST /api/Documents?async=false. Defaults to true if not set. When this parameter is true, the image creation is made asynchronously and the method returns directly. When it is false, the method waits for the image creation before returning. The difference between both methods is important in the case of a PDF file.
The document itself. It can be a JPEG, PNG, GIF image, or a PDF document. The MIME type has to be given in the file content type.
Contains a Document object. The form data name is document. DefaultLanguage, Name and ParentId are mandatory.
PUT is a multipart method where only the attached file will be read, to replace the image. To modify document properties, a PATCH will have to be done.
The document replacement itself. It can be a JPEG, PNG, GIF image, or a PDF document. The MIME type has to be given in the file content type.
Can be sent independently: DefaultLanguage, Name, ParentId, Status.
Images are contained into a document. They are created when creating the document; it is not possible to create an image outside a document.
Property | Type | Description | Comment |
---|---|---|---|
Id | Guid | Read-Only, generated | |
DocumentId | Guid | ||
Status | String | (see below) | Read-Only |
Name | String | ||
ActionCount | Int | Read-Only | |
ZoneCount | Int | Read-Only | |
Order | Int | Order in document | |
AutoTrigger | Bool? | Auto trigger of the action. Only if 1 action | |
SmallThumbnail | String | 100px thumbnail | Read-Only |
BigThumbnail | String | 700px thumbnail | Read-Only |
DateCreated | DateTime | Read-Only | |
DateModified | DateTime | Read-Only |
Name, Order, Status are mandatory.
Can be sent independently: AutoTrigger, Name, Order, Status.
Property | Type | Description | Comment |
---|---|---|---|
Id | Guid | Read-Only, generated | |
NodeId | Guid | ||
IconId | Guid | Optional | |
IsValid | Bool | An action is valid when all fields respect rules | |
LanguageCode | String | ||
Priority | Int? | Allows to sort actions | |
Order | Int? | Allows to sort actions | |
Name | String | ||
Style | String | Style, given as a css-like string | |
Type | String | (see below) | |
Content | String | Action content-see other doc | |
DateCreated | DateTime | Read-Only | |
DateModified | DateTime | Read-Only |
The Style is a free text zone, to be interpreted and understood by the Enriched Images searcher. Onprint smartphone application understands a Json string built as follows. There are 3 parts: the model (identifier so that the app knows how to parse it), the button style (css-like properties, written in Json), and the text style (css-like in Json too).
{
"model":"ONPrint-V2.0",
"button":{
"background-color":"#14d22c ",
"opacity":0.6
},
"text":{
"color":"#ffffff ",
"font-weight":"normal",
"font-style":"normal",
"opacity":1
}
}
LanguageCode, NodeId are mandatory. Node must be a Document, Image or Zone and have a Title for the provided language (even if it is an empty string). If the action type is empty, it will be set to RAW.
Can be sent independently: Content, IconId, LanguageCode, Name, NodeId, Order, Priority, Style, Type. If the Action Type is patched, then the Content must be provided too, and reverse.
The DocumentLanguage is an association between an existing document and an existing language. When creating a new document, a DocumentLanguage is automatically created, with the default language of the document.
Property | Type |
---|---|
DocumentId | Guid |
LanguageCode | String |
DocumentId and LanguageCode are mandatory.
This resource corresponds to the languages in use in the platform. It is read-only.
Property | Type | Description |
---|---|---|
Code | String | |
Name | String | |
Region | String | |
Zone | String | Geographic zone |
Icons are associated to an action, but can be set at any node level. This will allow inheritance and default settings for the documents within a node.
Property | Type | Comment |
---|---|---|
Id | Guid | Read-Only, generated |
NodeId | Guid | |
Name | String | |
Tags | String | Comma-separated values in a string |
Url | String | Read-Only |
The request body must be Multipart (multipart/form-data). The content is a File data and a Form data.
The icon image size must be maximum 64x64 pixel.
Contains the Json query object that goes with the content. It’s an Icon resource, named “icon”. NodeId is mandatory. Example:
{
"NodeId": "07b307ea-7253-4114-9ca1-5e367355df4a ",
"Name": "MyIcon",
"Tags": "work, telephone, call"
}
The PUT function needs the IconId as a parameter in the path: PUT api/Icons?iconId=…, and then a file (multipart, as for POST). The role of the PUT function here is just to replace the file. It will not be possible to modify the icon resource. To do so, a PATCH will have to be used.
Can be sent independently: NodeId, Name, Tags.
A title is associated to an image, document or zone, and a language. It is the title of the element that will be recognized. A title at a higher level than an image will be the default title for the children that are not overridden. The methods will fail if the node type is other than image, document or zone.
Property | Type |
---|---|
NodeId | Guid |
LanguageCode | String |
Value | String |
Style | String |
The Style is a free text zone, to be interpreted and understood by the Enriched Images searcher. See its description and example in the Action part.
The POST method is used to create default titles in parent nodes (folders, organizations). Under a document (for a document, image or zone), titles are created either at the document / image / zone creation, or by using the DocumentLanguage resource, using the PUT method with the language. Then, to edit the titles under the document, a PUT will have to be done on each node. LanguageCode, NodeId, Value are mandatory.
Value is mandatory. LanguageCode and NodeId can’t be modified.
Can be sent independently: Style, Value.
A Zone is a sub part of an image which can be enriched independently. Creating a zone in an image will deactivate the parent image and activate the child zone. Actions of the original image become global to every zone.
Property | Type | Description | Comment |
---|---|---|---|
Id | Guid | Read-Only, generated | |
ImageId | Guid | ||
Height | Int | Percentage of image size | |
Width | Int | Percentage of image size | |
PositionX | Int | Percentage of image size | |
PositionY | Int | Percentage of image size | |
Status | String | See Image status | Read-Only |
Name | String | ||
ActionCount | Int | Read-Only | |
Order | Int | Order in image | |
AutoTrigger | Bool? | Auto trigger of the action. Only if 1 action | |
SmallThumbnail | String | 100px thumbnail | Read-Only |
BigThumbnail | String | 700px thumbnail | Read-Only |
DateCreated | DateTime | Read-Only | |
DateModified | DateTime | Read-Only |
ImageId, PositionX, PositionY, Width, Height are mandatory.
PositionX, PositionY, Width, Height are mandatory. ImageId can’t be modified.
Can be sent independently: ActionStyle, AutoTrigger, Height, Name, PositionX, PositionY, TitleStyle, Width.
ImageAndZones is an intermediary resource that combines an image with its children zones. It can be accessed the same way as an image, but will have no interest if the image has no zone. This resource is read-only; manipulating zones is directly done through the Zone resource.
Property | Type | Description |
---|---|---|
Id | Guid | |
DocumentId | Guid | |
Status | String | See Image status enumeration |
Name | String | |
ActionCount | Int | |
ZoneCount | Int | |
Order | Int | Order in document |
AutoTrigger | Bool | Auto trigger of the action. Only if 1 action |
SmallThumbnail | String | 100px thumbnail |
BigThumbnail | String | 700px thumbnail |
DateCreated | DateTime | |
DateModified | DateTime | |
Zones | List |
Zone list |
All the files related to a document: thumbnails and originals. The files are created at the document creation, and can be modified when modifying a document. This endpoint is read-only.
This resource is a full image used for recognition and getting actions associated to an image. It contains everything that is needed to use onprint from a mobile device.
Property | Type | Description |
---|---|---|
Id | Guid | |
BigThumbnailUrl | String | Big thumbnail URL (700px) |
LanguageCode | String | |
Title | String | Image title |
DocumentId | Guid | |
SessionId | String | Session Id: is set by the server |
Order | Int | Image order in document |
AutoTrigger | Bool | Auto trigger of the action Only if 1 action |
TitleStyle | String | |
Data | String | This field will always be empty, except when you scan a Picture, therefore you will have no Title, no Actions, no LanguageCode, no Styles. |
Actions | List |
Read-Only resource, only contained in EnrichedImages.
Property | Type | Description |
---|---|---|
Id | Guid | |
Icon | String | Icon URL |
Priority | Int | |
Order | Int | |
Name | String | |
Style | String | |
Type | String | See action type enumeration |
Content | String |
To use any method for this resource, the following headers are required:
Header | Mandatory? |
---|---|
SessionId | |
ApplicationInstanceId | |
ApplicationName | * |
ApplicationVersion | * |
ApiKey | * |
DeviceName | * |
DeviceSystemVersion | * |
DeviceSystemVersionName | |
SdkName | |
SdkVersion | * |
DeviceConnectivity | |
DeviceScreenDiagonal | |
DeviceScreenHeight | |
DeviceScreenWidth |
If SessionId is null, it will be initialized by the server and given back in the EnrichedImage.
The POST method here is used as a search query, to search an image using image recognition. The request body content type must be Multipart (multipart/form-data). The content is made of a File data and a Form data.
Contains the image file of the picture taken (image/jpeg content type). The picture can be compressed, put in black&white and pre-treated to ease image recognition.
Contains the Json query object that goes with the content. The parameter only contains one property: Language (string) containing a language code. The form data name is “query”. Example:
{
"Language":"fr-FR"
}
The response is the enriched image with localized actions. Here is an example:
{
"Id": "712816b1-ae76-47fb-801f-a54b49378fb5",
"BigThumbnailUrl": "http://toto.com/bigthumb.jpg",
"LanguageCode": "fr-FR",
"Title": "Tout sur les Poissons",
"DocumentId": "07b307ea-7253-4114-9ca1-5e367355df4a",
"SessionId": "140cc120-e78a-4039-aef4-1b4b20436a58",
"Order": 1,
"AutoTrigger": true,
"Actions": [{
"Id": "1e60ce69-32e8-45b7-8655-36a1361ce4bc",
"Icon": "http://toto.com/icon.jpg",
"Priority": 2,
"Order": 8,
"Name": "Nous rejoindre",
"Type": "URL",
"Content": "{
\"Url\": \"http://www.onprint.com\",
\"IsEmbeddedWebView\": \"true\",
\"IsAnonymousURL\": \"true\",
\“ContentType\”:\”text/html\”}"
}]
}
The content parameter types are described in another document.
A click is an event resource that is used to track a click of a user on a given action. The most common use case is the smartphone application: the click is called after an image recognition and action listing, when the user taps on an action. The click is stateless, write-only.
To use this method, the following headers are required:
Header | Mandatory? |
---|---|
SessionId | * |
ApiKey | * |
If SessionId is null, it will be initialized by the server.
The PUT method is simply called with the Action identifier in the URL: PUT /api/clicks?actionId=…
Through this resource you can access information about the search requests made against a document.
Property | Type | Description |
---|---|---|
RequestTime | DateTime | |
DeviceSystemVersion | String | |
Language | String | Language code |
Operating System | String | |
ImageOrder | Int | Order of image in document |
DocumentName | String | |
Host | String | IP of caller |
Clicks | List |
Clicks associated to the match |
Read-Only resource, only contained in Matches.
Property | Type | Description |
---|---|---|
ClickTime | DateTime | |
Host | String | IP of caller |
ActionName | String | |
ActionOrder | Int | Order of action in image |
ActionType | String | |
ActionId | Guid |
Roles are associated to rights management and permissions of a user. It is not possible to add a new role. The PUT method allows to associate a User to a known role.
Property | Type | Description |
---|---|---|
Role | String | Nom du rôle* |
Role enumeration
Returns All known roles
The PUT method needs the userId and the role name as parameters in the path, and no content: PUT api/Users/{userId}/Roles/{role}. Example: PUT /api/Users/123456/Roles/Designer
Management of the platform users. A user is attached to an organization.
Property | Type | Description | Comment |
---|---|---|---|
Id | Guid | Read-Only, generated | |
OrganizationId | Guid | ||
UserName | String | ||
String | e-mail address | ||
FirstName | String | ||
LastName | String | ||
Password | String | ||
Status | String | (see below) | |
Gender | String | (see below) |
OrganizationId, Mail are mandatory. If provided Username is NULL, Mail address will be copied into Username.
OrganizationId, Mail are mandatory. PUT does not update Password. If provided Username is NULL, Mail address will be copied into Username.
Can be sent independently: Status, Password.
An organization’s account, created after the organization creation. RemainingCredit depends on the contract type. The other fields are counters. This resource is read-only.
Property | Type | Description |
---|---|---|
OrganizationId | Guid | |
ValidityDate | DateTime | End of contract date |
ActivePages | Int | Number of active pages |
ActivationCumul | Int | Number of pages that have been activated at least once |
AccountType | String | (see below) |
RemainingCredit | int | Remaining pages to activate |
A credit is an event resource that means a transaction between a source and a target. The source is the organization of the user that is logged in, the target is the organization identifier given in the Json parameter. To give or take credits, the user must have sufficient rights on the source and on the target organizations. The credit transaction is stateless, write-only.
Property | Type |
---|---|
OrganizationId | Guid |
Amount | Guid |
Direction | String |
OrganizationId, Amount and Direction are all mandatory.
The Logo is associated to an organization. It is used for platform client display. It can only be set or deleted from here, and its URL is available in the organization resource properties.
The request body content type must be Multipart (multipart/form-data). It needs the OrganizationId as a parameter in the path: PUT api/Logo/{id} and a File Data. In File data, the logo can be any image type (png, jpg, gif).
An organization represents a customer (company or individual). It’s the main node of a document hierarchy.
Property | Type | Description | Comment |
---|---|---|---|
Id | Guid | Read-Only, generated | |
ParentId | Guid? | NodeId (parent) | |
Logo | String | Logo URL | Read-Only |
LanguageCode | String | ||
Name | String | ||
ApiKey | String | API Key, used for WebAPI calls | Read-Only |
AccountType | String | See account type enumeration | Read-Only |
MobileApiAuthorized | Bool | Mobile can reach the API | Read-Only |
WebApiAuthorized | Bool | Any API access | Read-Only |
IRProviderId | Guid | Id and access details of IR Provider | Read-Only |
ActivationCumul | Int | See account resource | Read-Only |
DeactivationCumul | Int | Read-Only | |
TotalDebit | Int | Read-Only | |
TotalCredit | Int | Read-Only | |
DateCreated | DateTime | Read-Only | |
DateModified | DateTime | Read-Only | |
PicturesCount | Int? | Pictures Counter, only for organizations in Pictures mode. Updated when option GetPicturesCount is True in GET Organizations/Id. | Read-Only |
LanguageCode, Name, ParentId are mandatory.
Can be sent independently: LanguageCode, Name, ParentId.
AccountType, IRProviderId, MobileApiAuthorized and WebApiAuthorized are special fields that require LTU input and cannot be set / modified. Contact us for more information.
Folder management.
Property | Type | Description | Comment |
---|---|---|---|
Id | Guid | Read-Only, generated | |
ParentId | Guid | NodeId | |
Name | String | ||
DateCreated | DateTime | Read-Only | |
DateModified | DateTime | Read-Only |
Name and ParentId are mandatory.
Can be sent independently: Name, ParentId.
A node is an element of arborescence that hierarchically organizes Organizations, Folders, Documents, Images and Zones. It contains no information but the hierarchy of nodes. Nodes are systematically created among with Organizations, Folders, Documents, Images and Zones.
Property | Type |
---|---|
Id | Guid |
Type | String |
ParentId | Guid |
Name | String |
Properties define default behavior for nodes. Today it only concerns default Icon or default Style. Behavior of properties is different for icon properties and style properties. For an icon, it is only stored, not used by the server and not provided in the list of icons in the node. For a style, the information is used by the server. The style is automatically set for all the children titles or actions, existing or new, when there is no other defined style in the hierarchy.
Property | Type | Comment |
---|---|---|
Id | Guid | Read-Only, generated |
NodeId | Guid | |
Type | String | |
Name | String | |
Value | String |
If Property Type is “Style”, Property name must be one of the following. It indicates whether the property sets a default ActionStyle or a default TitleStyle:
NodeId, Type and Name are mandatory.
Can be sent independently: Name, Value.
Property | Type |
---|---|
Date | DateTime |
User | String |
Operation * | String |
Sometimes, you will only need the Platform to identify an image, not to enrich it with actions, languages and styles. There are entry points for that. You only need a login, an OrganizationId (you get it when you log in), and an API Key for searching.
This part is optimized for High Volumes / High Speed image recognition. No image is stored in the platform, and data is indexed in a fast database.
This API also allows to search an image based on the color of another image. The principle stays the same but if you need more information please do not hesitate to contact us.
A Picture is a simple, single Image. It is not compatible with the whole Node hierarchy and cannot be into a Document, nor listed in a Folder. There cannot be Zones in it. It is only linked to an Organization.
Property | Mandatory? | Type | Description | Comment |
---|---|---|---|---|
Id | String | Picture Id in the platform. | Read-Only, generated | |
_objectId | String | Internal Id, useful for pagination (see ) | Read-Only, generated | |
Name | * | String | Picture name. Can be your own identifier | |
Data | String | Picture metadata. You can put whatever you want, in any format. | ||
OrganizationId | * | String | Organization's Id. Pictures will be listed under it. | |
BigThumbnailUrl | String | URL of the Picture's Thumbnail. (only for display) | Read-Only, generated | |
SessionId | String | Session identifier that you can use to link events to the IR. | Read-Only, generated | |
RecognitionScore | String | Score of the image recognition, regarding the query image. | Read-Only | |
Keywords | String[] | Keywords attached to the picture, to filter searches. |
The POST method is used to create a picture by sending the image file and its properties. The request body content type must be Multipart (multipart/form-data). The content is made of a File data (file) and a Form data (picture).
The image itself. It can be a JPEG, PNG, or GIF image. The MIME type has to be given in the file content type.
Contains a Picture object. The form data name is picture. Name and OrganizationId are mandatory. If you don't know where to find an OrganizationId, yours is in the token when you log in.
Calling PUT /api/Pictures with an existing updated Picture in the body will only update its Name, Data and Keywords.
Calling PATCH /api/Pictures with an existing updated Picture in the body can update its Name, Data and Keywords, if a value is entered for each.
The POST method on SEARCH is used to query the image for recognition. The request body content type must be Multipart (multipart/form-data). The content is made of a File data (file) and a Form data (query), currently left empty. This method does not require authentication but the following headers:
Header | Mandatory? |
---|---|
ApplicationInstanceId | |
ApplicationName | * |
ApplicationVersion | * |
ApiKey | * |
DeviceName | * |
DeviceSystemVersion | * |
DeviceSystemVersionName | |
SdkName | |
SdkVersion | * |
DeviceConnectivity | |
DeviceScreenDiagonal | |
DeviceScreenHeight | |
DeviceScreenWidth |
The query image itself. It can be a JPEG, PNG, or GIF image. The MIME type has to be given in the file content type.
Please send also a query consisting of an empty form { }. The form data name is query. A query object to precise / filter results. Currently it consists of adding the picture's keywords as a Json:
{
Keywords:["keyword1", "keyword2"]
}
The Search returns a list of pictures matching the query image and, if there are, the keywords. Every matching Picture is returned with its RecognitionScore between 0 and 1, the highest being 1.
Onprint uses OAuth2 as authentication standard. First, a token must be retrieved from a token endpoint, and then any call to the API, except the EnrichedImage and Click endpoints, must specify OAuth2 authentication type and token in the header. We will explain it in more details below.
The first step at login is to get a token using the standard OAuth2 request, also with a header containing the ApiKey. Username and password must be provided as a formData content. Example of form-data: `grant_type=password&username=toto@onprint.com&password=test`
The content-type of the POST request must be: application/x-www-form-urlencoded
The ApiKey Header must be provided as follows: ApiKey:xxx
It will return a Json containing user information and the token.
The token is in the field: access_token
The token has an expiration date, also available in the response.
Once we have the token to connect, we will use OAuth authentication for every API call, except the ones described below.
The header must be built as follows:
Authorization: Bearer AQAAANCMnd8BFdERjHoAwE_Cl-sBAAAAHufd(…)
Import actions in a document, providing a XML or a Json string. The document must have been created and uploaded before, using the API (POST /api/documents).
PUT /services/Automation/Import
Import (as data : XML or Json content) : Object containing a Json or / and a XML representation of the document’s languages, titles and actions. If both are provided, the Json representation will be used in priority.
The Import format (XML or JSON) is exactly the same as the exported format (see below).
Json representation example, explained:
Document-level properties: default values, titles, default actions, images
"DefaultLanguage":"fr-FR",
"Name":"Doc1",
"ActionStyle":"",
"TitleStyle":"",
List of default titles for the document. Here we have 2 languages: French and US English. The titles are empty because they have not been set yet. In this example other titles are set in the image, therefore we don’t need them. Titles need to be set anyway, even empty, as they are also used to list the languages of the document.
"Titles":
[{
"LanguageCode":"en-US",
"Value":""
},{
"LanguageCode":"fr-FR",
"Value":""
}],
List of global actions for the document. Here we have 2 actions for each language. These actions will be attached to the document, and shown for every image of the document.
"Actions":
[{
"LanguageCode":"en-US",
"Priority":0,
"Order":1,
"Name":"Oww Yeah 1",
"Type":"URL",
Note that Action content is a Serialized Json, not directly an object, because it can have different types (see Action object in API documentation).
"Content":"{\"Url\":\"www.onprint.com\",\"IsEmbeddedWebView\":false,\"IsAnonymousURL\":false,\"ContentType\":\"Text/html\"}",
"Style":null
},{
"LanguageCode":"en-US",
"Priority":0,
"Order":2,
"Name":"Oww Yeah 2",
"Type":"URL",
"Content":"{\"Url\":\"www.onprint.com\",\"IsEmbeddedWebView\":false,\"IsAnonymousURL\":false,\"ContentType\":\"Text/html\"}",
},{
"LanguageCode":"fr-FR",
"Priority":0,
"Order":1,
"Name":"éléphant 1",
"Type":"URL",
"Content":"{\"Url\":\"www.onprint.com\",\"IsEmbeddedWebView\":false,\"IsAnonymousURL\":false,\"ContentType\":\"Text/html\"}",
},{
"LanguageCode":"fr-FR",
"Priority":0,
"Order":2,
"Name":"éléphant 2",
"Type":"URL",
"Content":"{\"Url\":\"www.onprint.com\",\"IsEmbeddedWebView\":false,\"IsAnonymousURL\":false,\"ContentType\":\"Text/html\"}",
}],
Images correspond to the details of the pages of the document. For each page we will list the associated titles and actions.
"Images":
[{
"Name":"Page 1",
"AutoTrigger":false,
"ActionStyle":"",
"TitleStyle":"",
As for the document before, the titles have the same structure. Here they correspond to the titles only for this page.
"Titles":
[{
"LanguageCode":"en-US",
"Value":"All you ever wanted to know"
},{
"LanguageCode":"fr-FR",
"Value":"Tout sur les éléphants"
}],
And finally, the actions associated to the image itself. Here we have 2 per language. When the image will be flashed on a French phone, we will see the 3 French global actions plus the 2 actions defined below for French.
"Actions":
[{
"LanguageCode":"en-US",
"Priority":0,
"Order":1,
"Name":"Action of page 1, nr 1",
"Type":"URL",
"Content":"{\"Url\":\"www.onprint.com\",\"IsEmbeddedWebView\":false,\"IsAnonymousURL\":false,\"ContentType\":\"Text/html\"}",
},{
"LanguageCode":"en-US",
"Priority":0,
"Order":2,
"Name":"Action of page 1, nr 2",
"Type":"URL",
"Content":"{\"Url\":\"www.onprint.com\",\"IsEmbeddedWebView\":false,\"IsAnonymousURL\":false,\"ContentType\":\"Text/html\"}",
},{
"LanguageCode":"fr-FR",
"Priority":0,"Order":1,
"Name":"éléphant de la page 1, nr 1",
"Type":"URL",
"Content":"{\"Url\":\"www.onprint.com\",\"IsEmbeddedWebView\":false,\"IsAnonymousURL\":false,\"ContentType\":\"Text/html\"}",
},{
"LanguageCode":"fr-FR",
"Priority":0,
"Order":2,
"Name":"éléphant de la page 1, nr 2",
"Type":"URL",
"Content":"{\"Url\":\"www.onprint.com\",\"IsEmbeddedWebView\":false,\"IsAnonymousURL\":false,\"ContentType\":\"Text/html\"}",
}],
If the image has zones, they will be defined here. A zone is like an image, but it has a Height, width, positions, expressed as percentages of the full image. Titles, actions are defined. If the image has zones, the actions of the image will work as global document actions and will be added to the zone actions. The image itself will not be active, the zones will be.
"Zones": [{
"Height":20,
"Width":10,
"PositionX":1,
"PositionY":2,
"Name":"Zone1",
"AutoTrigger":false,
"ActionStyle":"",
"TitleStyle":"",
"Titles":[{
"LanguageCode":"fr-FR",
"Style":null,
"Value":""
}],
"Actions":[{
"LanguageCode":"fr-FR",
"Priority":0,
"Order":1,
"Name":"coucou zone1",
"Type":"URL",
"Icon":null,
"Content":"{\"Url\":\"www.onprint.com\",\"IsEmbeddedWebView\":false,\"IsAnonymousURL\":false,\"ContentType\":\"Text/html\"}",
"Style":null
}]
}]
}]
}
There is also the possibility to set a Style for any Title or any Action (css-like string, see action description in API documentation), and an Icon Id (known Guid) for any action. XML representation example:
This is the same as before, but in XML. The structure is exactly the same.
<?xml version="1.0" encoding="utf-16"?>
<Document DefaultLanguage="fr-FR" Name="Doc1">
<ActionStyle />
<TitleStyle />
<Titles>
<Title LanguageCode="en-US"></Title>
<Title LanguageCode="fr-FR"></Title>
</Titles>
<Actions>
<Action LanguageCode="en-US" Priority="0" Order="1" Name="Oww Yeah 1" Type="URL">
The content is still Json: it is a string that will be set as is in the content.
<Content>{"Url":"www.onprint.com","IsEmbeddedWebView":false,"IsAnonymousURL":false,"ContentType":"Text/html"}</Content>
</Action>
<Action LanguageCode="en-US" Priority="0" Order="2" Name="Oww Yeah 2" Type="URL">
<Content>{"Url":"www.onprint.com","IsEmbeddedWebView":false,"IsAnonymousURL":false,"ContentType":"Text/html"}</Content>
</Action>
<Action LanguageCode="fr-FR" Priority="0" Order="1" Name="éléphant 1" Type="URL"> <Content>{"Url":"www.onprint.com","IsEmbeddedWebView":false,"IsAnonymousURL":false,"ContentType":"Text/html"}</Content>
</Action>
<Action LanguageCode="fr-FR" Priority="0" Order="2" Name="éléphant 2" Type="URL"> <Content>{"Url":"www.onprint.com","IsEmbeddedWebView":false,"IsAnonymousURL":false,"ContentType":"Text/html"}</Content>
</Action>
</Actions>
<Images>
<Image Name="Page 1" AutoTrigger="false">
<ActionStyle />
<TitleStyle />
<Titles>
<Title LanguageCode="en-US">All you ever wanted to know</Title><Title LanguageCode="fr-FR">Tout sur les éléphants</Title>
</Titles>
<Actions>
<Action LanguageCode="en-US" Priority="0" Order="1" Name="Action of page 1, nr 1" Type="URL">
<Content>{"Url":"www.onprint.com","IsEmbeddedWebView":false,"IsAnonymousURL":false,"ContentType":"Text/html"}</Content>
</Action>
<Action LanguageCode="en-US" Priority="0" Order="2" Name="Action of page 1, nr 2" Type="URL">
<Content>{"Url":"www.onprint.com","IsEmbeddedWebView":false,"IsAnonymousURL":false,"ContentType":"Text/html"}</Content>
</Action>
<Action LanguageCode="fr-FR" Priority="0" Order="1" Name="éléphant of page 1, nr 1" Type="URL">
<Content>{"Url":"www.onprint.com","IsEmbeddedWebView":false,"IsAnonymousURL":false,"ContentType":"Text/html"}</Content>
</Action>
<Action LanguageCode="fr-FR" Priority="0" Order="2" Name="éléphant of page 1, nr 2" Type="URL">
<Content>{"Url":"www.onprint.com","IsEmbeddedWebView":false,"IsAnonymousURL":false,"ContentType":"Text/html"}</Content>
</Action>
</Actions>
<Zones>
<Zone Height="20" Width="10" PositionX="1" PositionY="2" Name="Zone1" AutoTrigger="false">
<ActionStyle />
<TitleStyle />
<Titles>
<Title LanguageCode="fr-FR"></Title>
</Titles>
<Actions>
<Action LanguageCode="fr-FR" Priority="0" Order="1" Name="coucou zone1" Type="URL">
<Content>{"Url":"www.onprint.com","IsEmbeddedWebView":false,"IsAnonymousURL":false,"ContentType":"Text/html"}</Content>
</Action>
</Actions>
</Zone>
</Zones>
</Image>
</Images>
</Document>"
GET /services/Automation/Export
Export XML or Json object, as defined in the Import paragraph.
Gets the number of matches on a document (by Id or by image search), cumulated per day.
GET /services/Clickstream/GetMatchCumul
documentId (in url) : id of the document (Document)
Json MatchCumul object list.
Property | Type | Description |
---|---|---|
Timestamp | Datetime | Day corresponding to the measure cumul |
Count | Long | Number of matches |
Example:
[{
"Timestamp":"2016-03-09T00:00:00Z",
"Count":5
},
{
"Timestamp":"2016-03-10T00:00:00Z",
"Count":23
},
{
"Timestamp":"2016-03-11T00:00:00Z",
"Count":4
}]
Get an archive containing the detailed matches on a document and the match cumul, as an archive of two CSV files.
GET /services/Clickstream/Download
Json Clickstream object.
Property | Type | Description |
---|---|---|
DocumentId | Guid | |
CreationTime | DateTime | Date of archive creation (normally, request date) |
ArchiveUrl | String | Url to download the archive |
Example:
{
"DocumentId":"0b56dd2a-cc66-4be8-abdf-60adf88b082e",
"CreationTime":"2016-04-07T16:42:01.7976336+02:00",
"ArchiveUrl":"http://onprint-ci.cloudapp.net/Clickstream/20160407_mydoc.zip"
}
Gets the conflicts for a Document, Image or Zone.
GET /services/Conflict/Check
nodeId (in url) : id of the node (Node)
Json ConflictResult object list.
Property | Type | Description |
---|---|---|
Id | Guid | Image/Zone Id |
Conflicts | Object | Conflict object list |
Property | Type | Description |
---|---|---|
DocumentId | Guid | Document target id |
DocumentName | String | Document target name |
PageNumber | String | Page target number |
Distance | Double | Resemblance between 0 and 1 |
Path | Object | SearchPath object list |
Thumbnail | String | Thumbnail of the page target |
Example:
[
{
"Id": "00000000-0000-0000-0000-000000000000",
"Conflicts": [
{
"DocumentId": "00000000-0000-0000-0000-000000000000",
"DocumentName": " Essai Conflicts",
"PageNumber": "1",
"Distance": 0.009999999776482582,
"Path": [
{
"Id": "00000000-0000-0000-0000-000000000000",
"Type": "Image",
"Name": "Page 1"
},
{
"Id": "00000000-0000-0000-0000-000000000000",
"Type": "Document",
"Name": "Essai Conflicts"
},
{
"Id": "00000000-0000-0000-0000-000000000000",
"Type": "Organization",
"Name": "Demo"
}
],
"Thumbnail": "…/Files/Thumbs/0/0/0/00000000-0000-0000-0000-000000000000/00000000-0000-0000-0000-000000000000/700.jpg"
}
]
},
{
"Id": "00000000-0000-0000-0000-000000000000",
"Conflicts": []
}
]
Search organization, document, folder or user by his name (or a part) or his id.
GET /services/Search
SearchQuery (in body)
|Property|Type|Description| |--------|----|-----------| |Id|Guid|Organization/Document/Folder/User id| |Name|String|Organization/Document/Folder/User (part of) name|
Json SearchResult object list.
Property | Type | Description |
---|---|---|
Type | String | Document/Organization/Folder/User |
Result | Dynamic | Element information |
Path | Object | Path from your Organization to the Element |
[
{
"Type": "Document",
"Result": {
"Id": "00000000-0000-0000-0000-000000000000",
"ParentId": "00000000-0000-0000-0000-000000000000",
"DefaultLanguage": "nl-BE",
"Name": "Breaking Bad (Page 2)",
"ContentType": "image/jpeg",
"Pages": 1,
"ActionCount": 0,
"Status": "Inactive",
"DateCreated": "2016-08-18T06:21:45Z",
"DateModified": "2016-08-25T07:51:44Z",
"Links": {
"self": {
"HRef": "/documents/00000000-0000-0000-0000-000000000000",
"Method": "GET"
},
"samelevelnodes": {
"HRef": "/nodes/00000000-0000-0000-0000-000000000000/nodes/",
"Method": "GET"
},
"children": {
"HRef": "/nodes/00000000-0000-0000-0000-000000000000/nodes/",
"Method": "GET"
},
"list:node": {
"HRef": "/nodes/00000000-0000-0000-0000-000000000000/documents/",
"Method": "GET"
}
}
},
"Path": [
{
"Id": "00000000-0000-0000-0000-000000000000",
"Type": "Document",
"Name": "Essai Search"
},
{
"Id": "00000000-0000-0000-0000-000000000000",
"Type": "Organization",
"Name": "Demo"
}
]
}
]
Field Name | Type | Example |
---|---|---|
Address | String | petit.guillaume@onprint.com |
Subject | String | Demande de contact |
Content | String | Bonjour, j’aimerais avoir plus d’informations sur ce sujet. A bientôt. |
Address is a mandatory field.
{
"Address": "petit.guillaume@onprint.com",
"Subject": "Demande de contact ",
"Content": "Bonjour, j’aimerais avoir plus d’informations sur ce sujet.\n A bientôt."
}
Field Name | Type | Example |
---|---|---|
Latitude | Double | 43.81234123 |
Longitude | Double | -119.8374747 |
SearchAddress | String | 14 rue Violet, 75015 Paris |
There must be either a latitude and a longitude, or a search address.
{
"Latitude": 43.81234123,
"Longitude": -119.8374747,
"SearchAddress": "14 rue Violet, 75015 Paris"
}
Field Name | Type | Example |
---|---|---|
Number | String | +33651512648 |
{
"Number": "+33651512648"
}
Field Name | Type | Example |
---|---|---|
Url | String | http://www.onprint.com |
Content | String | Découvrez cette solution. |
{
"Url": "http://www.onprint.com",
"Content": "Découvrez cette solution."
}
Field Name | Type | Example |
---|---|---|
Number | String | +33651512648 |
Content | String | Coucou c’est moi ! |
{
"Number": "+33651512648",
"Content": "Coucou c’est moi !"
}
Field Name | Type | Example |
---|---|---|
Url | String | http://www.onprint.com |
IsEmbeddedWebView | Bool | True |
IsAnonymousURL | Bool | False |
ContentType | String | text/html |
Content type must be a MIME type.
{
"Url": "http://www.onprint.com",
"IsEmbeddedWebView": "true",
"IsAnonymousURL": "true",
“ContentType”:”text/html”
}
Onprint API Action Content accepts a Json input built as follows:
Field Name | Type | Example |
---|---|---|
FirstName | String | François |
LastName | String | Longevialle |
Organization | String | ONprint |
PhotoUrl | String (a URL to an image) | http://data.onprint.com/images/mona-lisa.jpg |
Telephones | Telephone[ ] | (see below) |
Addresses | Address[ ] | (see below) |
Emails | Email[ ] | (see below) |
Field Name | Type | Example |
---|---|---|
Type | Telephone Type (see below) | WORK |
Number | String (valid phone number) | 0601525468 |
Telephone Type can be one of this list: WORK, HOME, TEXT, VOICE, FAX, CELL, VIDEO, PAGER, TEXTPHONE
Field Name | Type | Example |
---|---|---|
Type | Address Type (see below) | WORK |
Street | String | 14 rue Violet |
City | String | PARIS |
ZipCode | String | 75015 |
Country | String | FRANCE |
Address Type can be one of this list: WORK, HOME
Field Name | Type | Example |
---|---|---|
Type | Email Type (see below) | WORK |
String (valid email) | flon@gmail.com |
Email type can be one of this list: WORK, HOME
This format is used for front-end VCard edition. It is not used by the mobile.
{
"FirstName": "François",
"LastName": "Longevialle",
"Organization": "ONprint",
"PhotoUrl": "http://www.letribunaldunet.fr/wp-content/uploads/2013/06/Ai-ou-paresseux-trois-doigts-17-.jpg",
"Telephones": [{
"Type": "Work",
"Number": "0601525468"}, {
"Type": "Home",
"Number": "0715451549"}],
"Addresses": [{
"Type": "Work",
"Street": "14 rue Violet",
"City": "Paris",
"ZipCode": "75015",
"Country": "FRANCE"}, {
"Type": "Home",
"Street": "45 rue home",
"City": "Paris",
"ZipCode": "75016",
"Country": "FRANCE"}],
"Emails": [{
"Type": "Home",
"Email": flon@flon.com}, {
"Type": "Work",
"Email": francois.longevialle@onprint.com}]
}
{
"VCard": "BEGIN:VCARD\r\n
VERSION:3.0\r\n
N:Longevialle;François;;; \r\n
FN:François Longevialle\r\n
ORG:ONprint\r\n
PHOTO:http://data.onprint.com/images/mona-lisa.jpg\r\n
TEL:TYPE=WORK,VOICE:0601525468\r\n
TEL:TYPE=HOME,VOICE:0715451549\r\n
ADR:TYPE=WORK:;;14 rue Violet;Paris;;75015;FRANCE\r\n
ADR:TYPE=HOME:;;45 rue home;Paris;;75016;FRANCE\r\n
EMAIL:TYPE=HOME,INTERNET:flon@flon.com\r\n
EMAIL:TYPE=WORK,INTERNET:francois.longevialle@onprint.com\r\n
REV:2016-02-04T15:44:49Z\r\n
END:VCARD\r\n"
}
Onprint API Action Content accepts a Json input built as follows:
Field Name | Type | Example |
---|---|---|
Start | UTC Date-Time (ISO 8601) | 2016-02-03T11:50:00Z |
End | UTC Date-Time (ISO 8601). Must be after Start time. | 2016-02-03T12:50:00Z |
OrganizerMail | String (valid email) | francois.longevialle@onprint.com |
AttendeeMail | String (valid email) | arthur.lagenebre@onprint.com |
Description | String | Un magnifique événement, pour en savoir plus: http://onprint.com |
Location | String | Onprint, 14 rue Violet, 75015 Paris |
Summary | String | Coder oh oui! |
RecurrenceRule | RecurrenceRule (see below) |
Field Name | Type | Example |
---|---|---|
Frequency | Frequency (see below) | WEEKLY |
Interval | Integer | 2 |
Frequency can be one of this list: SECONDLY, MINUTELY, HOURLY, DAILY, WEEKLY, MONTHLY, YEARLY
This format is used for front-end VCalendar edition. It is not used by the mobile.
{
"Start":"2016-02-03T11:50:00Z",
"End":"2016-02-04T06:00:00Z",
"OrganizerMail":"francois.longevialle@onprint.com",
"AttendeeMail":"arthur.lagenebre@onprint.com",
"Description":"Un magnifique événement, pour en savoir plus: http://onprint.com",
"Location":"Onprint, 14 rue Violet, 75015 Paris",
"Summary":"Coder oh oui!",
"RecurrenceRule":{
"Frequency":"WEEKLY",
"Interval":"2"}
}
{
"VCalendar": "BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//onprint//onprintplatformv2//fr
BEGIN:VEVENT
DTSTART:20160203T115000Z
DTEND:20160204T060000Z
RRULE:FREQ=WEEKLY;INTERVAL=2
ORGANIZER:mailto:francois.longevialle@onprint.com
ATTENDEE:mailto:arthur.lagenebre@onprint.com
DESCRIPTION:Un magnifique événement, pour en savoir plus: http://onprint.com
CREATED:20160203T163800Z
LAST-MODIFIED:20160203T163900Z
LOCATION:Onprint, 14 rue Violet, 75015 Paris
SUMMARY:Coder oh oui!
TRANSP:OPAQUE
END:VEVENT
END:VCALENDAR"
}