V3 frevvo API

From Frevvodocs

Jump to: navigation, search

frevvo Live Forms™ v3

Contents

Overview

The frevvo Data API provides a simple protocol for viewing and managing frevvo resources such as forms, applications, themes, schemas, etc. It uses the Atom Syndication format with a few extensions following Atom's standard extension model.

Background

Atom also provides the Atom Publishing Protocol (APP), an HTTP-based application protocol for publishing and editing resources on the web. The APP specification is an emerging standard being developed by the IETF that allows you to send an HTTP GET request to ask for a particular resource such as a form or schema; a representation of that resource is returned in the Atom Syndication format. You can also create, edit and delete resources using standard HTTP POST, PUT and DELETE methods, respectively. Atom provides a protocol in line with the REST approach to web service interfaces.

Reference Guide

This section describes the basic protocol used to interact with frevvo Data APIs including examples of what Atom requests may look like, what kind of responses to expect, and so on. It is intended for anyone wanting an understanding the general idea of the format and protocol used by the frevvo Data API and it assumes that you understand the basics of XML, namespaces, Atom feeds, and the main HTTP requests GET, POST, PUT and DELETE, as well as the RESTful concept of a resource. Using the API at this level your client application can interact with the frevvo Server using any programming language that lets you issue HTTP requests and consume XML-based responses.

There are various different types of frevvo resources that can be viewed and manipulated by the Data API. Most of these resources are things that a designer sees when creating new forms and navigating the application using the frevvo UI, for instance users, applications, form, themes, schemas, etc. So before delving into the API specifics it is a good idea to understand these different types of resources and how they relate to each other. The following diagram shows these different resources currently being exposed by the Data API and the ownership relationships among them:

Image:Frevvo_Resources.png

Basically, for each resource type in frevvo (User, Application, FormType, Theme, Schema) a Atom Feed representation is provided. The following table shows the different URI to access the different resource feeds:

frevvo Data API URIs
Resource Description Resource URI
Users Feed frevvo/web/api/users
User Entry frevvo/web/api/user/{id}
Application Feed frevvo/web/api/apps?ownerId={userId}
Application Entry frevvo/web/api/app/{id}
Themes Feed frevvo/web/api/themes?ownerId={userId}
Theme Entry frevvo/web/api/theme/{id}
FormTypes Feed frevvo/web/api/formtypes?ownerId={appId}
FormType Entry frevvo/web/api/formtype/{id}
Schemas Feed frevvo/web/api/schemas?ownerId={appId}
Schema Entry frevvo/web/api/schema/{id}
  • Note that the ownerId query parameter is optional when querying any feed but required when inserting a new entry into the feed (more details on this below)


User Feed

The user feed represents each user that is visible to the currently logged in user. For all non-administrator users, this feed will always show one user: the current user; for the administrator users it will show all the users in frevvo allowing them to manage user settings.

Getting the User Feed

In order to get a list of all visible users, send the following request to the frevvo Server:

GET /frevvo/web/api/users

The server will respond with:

200 OK

<feed xmlns="http://www.w3.org/2005/Atom" xml:base="http://localhost:8082">
   <title>Users</title>
   <updated>2009-05-12T11:38:22.333-04:00</updated>
   <link rel="self" type="application/atom+xml" href="/frevvo/web/api/users"/>
   <entry xmlns:fd="http://schemas.frevvo.com/fdata/2008">
      <id>johndoe</id>
      <title type="text">johndoe</title>
      <updated>2009-05-12T11:38:22.333-04:00</updated>
      <link type="application/atom+xml" href="/frevvo/web/api/user/johndoe"/>
      <link rel="self" type="application/atom+xml" href="/frevvo/web/api/user/johndoe"/>
      <link rel="edit" type="application/atom+xml" href="/frevvo/web/api/user/johndoe"/>
      <link rel="apps" type="application/atom+xml" href="/frevvo/web/api/apps?ownerId=johndoe" title="johndoe's Applications"/>
      <link rel="themes" type="application/atom+xml" href="/frevvo/web/api/themes?ownerId=johndoe" title="johndoe's Themes"/>
   </entry>
</feed>

Note that since the current logged in user is johndoe the feed contains only his entry. If the currenty logged in user was the administrator then a full list of all users would be returned by the server. Also note that for this release user feeds are read-only, and so new users cannot be created using the Data API.

Getting a User Entry

It is also possible to directly get a specific User entry as long as you know the id for that user. In order to do that send the following request to the server:

GET /frevvo/web/api/user/johndoe

And the server will respond with:

200 OK

<entry xmlns="http://www.w3.org/2005/Atom"
       xmlns:fd="http://schemas.frevvo.com/fdata/2008"
       xml:base="http://localhost:8082">
   <id>johndoe</id>
   <title type="text">johndoe</title>
   <updated>2009-05-12T11:39:55.877-04:00</updated>
   <link type="application/atom+xml" href="/frevvo/web/api/user/johndoe"/>
   <link rel="self" type="application/atom+xml" href="/frevvo/web/api/user/johndoe"/>
   <link rel="edit" type="application/atom+xml" href="/frevvo/web/api/user/johndoe"/>
   <link rel="apps" type="application/atom+xml" href="/frevvo/web/api/apps?ownerId=johndoe" title="johndoe's Applications"/>
   <link rel="themes" type="application/atom+xml" href="/frevvo/web/api/themes?ownerId=johndoe" title="johndoe's Themes"/>
</entry>

Since at this point User entries are also read-only for this release, they can only be used to traverse to related feeds such as the users application and theme feeds (see the two link elements with a rel attribute with value apps and themes, respectively, in the entry above)

Inserting a new User Entry

Inserting (creating) new users using the Data API is not supported at this time.

Updating a User Entry

Updating the user profile using the Data API is not supported at this point.

Deleting a User Entry

Deleting a user using the Data API is not supported at this point.

Theme Feed

The theme feed lists all themes visible to the currently logged-in user. This includes enabled themes that were uploaded by the current user and all enabled themes that are global, i.e. owned by the admin user.

Getting the Theme Feed

In order to get a list of all themes, send the following request to the frevvo server:

GET /frevvo/web/api/themes

The server will respond with:

200 OK

<feed xmlns="http://www.w3.org/2005/Atom" xml:base="http://localhost:8082">
   <title>Themes</title>
   <updated>2009-05-12T11:42:51.834-04:00</updated>
   <link rel="self" type="application/atom+xml" href="/frevvo/web/api/themes"/>
   <entry xmlns:fd="http://schemas.frevvo.com/fdata/2008">
      <id>_Q6pJIagiEdyrUJr3HP_61Q!frevvo</id>
      <title type="text">Clear</title>
      <updated>2009-05-12T11:42:51.834-04:00</updated>
      <link type="application/atom+xml" href="/frevvo/web/api/theme/_Q6pJIagiEdyrUJr3HP_61Q!frevvo"/>
      <link rel="self" type="application/atom+xml" href="/frevvo/web/api/theme/_Q6pJIagiEdyrUJr3HP_61Q!frevvo"/>
      <link rel="edit" type="application/atom+xml" href="/frevvo/web/api/theme/_Q6pJIagiEdyrUJr3HP_61Q!frevvo"/>
      <fd:owner id="frevvo"/>
   </entry>
   <entry xmlns:fd="http://schemas.frevvo.com/fdata/2008">
      <id>_w218Ecm4EdyRdaUav2cgrg!frevvo</id>
      <title type="text">Professional Blue</title>
      <updated>2009-05-12T11:42:51.834-04:00</updated>
      <link type="application/atom+xml" href="/frevvo/web/api/theme/_w218Ecm4EdyRdaUav2cgrg!frevvo"/>
      <link rel="self" type="application/atom+xml" href="/frevvo/web/api/theme/_w218Ecm4EdyRdaUav2cgrg!frevvo"/>
      <link rel="edit" type="application/atom+xml" href="/frevvo/web/api/theme/_w218Ecm4EdyRdaUav2cgrg!frevvo"/>
      <fd:owner id="frevvo"/>
   </entry>
</feed>

The returned feed above shows two theme entries named Clear and Blue Professional that happen to be the two global themes provided by default by the frevvo installation.

Getting a Theme Entry

It is also possible to directly get a specific Theme entry as long as you know the theme id. In order to do that send the following request to the server:

GET /frevvo/web/api/theme/_w218Ecm4EdyRdaUav2cgrg!frevvo

And the server will respond with:

200 OK

<entry xmlns="http://www.w3.org/2005/Atom"
       xmlns:fd="http://schemas.frevvo.com/fdata/2008"
       xml:base="http://localhost:8082">
   <id>_Q6pJIagiEdyrUJr3HP_61Q!frevvo</id>
   <title type="text">Clear</title>
   <updated>2009-05-12T11:44:39.371-04:00</updated>
   <link type="application/atom+xml" href="/frevvo/web/api/theme/_Q6pJIagiEdyrUJr3HP_61Q!frevvo"/>
   <link rel="self" type="application/atom+xml" href="/frevvo/web/api/theme/_Q6pJIagiEdyrUJr3HP_61Q!frevvo"/>
   <link rel="edit" type="application/atom+xml" href="/frevvo/web/api/theme/_Q6pJIagiEdyrUJr3HP_61Q!frevvo"/>
   <fd:owner id="frevvo"/>
</entry>

Note that for this release it is not possible to download the theme using the Data API: support for that will be added in a subsequent release.

Inserting a new Theme Entry

Inserting a new theme using the Data API is not supported at this point.

Updating a Theme Entry

Updating a theme is not supported at this point.

Deleting a Theme Entry

Deleting a theme can be done by sending an HTTP DELETE request to the theme entry url.

DELETE /frevvo/web/api/theme/_w218Ecm4EdyRdaUav2cgrg!frevvo

And the server will respond with:

200 OK

Applications Feed

The application feed lists all applications owned by the currently logged-in user.

Getting the Application Feed

In order to get a list of all applications, send the following request to the frevvo server:

GET /frevvo/web/api/apps

The server will respond with:

200 OK

<feed xmlns="http://www.w3.org/2005/Atom" xml:base="http://localhost:8082">
   <title>Applications</title>
   <updated>2009-05-12T11:55:56.984-04:00</updated>
   <link rel="self" type="application/atom+xml" href="/frevvo/web/api/apps"/>
   <link rel="post" type="application/atom+xml" href="/frevvo/web/api/apps?ownerId=johndoe"/>
   <link rel="post-media" type="application/zip" href="/frevvo/web/api/apps?ownerId=johndoe"/>
   <entry xmlns:fd="http://schemas.frevvo.com/fdata/2008">
      <id>_nv8uAT8KEd6yc_ZDP21S1Q!johndoe</id>
      <title type="text">Expense Reports</title>
      <summary type="text"/>
      <updated>2009-05-12T11:55:56.984-04:00</updated>
      <link type="application/atom+xml" href="/frevvo/web/api/app/_nv8uAT8KEd6yc_ZDP21S1Q!johndoe"/>
      <link rel="self" type="application/atom+xml" href="/frevvo/web/api/app/_nv8uAT8KEd6yc_ZDP21S1Q!johndoe"/>
      <link rel="edit" type="application/atom+xml" href="/frevvo/web/api/app/_nv8uAT8KEd6yc_ZDP21S1Q!johndoe"/>
      <link rel="formtypes" type="application/atom+xml" href="/frevvo/web/api/formtypes?ownerId=_nv8uAT8KEd6yc_ZDP21S1Q!johndoe" title="Expense Reports's Form Types"/>
      <link rel="schemas" type="application/atom+xml"href="/frevvo/web/api/schemas?ownerId=_nv8uAT8KEd6yc_ZDP21S1Q!johndoe" title="Expense Reports's Schemas"/>
      <link rel="forms" type="application/atom+xml" href="/frevvo/web/api/forms?ownerId=_nv8uAT8KEd6yc_ZDP21S1Q!johndoe"/>
      <fd:owner id="johndoe"/>
      <content type="application/zip" src="/frevvo/web/user/johndoe/app/_nv8uAT8KEd6yc_ZDP21S1Q/file/content.zip"/>
   </entry>
</feed>

The returned feed above shows one application entry named "Expense Reports" owned by the current user 'johndoe'.

Getting an Application Entry

It is also possible to directly get a specific application entry as long as you know the application id. In order to do that send the following request to the server:

GET /frevvo/web/api/app/___U40ULzEd2aiOHUWaF_bw!johndoe

And the server will respond with:

200 OK

<entry xmlns="http://www.w3.org/2005/Atom"
       xmlns:fd="http://schemas.frevvo.com/fdata/2008"
       xml:base="http://localhost:8081">
   <id>_nv8uAT8KEd6yc_ZDP21S1Q!johndoe</id>
   <title type="text">Expense Reports</title>
   <summary type="text"/>
   <updated>2009-05-12T12:13:44.471-04:00</updated>
   <link type="application/atom+xml" href="/frevvo/web/api/app/_nv8uAT8KEd6yc_ZDP21S1Q!johndoe"/>
   <link rel="self" type="application/atom+xml" href="/frevvo/web/api/app/_nv8uAT8KEd6yc_ZDP21S1Q!johndoe"/>
   <link rel="edit" type="application/atom+xml" href="/frevvo/web/api/app/_nv8uAT8KEd6yc_ZDP21S1Q!johndoe"/>
   <link rel="formtypes" type="application/atom+xml" href="/frevvo/web/api/formtypes?ownerId=_nv8uAT8KEd6yc_ZDP21S1Q!johndoe" title="Expense Reports's Form Types"/>
   <link rel="schemas" type="application/atom+xml" href="/frevvo/web/api/schemas?ownerId=_nv8uAT8KEd6yc_ZDP21S1Q!johndoe" title="Expense Reports's Schemas"/>
   <link rel="forms" type="application/atom+xml" href="/frevvo/web/api/forms?ownerId=_nv8uAT8KEd6yc_ZDP21S1Q!johndoe"/>
   <fd:owner id="johndoe"/>
   <content type="application/zip" src="/frevvo/web/user/johndoe/app/_nv8uAT8KEd6yc_ZDP21S1Q/file/content.zip"/>
</entry>

Inserting a new Application Entry

POST /frevvo/web/api/apps

<entry xmlns="http://www.w3.org/2005/Atom">
   <id>_nv8uAT8KEd6yc_ZDP21S1Q!johndoe</id>
   <title type="text">Expense Reports</title>
   <summary type="text"/>
</entry>

And the server will respond with:

200 OK

<entry xmlns="http://www.w3.org/2005/Atom"
       xmlns:fd="http://schemas.frevvo.com/fdata/2008"
       xml:base="http://localhost:8082">
   <id>_nv8uAT8KEd6yc_ZDP21S1Q!johndoe</id>
   <title type="text">Expense Reports</title>
   <summary type="text"/>
   <updated>2009-05-12T12:13:44.471-04:00</updated>
   <link type="application/atom+xml" href="/frevvo/web/api/app/_nv8uAT8KEd6yc_ZDP21S1Q!johndoe"/>
   <link rel="self" type="application/atom+xml" href="/frevvo/web/api/app/_nv8uAT8KEd6yc_ZDP21S1Q!johndoe"/>
   <link rel="edit" type="application/atom+xml" href="/frevvo/web/api/app/_nv8uAT8KEd6yc_ZDP21S1Q!johndoe"/>
   <link rel="formtypes" type="application/atom+xml" href="/frevvo/web/api/formtypes?ownerId=_nv8uAT8KEd6yc_ZDP21S1Q!johndoe" title="Expense Reports's Form Types"/>
   <link rel="schemas" type="application/atom+xml" href="/frevvo/web/api/schemas?ownerId=_nv8uAT8KEd6yc_ZDP21S1Q!johndoe" title="Expense Reports's Schemas"/>
   <link rel="forms" type="application/atom+xml" href="/frevvo/web/api/forms?ownerId=_nv8uAT8KEd6yc_ZDP21S1Q!johndoe"/>
   <fd:owner id="johndoe"/>
   <content type="application/zip" src="/frevvo/web/user/johndoe/app/_nv8uAT8KEd6yc_ZDP21S1Q/file/content.zip"/>
</entry>

Updating an Application Entry

Updating application properties using the Data API is not supported at this point in time.

Deleting an Application Entry

Deleting an application can be done by sending an HTTP DELETE request to the application entry url.

DELETE http://localhost:8082/frevvo/web/api/app/_nv8uAT8KEd6yc_ZDP21S1Q!johndoe

And the server will respond with:

200 OK

FormType Feed

The formtype feed contains a list of all forms across all applications owned by the currently logged-in user.

Getting the FormType Feed

In order to get a list of all forms owned by the current user, send the following request to the frevvo server:

GET /frevvo/web/api/formtypes

The server will respond with:

200 OK

<pre>
<feed xmlns="http://www.w3.org/2005/Atom" xml:base="http://localhost:8082"
      xml:lang="en">
   <title>Form Types</title>
   <updated>2009-05-12T12:20:19.986-04:00</updated>
   <link rel="self" type="application/atom+xml" href="/frevvo/web/api/formtypes"/>
   <entry xmlns:fd="http://schemas.frevvo.com/fdata/2008" xml:lang="en">
      <id>_0vNZwD8KEd6yc_ZDP21S1Q!_nv8uAT8KEd6yc_ZDP21S1Q!johndoe</id>
      <title type="text">Expense Report</title>
      <summary type="text">Edit the form to change this description.</summary>
      <updated>2009-05-12T12:20:19.986-04:00</updated>
      <link type="application/atom+xml"
            href="/frevvo/web/api/formtype/_0vNZwD8KEd6yc_ZDP21S1Q!_nv8uAT8KEd6yc_ZDP21S1Q!johndoe"/>
      <link rel="self" type="application/atom+xml"
            href="/frevvo/web/api/formtype/_0vNZwD8KEd6yc_ZDP21S1Q!_nv8uAT8KEd6yc_ZDP21S1Q!johndoe"/>
      <link rel="edit" type="application/atom+xml"
            href="/frevvo/web/api/formtype/_0vNZwD8KEd6yc_ZDP21S1Q!_nv8uAT8KEd6yc_ZDP21S1Q!johndoe"/>
      <link rel="formtype" type="text/html"
            href="/frevvo/web/user/johndoe/app/_nv8uAT8KEd6yc_ZDP21S1Q/formtype/_0vNZwD8KEd6yc_ZDP21S1Q?embed=true&_method=post&apikey=1VeRclWJogwX2lUlGuLo9kglWN%252BUdNE9c9UGI6z7sJuRnYBOrCjoAdZ8kBVHKkZC9j5Ss%252BQYVwv%252BsIxsxTIAqg%253D%253D"
            title="Link to the FormType Expense Report HTML"/>
      <link rel="formtype" type="text/javascript"
            href="/frevvo/web/user/johndoe/app/_nv8uAT8KEd6yc_ZDP21S1Q/formtype/_0vNZwD8KEd6yc_ZDP21S1Q/embed?apikey=1VeRclWJogwX2lUlGuLo9kglWN%252BUdNE9c9UGI6z7sJuRnYBOrCjoAdZ8kBVHKkZC9j5Ss%252BQYVwv%252BsIxsxTIAqg%253D%253D"
            title="Link to Javascript code that can be used to embed this FormType in an HTML page"/>
      <link rel="controltypes" type="application/atom+xml"
            href="/frevvo/web/api/controltypes?ownerId=_0vNZwD8KEd6yc_ZDP21S1Q!_nv8uAT8KEd6yc_ZDP21S1Q!johndoe"
            title="Expense Report's Control Types"/>
      <link rel="formtype-editor" type="text/html"
            href="/frevvo/web/user/johndoe/app/_nv8uAT8KEd6yc_ZDP21S1Q/formtype/_0vNZwD8KEd6yc_ZDP21S1Q?edit=true&embed=true&_method=post&apikey=1VeRclWJogwX2lUlGuLo9kglWN%252BUdNE9c9UGI6z7sJuRnYBOrCjoAdZ8kBVHKkZC9j5Ss%252BQYVwv%252BsIxsxTIAqg%253D%253D"
            title="Link to the FormType Designer Expense Report HTML"/>
      <link rel="formtype-editor" type="text/javascript"
            href="/frevvo/web/user/johndoe/app/_nv8uAT8KEd6yc_ZDP21S1Q/formtype/_0vNZwD8KEd6yc_ZDP21S1Q/embed?edit=true&apikey=1VeRclWJogwX2lUlGuLo9kglWN%252BUdNE9c9UGI6z7sJuRnYBOrCjoAdZ8kBVHKkZC9j5Ss%252BQYVwv%252BsIxsxTIAqg%253D%253D"
            title="Link to Javascript code that can be used to embed this FormType in an HTML page"/>
      <link rel="submissions" type="text/html"
            href="/frevvo/web/user/johndoe/app/_nv8uAT8KEd6yc_ZDP21S1Q/formtype/_0vNZwD8KEd6yc_ZDP21S1Q/submission?embed=true&apikey=1VeRclWJogwX2lUlGuLo9kglWN%252BUdNE9c9UGI6z7sJuRnYBOrCjoAdZ8kBVHKkZC9j5Ss%252BQYVwv%252BsIxsxTIAqg%253D%253D"
            title="Use FormType Expense Report"/>
      <link rel="submissions" type="text/javascript"
            href="/frevvo/web/user/johndoe/app/_nv8uAT8KEd6yc_ZDP21S1Q/formtype/_0vNZwD8KEd6yc_ZDP21S1Q/embedsubs?apikey=1VeRclWJogwX2lUlGuLo9kglWN%252BUdNE9c9UGI6z7sJuRnYBOrCjoAdZ8kBVHKkZC9j5Ss%252BQYVwv%252BsIxsxTIAqg%253D%253D"
            title="Link to Javascript code that can be used to embed this FormType's submissions in an HTML page"/>
      <link rel="schema" type="application/xml"
            href="/frevvo/web/user/johndoe/app/_nv8uAT8KEd6yc_ZDP21S1Q/formtype/_0vNZwD8KEd6yc_ZDP21S1Q/schema"/>
      <fd:owner id="_nv8uAT8KEd6yc_ZDP21S1Q!johndoe"/>
      <fd:visibility value="public"/>
      <content type="application/zip"
               src="/frevvo/web/user/johndoe/app/_nv8uAT8KEd6yc_ZDP21S1Q/formtype/_0vNZwD8KEd6yc_ZDP21S1Q/file/content.zip"/>
   </entry>
</feed>

The feed returned above shows one form entry Expense Report that is owned by the current user.

Getting a FormType Entry

It is also possible to directly get a specific formtype entry as long as you know the formtype id. In order to do that send the following request to the server:

GET /frevvo/web/api/formtype/_0vNZwD8KEd6yc_ZDP21S1Q!_nv8uAT8KEd6yc_ZDP21S1Q!johndoe

And the server will respond with:

200 OK
 
<entry xmlns="http://www.w3.org/2005/Atom"
       xmlns:fd="http://schemas.frevvo.com/fdata/2008"
       xml:lang="en"
       xml:base="http://localhost:8082">
   <id>_0vNZwD8KEd6yc_ZDP21S1Q!_nv8uAT8KEd6yc_ZDP21S1Q!johndoe</id>
   <title type="text">Expense Report</title>
   <summary type="text">Edit the form to change this description.</summary>
   <updated>2009-05-12T12:33:49.188-04:00</updated>
   <link type="application/atom+xml"
         href="/frevvo/web/api/formtype/_0vNZwD8KEd6yc_ZDP21S1Q!_nv8uAT8KEd6yc_ZDP21S1Q!johndoe"/>
   <link rel="self" type="application/atom+xml"
         href="/frevvo/web/api/formtype/_0vNZwD8KEd6yc_ZDP21S1Q!_nv8uAT8KEd6yc_ZDP21S1Q!johndoe"/>
   <link rel="edit" type="application/atom+xml"
         href="/frevvo/web/api/formtype/_0vNZwD8KEd6yc_ZDP21S1Q!_nv8uAT8KEd6yc_ZDP21S1Q!johndoe"/>
   <link rel="formtype" type="text/html"
         href="/frevvo/web/user/johndoe/app/_nv8uAT8KEd6yc_ZDP21S1Q/formtype/_0vNZwD8KEd6yc_ZDP21S1Q?embed=true&_method=post&apikey=1VeRclWJogwX2lUlGuLo9kglWN%252BUdNE9c9UGI6z7sJuRnYBOrCjoAdZ8kBVHKkZC9j5Ss%252BQYVwv%252BsIxsxTIAqg%253D%253D"
         title="Link to the FormType Expense Report HTML"/>
   <link rel="formtype" type="text/javascript"
         href="/frevvo/web/user/johndoe/app/_nv8uAT8KEd6yc_ZDP21S1Q/formtype/_0vNZwD8KEd6yc_ZDP21S1Q/embed?apikey=1VeRclWJogwX2lUlGuLo9kglWN%252BUdNE9c9UGI6z7sJuRnYBOrCjoAdZ8kBVHKkZC9j5Ss%252BQYVwv%252BsIxsxTIAqg%253D%253D"
         title="Link to Javascript code that can be used to embed this FormType in an HTML page"/>
   <link rel="controltypes" type="application/atom+xml"
         href="/frevvo/web/api/controltypes?ownerId=_0vNZwD8KEd6yc_ZDP21S1Q!_nv8uAT8KEd6yc_ZDP21S1Q!johndoe"
         title="Expense Report's Control Types"/>
   <link rel="formtype-editor" type="text/html"
         href="/frevvo/web/user/johndoe/app/_nv8uAT8KEd6yc_ZDP21S1Q/formtype/_0vNZwD8KEd6yc_ZDP21S1Q?edit=true&embed=true&_method=post&apikey=1VeRclWJogwX2lUlGuLo9kglWN%252BUdNE9c9UGI6z7sJuRnYBOrCjoAdZ8kBVHKkZC9j5Ss%252BQYVwv%252BsIxsxTIAqg%253D%253D"
         title="Link to the FormType Designer Expense Report HTML"/>
   <link rel="formtype-editor" type="text/javascript"
         href="/frevvo/web/user/johndoe/app/_nv8uAT8KEd6yc_ZDP21S1Q/formtype/_0vNZwD8KEd6yc_ZDP21S1Q/embed?edit=true&apikey=1VeRclWJogwX2lUlGuLo9kglWN%252BUdNE9c9UGI6z7sJuRnYBOrCjoAdZ8kBVHKkZC9j5Ss%252BQYVwv%252BsIxsxTIAqg%253D%253D"
         title="Link to Javascript code that can be used to embed this FormType in an HTML page"/>
   <link rel="submissions" type="text/html"
         href="/frevvo/web/user/johndoe/app/_nv8uAT8KEd6yc_ZDP21S1Q/formtype/_0vNZwD8KEd6yc_ZDP21S1Q/submission?embed=true&apikey=1VeRclWJogwX2lUlGuLo9kglWN%252BUdNE9c9UGI6z7sJuRnYBOrCjoAdZ8kBVHKkZC9j5Ss%252BQYVwv%252BsIxsxTIAqg%253D%253D"
         title="Use FormType Expense Report"/>
   <link rel="submissions" type="text/javascript"
         href="/frevvo/web/user/johndoe/app/_nv8uAT8KEd6yc_ZDP21S1Q/formtype/_0vNZwD8KEd6yc_ZDP21S1Q/embedsubs?apikey=1VeRclWJogwX2lUlGuLo9kglWN%252BUdNE9c9UGI6z7sJuRnYBOrCjoAdZ8kBVHKkZC9j5Ss%252BQYVwv%252BsIxsxTIAqg%253D%253D"
         title="Link to Javascript code that can be used to embed this FormType's submissions in an HTML page"/>
   <link rel="schema" type="application/xml"
         href="/frevvo/web/user/johndoe/app/_nv8uAT8KEd6yc_ZDP21S1Q/formtype/_0vNZwD8KEd6yc_ZDP21S1Q/schema"/>
   <fd:owner id="_nv8uAT8KEd6yc_ZDP21S1Q!johndoe"/>
   <fd:visibility value="public"/>
   <content type="application/zip"
            src="/frevvo/web/user/johndoe/app/_nv8uAT8KEd6yc_ZDP21S1Q/formtype/_0vNZwD8KEd6yc_ZDP21S1Q/file/content.zip"/>
</entry>

Once you have a FormTypeEntry Url you can get the:

* Form UI url (formtype link)
* Form Designer UI (formtype-editor link)
* Submissions UI (submissions link)
* The list of controls/fields contained in this form (controltypes link)
* XML Schema for this form (schema link)

Note that for some of the links above there are two links for the same rel attribute (e.g. the formtype link):

* the text/html link that can be used directly in a browser or in an <iframe/>, and
* the text/javascript link that can be embedded in an html page using an <script/> tag.

Inserting a new FormType Entry

POST http://localhost:8082/frevvo/web/api/formtypes

<entry xmlns="http://www.w3.org/2005/Atom">
   <title type="text">Expense Report</title>
   <summary type="text">Edit the form to change this description.</summary>
</entry>

And the server will respond with:

200 OK

<entry xmlns="http://www.w3.org/2005/Atom"
       xmlns:fd="http://schemas.frevvo.com/fdata/2008"
       xml:lang="en"
       xml:base="http://localhost:8082">
   <id>_0vNZwD8KEd6yc_ZDP21S1Q!_nv8uAT8KEd6yc_ZDP21S1Q!johndoe</id>
   <title type="text">Expense Report</title>
   <summary type="text">Edit the form to change this description.</summary>
   <updated>2009-05-12T12:48:11.509-04:00</updated>
   <link type="application/atom+xml"
         href="/frevvo/web/api/formtype/_0vNZwD8KEd6yc_ZDP21S1Q!_nv8uAT8KEd6yc_ZDP21S1Q!johndoe"/>
   <link rel="self" type="application/atom+xml"
         href="/frevvo/web/api/formtype/_0vNZwD8KEd6yc_ZDP21S1Q!_nv8uAT8KEd6yc_ZDP21S1Q!johndoe"/>
   <link rel="edit" type="application/atom+xml"
         href="/frevvo/web/api/formtype/_0vNZwD8KEd6yc_ZDP21S1Q!_nv8uAT8KEd6yc_ZDP21S1Q!johndoe"/>
   <link rel="formtype" type="text/html"
         href="/frevvo/web/user/johndoe/app/_nv8uAT8KEd6yc_ZDP21S1Q/formtype/_0vNZwD8KEd6yc_ZDP21S1Q?embed=true&_method=post&apikey=1VeRclWJogwX2lUlGuLo9kglWN%252BUdNE9c9UGI6z7sJuRnYBOrCjoAdZ8kBVHKkZC9j5Ss%252BQYVwv%252BsIxsxTIAqg%253D%253D"
         title="Link to the FormType Expense Report HTML"/>
   <link rel="formtype" type="text/javascript"
         href="/frevvo/web/user/johndoe/app/_nv8uAT8KEd6yc_ZDP21S1Q/formtype/_0vNZwD8KEd6yc_ZDP21S1Q/embed?apikey=1VeRclWJogwX2lUlGuLo9kglWN%252BUdNE9c9UGI6z7sJuRnYBOrCjoAdZ8kBVHKkZC9j5Ss%252BQYVwv%252BsIxsxTIAqg%253D%253D"
         title="Link to Javascript code that can be used to embed this FormType in an HTML page"/>
   <link rel="controltypes" type="application/atom+xml"
         href="/frevvo/web/api/controltypes?ownerId=_0vNZwD8KEd6yc_ZDP21S1Q!_nv8uAT8KEd6yc_ZDP21S1Q!johndoe"
         title="Expense Report's Control Types"/>
   <link rel="formtype-editor" type="text/html"
         href="/frevvo/web/user/johndoe/app/_nv8uAT8KEd6yc_ZDP21S1Q/formtype/_0vNZwD8KEd6yc_ZDP21S1Q?edit=true&embed=true&_method=post&apikey=1VeRclWJogwX2lUlGuLo9kglWN%252BUdNE9c9UGI6z7sJuRnYBOrCjoAdZ8kBVHKkZC9j5Ss%252BQYVwv%252BsIxsxTIAqg%253D%253D"
         title="Link to the FormType Designer Expense Report HTML"/>
   <link rel="formtype-editor" type="text/javascript"
         href="/frevvo/web/user/johndoe/app/_nv8uAT8KEd6yc_ZDP21S1Q/formtype/_0vNZwD8KEd6yc_ZDP21S1Q/embed?edit=true&apikey=1VeRclWJogwX2lUlGuLo9kglWN%252BUdNE9c9UGI6z7sJuRnYBOrCjoAdZ8kBVHKkZC9j5Ss%252BQYVwv%252BsIxsxTIAqg%253D%253D"
         title="Link to Javascript code that can be used to embed this FormType in an HTML page"/>
   <link rel="submissions" type="text/html"
         href="/frevvo/web/user/johndoe/app/_nv8uAT8KEd6yc_ZDP21S1Q/formtype/_0vNZwD8KEd6yc_ZDP21S1Q/submission?embed=true&apikey=1VeRclWJogwX2lUlGuLo9kglWN%252BUdNE9c9UGI6z7sJuRnYBOrCjoAdZ8kBVHKkZC9j5Ss%252BQYVwv%252BsIxsxTIAqg%253D%253D"
         title="Use FormType Expense Report"/>
   <link rel="submissions" type="text/javascript"
         href="/frevvo/web/user/johndoe/app/_nv8uAT8KEd6yc_ZDP21S1Q/formtype/_0vNZwD8KEd6yc_ZDP21S1Q/embedsubs?apikey=1VeRclWJogwX2lUlGuLo9kglWN%252BUdNE9c9UGI6z7sJuRnYBOrCjoAdZ8kBVHKkZC9j5Ss%252BQYVwv%252BsIxsxTIAqg%253D%253D"
         title="Link to Javascript code that can be used to embed this FormType's submissions in an HTML page"/>
   <link rel="schema" type="application/xml"
         href="/frevvo/web/user/johndoe/app/_nv8uAT8KEd6yc_ZDP21S1Q/formtype/_0vNZwD8KEd6yc_ZDP21S1Q/schema"/>
   <fd:owner id="_nv8uAT8KEd6yc_ZDP21S1Q!johndoe"/>
   <fd:visibility value="public"/>
   <content type="application/zip"
            src="/frevvo/web/user/johndoe/app/_nv8uAT8KEd6yc_ZDP21S1Q/formtype/_0vNZwD8KEd6yc_ZDP21S1Q/file/content.zip"/>
</entry>

Updating a FormType Entry

Updating a form using the Data API is not supported at this point.

Deleting a FormType Entry

Deleting a form using the Data API can be done by sending an HTTP DELETE request to the form type entry url.

DELETE /frevvo/web/api/formtype/_0vNZwD8KEd6yc_ZDP21S1Q!_nv8uAT8KEd6yc_ZDP21S1Q!johndoe

And the server will respond with:

200 OK

Schemas Feed

The schema feed represents each XML Schema visible to the current logged in user.

The schema feed lists all uploaded schemas that are visible to the currently logged-in user. This includes schemas that were uploaded by the current user and all global schemas owned by the administrator user.

Getting the Schema Feed

In order to get a list of all schemas, send the following request to the frevvo server:

GET /frevvo/web/api/schemas

The server will respond with:

200 OK

<feed xmlns="http://www.w3.org/2005/Atom" xml:base="http://localhost:8082">
   <title>Schemas</title>
   <updated>2008-06-25T16:27:26.833-04:00</updated>
   <link rel="self" type="application/atom+xml" href="/frevvo/web/api/schemas"/>
   <link rel="edit" type="application/atom+xml" href="/frevvo/web/api/schemas"/>
   <entry xmlns:fd="http://schemas.frevvo.com/fdata/2008">
      <id>_HAKo4UL1Ed2aiOHUWaF_bw!_Fyz6YUL0Ed2aiOHUWaF_bw!johndoe</id>
      <title type="text">Purchase Order</title>
      <summary type="text">The Purchase Order Schema</summary>
      <updated>2008-06-25T16:27:26.833-04:00</updated>
      <link rel="self" type="application/atom+xml"
            href="/frevvo/web/api/schema/_HAKo4UL1Ed2aiOHUWaF_bw!_Fyz6YUL0Ed2aiOHUWaF_bw!johndoe"/>
      <link rel="edit" type="application/atom+xml"
            href="/frevvo/web/api/schema/_HAKo4UL1Ed2aiOHUWaF_bw!_Fyz6YUL0Ed2aiOHUWaF_bw!johndoe"/>
      <fd:owner id="_Fyz6YUL0Ed2aiOHUWaF_bw!johndoe"/>
   </entry>
</feed>

The returned feed above shows one schema entry named Purchase Order that is owned by the current user.

Note that for this release schema feeds are read-only and so it is not possible to upload new schemas using the Data API. Support for that will be added in a subsequent release.

Getting a Schema Entry

It is also possible to directly get a specific schema entry as long as you know the theme id. In order to do that send the following request to the server:

GET /frevvo/web/api/schema/_HAKo4UL1Ed2aiOHUWaF_bw!_Fyz6YUL0Ed2aiOHUWaF_bw!johndoe

And the server will respond with:

<entry xmlns:fd="http://schemas.frevvo.com/fdata/2008">
   <id>_HAKo4UL1Ed2aiOHUWaF_bw!_Fyz6YUL0Ed2aiOHUWaF_bw!johndoe</id>
   <title type="text">Purchase Order</title>
   <summary type="text">The Purchase Order Schema</summary>
   <updated>2008-06-25T16:27:26.833-04:00</updated>
   <link rel="self" type="application/atom+xml"
         href="/frevvo/web/api/schema/_HAKo4UL1Ed2aiOHUWaF_bw!_Fyz6YUL0Ed2aiOHUWaF_bw!johndoe"/>
   <link rel="edit" type="application/atom+xml"
         href="/frevvo/web/api/schema/_HAKo4UL1Ed2aiOHUWaF_bw!_Fyz6YUL0Ed2aiOHUWaF_bw!johndoe"/>
   <fd:owner id="_Fyz6YUL0Ed2aiOHUWaF_bw!johndoe"/>
</entry>

Note that for this release it is not possible to download the theme using the Data API: support for that will be added in a subsequent release.

Inserting a new Schema Entry

Inserting XML Schemas using the Data API is not supported at this point.

Updating a Schema Entry

Updating an existing schema using the Data API is not supported at this point.

Deleting a Schema Entry

Deleting a schema using the Data API can be done by sending an HTTP DELETE request to the schema entry url.

DELETE /frevvo/web/api/schema/_H_J04T8VEd6yc_ZDP21S1Q!_nv8uAT8KEd6yc_ZDP21S1Q!johndoe

And the server will respond with:

200 OK

Client Libraries

Although our APIs are based on the Atom Publishing Protocol and the Atom Syndication Protocol and can be accessed on any language/platform that can interact with HTTP end points and can process XML document, we provide a Java Client and a .Net Client that can be used to easily connect frevvo from Java and Windows or Mono, respectively.

You will need to install a client library in order to use the API. Please contact us for assistance.

Java Client FAQ

How do I login and logout to and from a frevvo server?

See the Java code snipped below:

		FormsService fs = new FormsService("localhost", 8082);
		fs.login("myuserid", "mypassword");
		
		// interact with frevvo
		
		fs.logout();

Since there is some overhead associated with logging in and out, you need to keep the FormsService instance around for as long as you need to interact with frevvo before logging out.

How do I get the list of all applications for the current user?

		FormsService fs = ...;
		URL appFeedUrl = fs.getFeedURL(ApplicationFeed.class);
		ApplicationFeed appFeed = fs.getFeed(appFeedUrl, ApplicationFeed.class);
		for(ApplicationEntry appEntry: appFeed.getEntries()){
			System.out.println("Application Name: " + appEntry.getTitle().getPlainText());
		}

How do I get the list of all themes for the current user?

		FormsService fs = ...;
		URL themeFeedUrl = fs.getFeedURL(ThemeFeed.class);
		ThemeFeed themeFeed = fs.getFeed(themeFeedUrl, ThemeFeed.class);
		for(ThemeEntry themeEntry: themeFeed.getEntries()){
			System.out.println("Theme Name: " + themeEntry.getTitle().getPlainText());
		}

How do I get the list of all forms for the current user?

		FormsService fs = ...;
		URL ftFeedUrl = fs.getFeedURL(FormTypeFeed.class);
		FormTypeFeed ftFeed = fs.getFeed(ftFeedUrl, FormTypeFeed.class);
		for(FormTypeEntry ftEntry: ftFeed.getEntries()){
			System.out.println("FormType Name: " + ftEntry.getTitle().getPlainText());
		}

How do I get the list of all forms for a given application?

The code snippet below prints the name of all forms in the appEntry application:

		ApplicationEntry appEntry = ...;
		FormTypeFeed ftFeed = appEntry.getFormTypeFeed();
		for(FormTypeEntry ftEntry: ftFeed.getEntries()){
			System.out.println("Form Name: " + ftEntry.getTitle().getPlainText());
		}

How do I get the list of all schemas for the current user?

		FormsService fs = ...;
		URL schemaFeedUrl = fs.getFeedURL(SchemaFeed.class);
		SchemaFeed schemaFeed = fs.getFeed(schemaFeedUrl, SchemaFeed.class);
		for(SchemaEntry schemaEntry: schemaFeed.getEntries()){
			System.out.println("Schema Name: " + schemaEntry.getTitle().getPlainText());
		}

How do I get the list of all schemas for a given application?

The code snippet below prints the name of all schemas in the appEntry application:

		ApplicationEntry appEntry = ...;
		SchemaFeed themeFeed = appEntry.getSchemaFeed();
		for(SchemaEntry schemaEntry: schemaFeed.getEntries()){
			System.out.println("Schema Name: " + schemaEntry.getTitle().getPlainText());
		}

How do I get the url to a form so it can be embedded in my HTML pages?

First get a hold of the corresponding FormTypeEntry, then get the form url as shown in the snipped below:

		FormTypeEntry ftEntry = ...;
		String formUrl = ftEntry.getFormTypeEmbedLink(null);

Then using the formUrl above you can generate the following script tag in your html page:

		<script type="text/javascript" src="{formUrl}"></script>

This will embed the form in your page inside an <iframe/>.

How do I get the url to the form designer so it can be embedded in my HTML pages?

First get a hold of the corresponding FormTypeEntry, then get the form url as shown in the snipped below:

		FormTypeEntry ftEntry = ...;
		String designerUrl = ftEntry.getFormTypeEditorEmbedLink(null);

Then using the designerUrl above you can generate the following script tag in your html page:

		<script type="text/javascript" src="{designerUrl}"></script>

This will embed the form designer in your page inside an <iframe/>.

How do I get the url to the form submissions so it can be embedded in my HTML pages?

First get a hold of the corresponding FormTypeEntry, then get the form url as shown in the snipped below:

		FormTypeEntry ftEntry = ...;
		String formSubmissionsUrl = ftEntry.getSubmissionsEmbedLink(null)

Then using the formSubmissionsUrl above you can generate the following script tag in your html page:

		<script type="text/javascript" src="{formSubmissionsUrl}"></script>

This will embed the submissions view in your page inside an <iframe/>.

How do I get a form entry based on a known id?

This is often needed when you need to relate a frevvo form with another concept your application (e.g. you application has the concept of a report that has an associated frevvo form). In this case you will store the form id somewhere and when needed fetch the form entry to embed it in your page, delete it, etc. Here is how you get the for a form entry (in fact any entry):

		FormTypeEntry ftEntry = ...;
		String formId = ftEntry.getId();

And here is how you can use that id to find the corresponding form entry:

		String formId = ...;
		FormsService fs = ...;
		URL formEntryUrl = fs.getEntryURL(FormTypeEntry.class, formId);
		FormTypeEntry ftEntry = fs.getEntry(formEntryUrl, FormTypeEntry.class);

How do I delete a form (or any other entry)?

By calling the delete method on the FormTypeEnty.

		FormTypeEntry ftEntry = ...;
		ftEntry.delete();

How do I create a new form?

First you have to get a hold of the form feed from an existing application (see 'How do I get the list of all forms for a given application?').

		FormsService fs = ...;
		ApplicationEntry appEntry = ...;
		FormTypeFeed ftFeed = appEntry.getFormTypeFeed();
		FormTypeEntry newEntry = ftFeed.createEntry();
		newEntry.setTitle(new PlainTextConstruct("MyForm"));
		newEntry.setSummary(new PlainTextConstruct("MyForm Description"));
		newEntry = ftFeed.insert(newEntry);

Note that inserting the original newEntry will not update it, but instead a new entry will be returned.

How do I create a new form using an existing one as a template?

The only difference between creating a new form and creating a new one based on an existing form is that instead of using the entry created by calling 'ftFeed.createEntry()' you will be using an existing form entry. Find an existing form entry, update its name and description and use that entry to insert into a feed. Do not override the entry id otherwise the insert will fail.

		FormsService fs = ...;
		ApplicationEntry appEntry = ...; // find app entry
		FormTypeEntry ftEntry = ...; // find template form entry 
		ftEntry.setTitle(new PlainTextConstruct("MyForm"));
		ftEntry.setSummary(new PlainTextConstruct("MyForm Description"));
		FormTypeFeed ftFeed = appEntry.getFormTypeFeed();
		FormTypeEntry newEntry = ftFeed.insert(ftEntry);


.Net Client FAQ

How do I login and logout to and from a frevvo server?

See the C# code snipped below:

	FormsService service = new FormsService("http://localhost:8082/frevvo", "yourappname");
	service.Login("myuser", "mypassword");
		
	// interact with frevvo
		
	service.Logout();

Since there is some overhead associated with logging in and out, you need to keep the FormsService instance around for as long as you need to interact with frevvo before logging out.

How do I get the list of all applications for the current user?

	FormsService service = ...;

	ApplicationQuery query = service.CreateApplicationQuery(null);
	ApplicationFeed apps = service.Query(query);
	foreach (ApplicationEntry app in apps.Entries)
	{
                Console.WriteLine("App: " + app.Title.Text);
		// ...
	}

How do I get the list of all themes for the current user?

	FormsService service = ...;

	ThemeQuery query = service.CreateThemeQuery(null);
	ThemeFeed themes = service.Query(query);
	foreach (ThemeEntry theme in themes.Entries)
	{
		Console.WriteLine("Theme: " + theme.Title.Text);
	}

How do I get the list of all forms for the current user?

	FormsService service = ...;

	FormTypeQuery query = service.CreateFormTypeQuery(null);
	FormTypeFeed themes = service.Query(query);
	foreach (ThemeEntry formType in formTypes.Entries)
	{
		Console.WriteLine("Form Type: " + formType.Title.Text);
	}

How do I get the list of all forms for a given application?

The code snippet below prints the name of all forms in the appEntry application:

	ApplicationEntry app = ...; // find the right application
	FormTypeFeed formTypes = app.FormTypeFeed;
	foreach(FormTypeEntry formType in formTypes.Enttries)
	{
		Console.WriteLine("Form Type: " + formType.Title.Text);
	}

How do I get the list of all schemas for the current user?

	SchemaQuery query = service.CreateSchemaQuery(null);
	SchemaFeed schemas = service.Query(query);
	foreach (SchemaEntry schema in schemas.Entries)
	{
		Console.WriteLine("Schema: " + schema.Title.Text);
	}

How do I get the list of all schemas for a given application?

The code snippet below prints the name of all schemas in the appEntry application:

	ApplicationEntry app = ...; // find the right application
	SchemaFeed schemas = app.SchemaFeed;
	foreach (SchemaEntry schema in schemas.Entries)
	{
		Console.WriteLine("Schema: " + schema.Title.Text);
	}

How do I get the url to a form so it can be embedded in my HTML pages?

First get a hold of the corresponding FormTypeEntry, then get the form url as shown in the snipped below:

	FormTypeEntry formType = ...; // find the correct formtype entry
	string formTypeUrl = formType.FormTypeEmbedLink.HRef;

Then using the url in formTypeUrl above you can generate the following script tag in your html page:

	<script type="text/javascript" src="{formTypeUrl}"></script>

This will embed the form in your page inside an <iframe/>.

How do I get the url to the form designer so it can be embedded in my HTML pages?

First get a hold of the corresponding FormTypeEntry, then get the formType url as shown in the snipped below:

	FormTypeEntry formType = ...; // find the correct formtype entry
	string designerUrl = formType.FormTypeEditorEmbedLink.HRef;

Then using the designerUrl above you can generate the following script tag in your html page:

	<script type="text/javascript" src="{designerUrl}"></script>

This will embed the form designer in your page inside an <iframe/>.

How do I get the url to the form submissions so it can be embedded in my HTML pages?

First get a hold of the corresponding FormTypeEntry, then get the form url as shown in the snipped below:

	FormTypeEntry formType = ...; // find the correct formtype entry
	string formSubmissionsUrl = formType.SubmissionsEmbedLink.HRef;

Then using the formSubmissionsUrl above you can generate the following script tag in your html page:

	<script type="text/javascript" src="{formSubmissionsUrl}"></script>

This will embed the submissions view in your page inside an <iframe/>.

How do I get a form entry based on a known id?

This is often needed when you need to relate a frevvo form with another concept your application (e.g. you application has the concept of a report that has an associated frevvo form). In this case you will store the form id somewhere and when needed fetch the form entry to embed it in your page, delete it, etc. Here is how you get the for a form entry (in fact any entry):

	FormTypeEntry formType = ...; // find an entry
	string formTypeId = formType.Id.Uri;

Here you can associate the formtype id with your application objects and retrieve the corresponding entry at any time as follows:

	string formtypeId = "....";
	FormTypeEntry formtype = service.GetFormType(formtypeId);

How do I delete a form (or any other entry)?

By calling the delete method on the FormTypeEnty.

	FormTypeEntry formType = ...;
	formType.Delete;

How do I create a new form?

First you have to get a hold of the form feed from an existing application (see 'How do I get the list of all forms for a given application?').

	FormsService service = ...;
	ApplicationEntry app = ...; // find an application
	FormTypeFeed formtypes = app.FormTypeFeed;
	FormTypeEntry formtype = formtypes.CreateFeedEntry;
	formtype.Title.Text = name;
	formtype.Summary.Text = description;
	formtype = formtypes.Insert(formtype);

Note that when inserting the original formtype variable will not be updated and the updated entry will be returned by the Insert method.

How do I create a new form using an existing one as a template?

The only difference between creating a new form and creating a new one based on an existing form is that instead of using the entry created by calling 'ftFeed.createEntry()' you will be using an existing form entry. Find an existing form entry, update its name and description and use that entry to insert into a feed. Do not override the entry id otherwise the insert will fail.

	FormsService service = ...;
	ApplicationEntry app = ...; // find an application
	FormTypeFeed formtypes = app.FormTypeFeed;
	FormTypeEntry template = ...; // find template formtype entry
	// modify key template properties
	template.Title.Text = name;
	template.Summary.Text = description;
	FormTypeEntry formtype = formtypes.Insert(template);
Personal tools