frevvo v10.2 is no longer supported. Please visit frevvoLatest for our current Cloud Release. Earlier documentation is available too.
FAQ - Java Client API
The FAQs provide some examples and code snippets for common tasks when a third-party application wants to interact with the
On this page:
- 1 How do I login and logout to and from a server?
- 2 How do I get the list of all projects for the current user?
- 3 How do I get the list of all themes for the current user?
- 4 How do I get the list of all forms for the current user?
- 5 How do I get the list of all forms for a given project?
- 6 How do I get the list of all schemas for the current user?
- 7 How do I get the list of all schemas for a given project?
- 8 How do I get the URL to a form so it can be embedded in my HTML pages?
- 9 How do I get the URL to the form designer so it can be embedded in my HTML pages?
- 10 How do I get the URL to the form submissions so it can be embedded in my HTML pages?
- 11 How do I get a form entry based on a known id?
- 12 How do I delete a form (or any other entry)?
- 13 How do I create a new form?
- 14 How do I create a new form using an existing one as a template?
- 15 How do I copy a form?
- 16 How do I download an existing form?
- 17 How do I upload a form into an existing project?
- 18 How do I use Self-signed Certificates with the API?
- 19 How do I set a form's Deployment State?
- 20 Why are deleted submissions showing up in the submissions feed?
- 21 What do I do if API submission access fails?
- 22 How do I get a form submission PDF when Save PDF is not enabled?
- 23 How do I batch upload users from the api?
- 24 How do I use the Security Manager Built-In Admin?
In v9.1 and later
How do I login and logout to and from a server?
See the Java code snippet 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
How do I get the list of all projects 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 project?
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 project?
The code snippet below prints the name of all schemas in the appEntry application:
ApplicationEntry appEntry = ...;
SchemaFeed schemaFeed = 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 an
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 project. See How do I get the list of all forms for a given project?
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);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);How do I copy a form?
Copying entails inserting an existing entry into a feed. The key difference between this case and a regular feed insert() is that the entry being inserted already has an id: this will trigger a copy.