Get information and data for data objects, forms and files: GET /Objects


VERB Header Resource/Id/Selector Description Parameters Return data
GET Ticket /Objects/{Id}
Gets basic metadata for an object in the repository, such as a form or a file.
Id (string)
(VersionId (string))
Object:
Id (string)
ParentId (string)
Name (string)
Description (string)
ObjectClass (string)
Container (bool)
(ReadOnly (bool))
(TypeNamespace (string))
(TemplateId (string))
(FileType (string))
GET
Ticket
/Objects/{Id}/Objects
Lists available items in a container object (such as a folder)
Id (string)
(VersionId (string))
(Start (int))
(Max (int))
Totalcount (int)
Data (array):

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

If no items are available then an empty array is returned. 
GET
Ticket
Content-Type/Objects/{Id}/Properties
NEW
Lists all properties for an object, such as all filled-in fields for a form.

The timestamp indicates the last time the property value changed or when the property was created.

The index may change and is only used to indicate the order of fields for certain clients.
Id (string)
(VersionId (string))
Array of Property objects:
Name (string)
Value (string)
(KeyValue (string))
ReadOnly (bool)
TimeStamp (datetime)
Index (int)

If no properties are available then an empty array is returned. 
GET
Ticket
/Objects/{Id}/Fields
DEPRECATED

Replaced by /Objects/{Id}/Properties
Lists all fields in an object, such as all fields for a form.
Id (string)
(VersionId (string))
Array of Field objects:
Id (string)
Name (string)
Type (string)
Value (string)
Index (int)

If no fields are available then an empty array is returned.
GET
Ticket
/Objects/{Id}/PDF
Get the PDF rendition for an object, if available.
Id (string)
(VersionId (string))
Binary data:
Adobe PDF file
GET
Ticket
/Objects/{Id}/Image
Get the PNG Image rendition for an object, if available.
Id (string)
(VersionId (string))
Binary data:
PNG Image file

Create data objects, forms and files: POST /Objects


VERB
Header
Resource/Id/Selector
Description
Parameters
Return data
POST Ticket
Content-Type
/Objects/{Id}/Objects
NEW
Uploads one or many files to a container object, such as a folder.

Files are automatically uploaded to the {Id} object container 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
/Objects/{Id}/Objects
NEW
Creates a new object in a container.

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",
     name: "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 /Objects/{id}


VERB
Header
Resource/Id/Selector
Description
Parameters
Return data
POST
Ticket
Content-Type
/Objects/{Id}
NEW
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 /Objects/{id}


VERB
Header
Resource/Id/Selector
Description
Parameters
Return data
PUT Ticket
/Objects/{Id}
NEW
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.

Entry for updating a folder:

PUT /Objects/00a9e90c-17b8-413c-ba9a-b60d2600ad63


     name: "Bilagor" 
}


Entry for updating file metadata:

PUT /Objects/00a9e90c-17b8-413c-ba9a-b60d2600ad63

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

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

PUT /Objects/00a9e90c-17b8-413c-ba9a-b60d2600ad63/Objects/96329159-b124-4e72-a370-6ff5172e644d

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

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

PUT /Objects/00a9e90c-17b8-413c-ba9a-b60d2600ad63/Objects/96329159-b124-4e72-a370-6ff5172e644d

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

Id (string)
Object:
success (bool)

Update multiple objects: PUT /Objects/{id}/Objects


VERB
Header
Resource/Id/Selector
Description
Parameters
Return data
PUT Ticket
Content-Type
/Objects/{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.

[
{
     objectclass: "repository.typedobject",
     id: "d1543837-e2a5-4033-9ed0-d4934859e47f",
     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: DELETE /Objects/{id}


VERB
Header
Resource/Id/Selector
Description
Parameters
Return data
DELETE Ticket
/Objects/{Id}
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.

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