Start new form case: POST /apps/form


VERB Header Resource/Id/Selector Description Parameters Return data
POST Ticket /apps/form Start a new form case by sending a HTTP POST to the application "Form" (/apps/form)

Note the section "Data format" which reglates how HTTP-POST calls are encoded.

Populate the form case with data and forms by placing a so called object entries in the Request Body according to example listed below. (For more information on this subject, view the API for Objects in Form Cases)

In the object entry below we create four objects in the form case, three pure data objects carrying data and one data object which is connected to the form 7B. Only data objects with the property templateid is shown in the interface, the rest are only used to store data. The form 7B which has fields from all data objects, in this case uses all data from all data objects automatically.

This makes it possible to pre-populate a form case with information regarding customer, land lord, property object etc. and let this information be shared by all forms in the form case.

NOTE! Within a form case no duplicate objects may be created. This means that each object may only exist once. For example, a customer object, a land lord object and an object for each form respectively. Also, a form of type "Huvudkontrakt" may only exist once in each form case.

[
{
     objectclass: "repository.typedobject",
     typenamespace: "Hyresvard",
     readonly: true,
     properties:
     [
        { name: "Namn", value: "Barium Bostäder AB" },
        { name: "Adress", value: "Västra Hamngatan 24-26" },
        { name: "OrgPersNr", value: "550101-0101" },
        { name: "Telefon", value: "031-7454700" }
     ]
},
{
     objectclass: "repository.typedobject",
     typenamespace: "Kund",
     properties:
     [
        { name: "Namn", value: "Kalle Kula", readonly: true },
        { name: "OrgPersNr", value: "710101-1234", readonly: true },
        { name: "Telefon", value: "010-1233456" },
        { name: "Adress", value: "Storgatan 1, 11111 Storstaden" }
     ]
},
{
     objectclass: "repository.typedobject",
     typenamespace: "HyresObjekt",
     properties:
     [
        { name: "Nr", value: "12" },
        { name: "Typ", value: "Kontor" },
        { name: "Kommun", value: "Göteborgs kommun" },
        { name: "Ort", value: "Göteborg" },
        { name: "Gata", value: "Magasinsgatan 1" },
        { name: "Fastighetsbeteckning", value: "Inom vallgraven 1:123" },
        { name: "Aviseringsadress", value: "41116 Göteborg" },
        { name: "Trappor", value: "5" }
     ]
},
{
     objectclass: "repository.typedobject",
     templateid: "7B"
}
Object entry/entries in Json format in the Request Body Success object with a reference to the created instance if "success":true.


Copy form case: POST /apps/form?copyinstanceid={instanceid}


VERB Header Resource/Id/Selector Description Parameters Return data
POST Ticket /apps/form Copy an existing form case by sending an HTTP POST to the application "Form" (/apps/form) with the query string parameter copyinstanceid set to instance-id for the form case to be copied.

When a form case is copied, the objects contained in the original form case is copied to a new form case. (a copy) The new form case (the copy) gets the same access permissions as the original form case. The one who copies a form case will be set as the creator of the new form case (the copy).
copyinstanceid (string) Success object with a reference to the created instance if "success":true.


Get information about form case: GET /Instances


VERB Header Resource/Id/Selector Description Parameters Return data
GET Ticket  /instances  List available process instances. Filter active and completed instances by Status [‘completed’, ‘active’]

Filter on the user who started the instance by UserId={userid}

The currently authenticated user can be found using the /Account/Current API
(Status (string))
(Start (int))
(Max (int))
Totalcount (int)
Data (array):

Id (string)
Name (string)
Description (string)
Status (string)
(Milestone (string))
StartDate (date)
StartedBy (string)
StartedByUserId (string)
CompletedDate (date)
ApplicationName (string)

On error:
Error info in current format. If no instances are available then an empty array is returned.
GET Ticket  /Instances/{Id} Get metadata for a process instance Id (string) Object:
Id (string)
Name (string)
Description (string)
Status (string)
(Milestone (string))
StartDate (date)
StartedBy (string)
StartedByUserId (string)
CompletedDate (date)
Priority (string)
PlannedDate (date)
DeadlineDate (date)
ApplicationId (string)
ApplicationName (string)
ParentInstanceName (string)
ParentInstanceId (string)
GET Ticket  /Instances/{Id}/Objects Lists available objects in an instance, such as typed objects, files and folders.

It is also possible to serialize all objects directly using the querystring parameter serialize=true. This can be used by integrators to download all instance data in an instance for storage in their own system.


Please note that binary data is not included when serializing instance objects but must be fetched separately with the API call GET /Objects/{id}/File

Return data example when serializing objects (not all fields are included in the example):

[
{
     objectclass: "repository.typedobject",
     id: "705f2889-cb9f-4e0a-a476-85983606dc24",
     ReferenceId: "Hyresvard",
     TypeNamespace: "Hyresvard",
     TemplateId: null,
     ReadOnly: False,
     State: null,
     properties:
     [
        { name: "Namn", value: "Kalle Kula", readonly: true },
        { name: "OrgPersNr", value: "710101-1234", readonly: true },
        { name: "Telefon", value: "010-1233456" },
        { name: "Adress", value: "Storgatan 1, 11111 Storstaden" }
     ]
},
{
     objectclass: "repository.file",
     id: "705f2889-cb9f-4e0a-a476-85983606dc24",
     name: "Lägenhetsritning V2.PDF",
     description: "Ritning över lägenheten"
}
Id (string)
(Start (int))
(Max (int))
(serialize(bool))
Totalcount (int)
Data (array):

Id (string)
Name (string)
Description (string)
ObjectClass (string)
Container (bool)
(FileType (string))

If no objects are available then an empty array is returned.
GET Ticket  /Instances/{Id}/Objects/{ObjectId} Gets metadata for an object in an instance, such as a typed object, a file or a folder.

The /Objects API should be used for most operations on objects in instances.
Id (string)
ObjectId (string)
(VersionId (string))
Object:
Id (string)
Name (string)
Description (string)
ObjectClass (string)
Container (bool)
(FileType (string))
GET Ticket /Instances/{Id}/PDF Get the PDF rendition for a process instance (of the data in the instance) if available.

Use duplex=true to prepare the PDF for duplex printing (blank pages are inserted after each object that has an odd number of pages except the last one)
Id (string)
(duplex (bool))
Binary data:
Adobe PDF file

On error:
HTTP error 


Delete form case: DELETE /Instances/{Id}


VERB Header Resource/Id/Selector Description Parameters Return data
DELETE  Ticket /Instances/{Id}
NEW
Deletes an existing instance by sending a HTTP DELETE to an existing resource URL. It is currently not possible to delete multiple instances at the same time.

Warning! If an instance is deleted all objects within the instance will also be deleted, such as typed objects, files and folders.
Id (string) Object:
success (bool)


Create data object, forms and files: POST /Instances/{Id}/Objects


VERB Header Resource/Id/Selector Description Parameters Return data
 POST Ticket Content-Type  /Instances/{Id}/Objects Uploads one or many files to an instance folder.

Files are automatically uploaded to the instance folder if the
client sends a HTTP POST with the Content-Type header of
the request set to multipart/form-data according to RFC1867 (http://www.faqs.org/rfcs/rfc1867.html).

The generated Id for each uploaded file is returned in the items array of the HTTP response.

Empty files cannot be uploaded.
Id (string) Object:
success (bool)
Items (array)
FileName (string),
Id (string),
ReferenceId (string)
POST Ticket /Instances/{Id}/Objects Creates a new object in an instance folder.

Clients create new objects by sending HTTP POST requests to the container URL, with the object entry in the request body.

Creating folders
Folders are currently not shown in the web user interface.

{
     objectclass: "repository.folder",
     name: "My new folder"
}

Creating typed objects
Typed objects can either be pure data objects (used to stored data only) or be template-based (for the purpose of both storing and presenting data). Set the templateid attribute in a typed object entry to create a template-based object or set the typenamespace attribute to create a pure data object (one of the two parameters is required). The correct templateid and typenamespace attributes for each template and type can be fetched using the /templates and /types API methods. Set the readonly attribute (default is false) to prevent any editing of the object or attribute.

It's possible to create single or multiple objects within one HTTP POST request as per below. The examples below describes all possible attributes and whether they are mandatory or not.

Entry for creating a single template-based object (red attributes are mandatory):

{
     objectclass: "repository.typedobject",
     typenamespace: "Fastighetsskatteklausul",
     templateid: "7B",
     readonly: false,
     properties:
     [
        { name: "Andel", value: true, readonly: false},
        { name: "AndelProcent", value: "50%", readonly: false },
        { name: "AndelBelopp", value: 50000, readonly: true }
     ]
}

Entry for creating a single pure data object (red attributes are mandatory):

{
     objectclass: "repository.typedobject",
     typenamespace: "Hyresvard",
     readonly: false,
     properties:
     [
        { name: "Namn", value: "Barium Bostäder AB", readonly: false},
        { name: "Adress", value: "Västra Hamngatan 24-26", readonly: false },
        { name: "OrgPersNr", value: "550101-0101", readonly: true },
        { name: "Telefon", value: "031-7454700", readonly: true }
     ]
}

Entry for creating multiple data objects (both data and template-based objects).
The template object "7B" in this example will automatically use the data objects "Hyresvard", "Kund" and "Hyresobjekt" to populate it's fields and if more template objects are added to the instance later on they will also be populated with the same (shared) set of data.

[
{
     objectclass: "repository.typedobject",
     typenamespace: "Hyresvard",
     readonly: true,
     properties:
     [
        { name: "Namn", value: "Barium Bostäder AB" },
        { name: "Adress", value: "Västra Hamngatan 24-26" },
        { name: "OrgPersNr", value: "550101-0101" },
        { name: "Telefon", value: "031-7454700" }
     ]
},
{
     objectclass: "repository.typedobject",
     typenamespace: "Kund",
     properties:
     [
        { name: "Namn", value: "Kalle Kula", readonly: true },
        { name: "OrgPersNr", value: "710101-1234", readonly: true },
        { name: "Telefon", value: "010-1233456" },
        { name: "Adress", value: "Storgatan 1, 11111 Storstaden" }
     ]
},
{
     objectclass: "repository.typedobject",
     typenamespace: "HyresObjekt",
     properties:
     [
        { name: "Nr", value: "12" },
        { name: "Typ", value: "Kontor" },
        { name: "Kommun", value: "Göteborgs kommun" },
        { name: "Ort", value: "Göteborg" },
        { name: "Gata", value: "Magasinsgatan 1" },
        { name: "Fastighetsbeteckning", value: "Inom vallgraven 1:123" },
        { name: "Aviseringsadress", value: "41116 Göteborg" },
        { name: "Trappor", value: "5" }
     ]
},
{
     objectclass: "repository.typedobject",
     templateid: "7B"
}

Id (string) Object:
success (bool)
Items (array)
name(string),
Id (string),
ReferenceId (string)


Update files: POST /Instances/{Id}/Objects/{ObjectId}


VERB Header Resource/Id/Selector Description Parameters Return data
POST Ticket Content-Type /Instances/{Id}/Objects/{ObjectId}
or
/Instances/{Id}/Objects/{ReferenceId}
Updates an existing file object by uploading a new file to an existing resource URL.

Files are automatically uploaded if the client sends a HTTP POST with the Content-Type header of the request set to multipart/form-data according to RFC1867 (http://www.faqs.org/rfcs/rfc1867.html).

Empty files cannot be uploaded.
Id (string) Object: success (bool)


Update data objects and forms: PUT /Instances/{Id}/Objects/{ObjectId}


VERB Header Resource/Id/Selector Description Parameters Return data
PUT Ticket /Instances/{Id}/Objects/{ObjectId}
or
/Instances/{Id}/Objects/{ReferenceId}
Updates an existing object by putting a new entry to an existing resource URL. The objectclass, typenamespace and templateid attributes cannot be changed when updating objects. Use the URL variant with ReferenceId to reach an object within an object container with a reference id, such as /Instances/{Id}/Objects/7B to reach the "7B" template-based object or /Instances/00a9e90c-17b8-413c-ba9a-b60d2600ad63/Objects/Kund to reach the "Kund" pure data object within the /Instances/00a9e90c-17b8-413c-ba9a-b60d2600ad63 instance folder.

Entry for updating a folder:

PUT /Instances/{Id}/Objects/{ObjectId}
{
     name: "Bilagor"
}

Entry for updating file metadata:

PUT /Instances/{Id}/Objects/{ObjectId}

{
     name: "Lägenhetsritning V2.PDF",
     description: "Ritning över lägenheten"
}

Entry for updating a single template-based object (red attributes are mandatory):

PUT /Instances/{Id}/Objects/{ReferenceId}

{
     name: "Fastighetsskatteklausul",
     readonly: false,
     properties:
     [
        { name: "AndelBelopp", value: 75000, readonly: true }
     ]
}

Entry for updating a single pure data object (red attributes are mandatory):

PUT /Instances/{Id}/Objects/{ReferenceId}

{
     properties:
     [
        { name: "Telefon", value: "031-7454700", readonly: false }
     ]
}

Id (string) Object:
success (bool)


Update multiple objects in instance: PUT /Instances/{Id}/Objects


VERB Header Resource/Id/Selector Description Parameters Return data
PUT Ticket Content-Type /Instances/{Id}/Objects
NEW
Updates multiple existing object by putting object entries to an existing resource collection URL.

Entry for updating multiple data objects (both data and template-based objects).
Note that id must be set on each object before the PUT call. The id can also contain a reference id.
[
{
     objectclass: "repository.typedobject",
     id: "Hyresvard",
     properties:
     [
        { name: "Namn", value: "Barium Bostäder AB" },
        { name: "Adress", value: "Västra Hamngatan 24-26" },
        { name: "OrgPersNr", value: "550101-0101" },
        { name: "Telefon", value: "031-7454700" }
     ]
},
{
     objectclass: "repository.typedobject",
     id: "705f2889-cb9f-4e0a-a476-85983606dc24",
     properties:
     [
        { name: "Namn", value: "Kalle Kula", readonly: true },
        { name: "OrgPersNr", value: "710101-1234", readonly: true},
        { name: "Telefon", value: "010-1233456" },
        { name: "Adress", value: "Storgatan 1, 11111 Storstaden" }
     ]
}
Id (string) Object:
success (bool)
Items (array)
name(string),
Id (string),
ReferenceId (string)


Delete data objects, forms and files in form case: DELETE /Instances/{Id}/Objects/{ObjectId}


VERB Header Resource/Id/Selector Description Parameters Return data
DELETE Ticket /Instances/{Id}/Objects/{ObjectId}
or
/Instances/{Id}/Objects/{ReferenceId}
NEW
Deletes an existing object by sending a HTTP DELETE to an existing resource URL. It is currently not possible to delete multiple objects at the same time.

Use the URL variant with ReferenceId to delete an object within an object container with a reference id, such as /Instances/00a9e90c-17b8-413c-ba9a-b60d2600ad63/Objects/7B to delete the "7B" template-based object or /Instances/00a9e90c-17b8-413c-ba9a-b60d2600ad63/Objects/Kund to delete the "Kund" pure data object within the /Instances/00a9e90c-17b8-413c-ba9a-b60d2600ad63 instance folder.

Objects with the ReadOnly attribute set to true cannot be deleted.
Id (string) Object: success (bool)


List work tasks in form case and change status of form case:


VERB Header Resource/Id/Selector Description Parameters Return data
GET Ticket  /Instances/{Id}/Tasks/ Lists available tasks in an instance. Filter active and completed tasks by Status ['ready', 'completed'] Id (string)
(Status (string))
(Start (int))
(Max (int))
Totalcount (int)
Data (array):

Id (string)
ReferenceId (string)
Name (string)
Description (string)
Status (string)
CreatedDate (date)
CompletedDate (date)
CompletedBy (string)
InstanceName (string)
ApplicationName (string)
Locked (bool)LockedBy (string)Participants (string)
GET Ticket  /Instances/{Id}/Tasks/{TaskId} Gets information for a task in an instance. The TaskId can also be a Task ReferenceId. Id (string)
TaskId (string)
(TaskReferenceId (string))
Object:
Id (string)
ReferenceId (string)
Name (string)
Description (string)
Status (string)
CreatedDate (date)
CompletedDate (date)
CompletedBy (string)
CompletedByUserId (string)
InstanceName (string)
InstanceId (string)
ApplicationName (string)
ApplicationId (string)
ProcessId (string)
Locked (bool)
LockedBy (string)PerformPermission (bool)
GET Ticket  /Instances/{Id}/Tasks/{TaskId}/Actions Lists available actions on a task. The TaskId can also be a Task ReferenceId. Id (string)
TaskId (string)
Totalcount (int)
Data (array):

Id (string)
Name (string)
Description (string)
CanComment (bool)
MustComment (bool)
POST Ticket /Instances/{Id}/Tasks/{TaskId}/Actions/{ActionId} Performs an action on a task and change status on a process instance.

The Success return value will return True if the task was performed successfully. If a subsequent task OR instance was created as a result of the task their respective Ids are returned.

If the success return value returns False then the task couldn't be completed and the errorMessage property will contain an error text that can be displayed to end users.
Id (string)
ActionId (string)
(Comment (string))
Object:
Success (bool)
(errorMessage (string))
(InstanceId (string))
(TaskId (string))