Fetch form, file, and folder information: GET /Objects
Get information about objects, such as forms, files, and folders.
TABLE OF CONTENTS
- Fetch form, file, and folder information: GET /Objects
- Create new forms, files, and folders: POST /Objects
- Update a data form using post: POST /Objects/{Id}
- Update objects using put: PUT /Objects/{Id}
- Update files: POST /Objects/{Id}
- Delete dataforms, files, and folders: DELETE /Objects/{Id}
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)) |
GET | Ticket | /Objects/{Id}/Fields | Lists all fields in an object, such as all fields for a form. Data is returned in pages. NOTE* Field types (Type) that can be returned are: checkbox datefield fileuploadfield htmleditor numberfield radio textarea textfield timefield select (single value drop-down box) multiselect (multi value drop-down box) | Id (string) VersionId (string) Start (int), default value = 0 Max (int), default value = 200 | Array of Field objects: Id (string) Name (string) DataType (string) FieldType (string) Value (string) FieldTypeNamespace (string) ReadOnly (bool) Index (int) |
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)) (Width (int)) (Height (int)) | Binary data: PNG Image file |
GET | Ticket | /Objects/{Id}/File | Get the file contents for an object, if available. | Id (string) (VersionId (string)) | Binary data: File |
NOTE*
Data from this end-point needs to be fetched in a special way.
/Objects/{Id}/Fields
- Returned Totaltcount is not correct
- Data can be stored on the next page even if received rows in Data are less than the page size.
How to use it
- Make sure to use parameters Start and Max with a page size (Max) of e.g. 200
- Make calls until the number of rows in Data section is 0.
Example
Call 1: /Objects/{Id}/Fields?start=0&max=200
The number of rows in Data-section might be 170. Make a new call with increased Start value.
Call 2: /Objects/{Id}/Fields?start=200&max=200
The number of rows in Data-section might be 20. Make a new call with increased Start value.
Call 3: /Objects/{Id}/Fields?start=400&max=200
The number of rows in Data-section might be 0. Now iteration can be stopped.
Create new forms, files, and folders: POST /Objects
Create new objects, such as new forms, a file, and a folder in an instance.
VERB | Header | Resource/Id/Selector | Description | Parameters | Return data |
POST | Ticket | Content-Type/Objects/{Id}/Objects | 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 | 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 { objectclass: "repository.folder", name: "My new folder" } Creating dataforms Set the templateid attribute in a dataform entry to create a dataform object. The correct templateid for each template can be fetched using the /templates API. 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 dataform object (red attributes are mandatory): { objectclass: "dataforms.dataform", name: "My form", templateid: "template1", fields: [ { name: "fieldId1", value: "value1" }, { name: "fieldId2", value: "value2"} ] } Entry for creating multiple objects: [ { objectclass: "dataforms.dataform", name: "My form", templateid: "template1", fields: [ { name: "fieldId1", value: "value1" }, { name: "fieldId2", value: "value2"} ] }, { objectclass: "dataforms.dataform", name: "My other form", templateid: "template2", fields: [ { name: "fieldId1", value: "value1" }, { name: "fieldId2", value: "value2"} ] } ] | Id (string) | Object: success (bool) Items (array) name(string), Id (string), ReferenceId (string) |
Update a data form using post: POST /Objects/{Id}
Update a form by posting fields and values as querystrings. This is the old way of updating a forms fields. Using PUT /Objects you can accomplish the same functionality and more.
VERB | Header | Resource/Id/Selector | Description | Parameters | Return data |
POST | Ticket | /Objects/{Id}/Fields | Updates fields in an object, such as fields for a form. POST data should look like: Field1=Value1&Field2=Value2&Field3=Value3 The HTTP Header “Content-Type” should be set to “application/x-www-form-urlencoded” Updating Type Fields Type fields all have a FieldTypenamespace which indicates that the field is a metadata field. A Type field also has the parameter FieldType with the value select or multiselect indicating that it can contain a single value or multiple values. To post a single value to a select field you post the TypeNamespaceId to the fieldId: FieldId1=TypeNamespaceId1 To post mutliple values to a multiselect field you post the comma separated TypeNamespaceIds to the fieldId: FieldId1=TypeNamespaceId1,TypeNamespaceId2 For information on how to get Types and their content see the method /Types | Id (string) | Object: success (bool) |
Update objects using put: PUT /Objects/{Id}
Update an existing object
VERB | Header | Resource/Id/Selector | Description | Parameters | Return data |
PUT | Ticket | /Objects/{Id} or /Objects/{Id}/Objects/{ReferenceId} | Updates an existing object by putting a new entry to an existing resource URL. It is currently not possible to update multiple objects at the same time. 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 /Objects/00a9e90c-17b8-413c-ba9a-b60d2600ad63/Objects/template1 to reach the "template1" template-based object or /Objects/00a9e90c-17b8-413c-ba9a-b60d2600ad63/Objects/Customer to reach the "Customer" pure data object within the /Objects/00a9e90c-17b8-413c-ba9a-b60d2600ad63 container. Entry for updating a folder: PUT /Objects/00a9e90c-17b8-413c-ba9a-b60d2600ad63 { name: "Attachment" } Entry for updating file metadata: PUT /Objects/00a9e90c-17b8-413c-ba9a-b60d2600ad63 { name: "MyFile.PDF", description: "My file attachment" } Entry for updating a dataform: The attributes readonly, name, and value are mandatory PUT /Objects/00a9e90c-17b8-413c-ba9a-b60d2600ad63/Objects/Customer { fields: [ { name: "Zip", value: "41117" } ] } | Id (string) | Object: success (bool) |
Update files: POST /Objects/{Id}
VERB | Header | Resource/Id/Selector | Description | Parameters | Return data |
POST | Ticket Content-Type | /Objects/{Id} or /Objects/{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) |
Delete dataforms, files, and folders: DELETE /Objects/{Id}
Delete dataforms or files or folders.
VERB | Header | Resource/Id/Selector | Description | Parameters | Return data |
DELETE | Ticket | /Objects/{Id} or /Objects/{Id}/Objects/{ReferenceId} | 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 /Objects/00a9e90c-17b8-413c-ba9a-b60d2600ad63/Objects/7B to delete the "7B" template-based object or /Objects/00a9e90c-17b8-413c-ba9a-b60d2600ad63/Objects/Kund to delete the "Kund" pure data object within the /Objects/00a9e90c-17b8-413c-ba9a-b60d2600ad63 container. Objects with the ReadOnly attribute set to true cannot be deleted. | Id (string) | Object: success (bool) |