Live Forms v7.4 is no longer supported. Please visit Live Forms Latest for our current Cloud Release. Earlier documentation is available too.

On this page:

How do I login/logout to/from a Form server?

The direct method for an existing user: See the C# code snipped below:

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

Note that when you login, the .NET client API initializes a local security token based on your credentials.  It does not actually make a call however, until you make your first request.  At that time, the forms service will attempt to authorize you based on your token.  In the above example, the first call is for the user entry.

The LoginAs method for an existing user:

This new method allows you to login as any of the existing tenant users provided you can pass in the tenant's admin user and password. This is quite convenient when you want login using the same user that is logged into your application without having to know their password.

IDictionary<string, string> customParams = new Dictionary<string, string>(); customParams.Add("autoLogin", "true"); FormsService service = new FormsService("http://localhost:8082", "yourappname"); service.LoginAs( "myuser", "tenantAdminUserName@myTenantName", "tenantAdminPassword", false, null, null, null, null, customParams); UserEntry user = service.GetUser(“myuser”); // interact with frevvo service.Logout();

The LoginAs method for a new/undefined user:

When your tenant is configured with the Delegating Security Manager, you can use the loginAs() method to automatically create new/virtual users.

IDictionary<string,string> customParams = new Dictionary<string, string>(); customParams.Add("autoLogin", "true"); //customParams.Add("updateNonDesigners", "true"); //if user is not a frevvo.Designer, this must be set for user to be officially 'created' otherwise user is truly virtual/temporary string[] roles = { "frevvo.Designer" }; FormsService service = new FormsService("http://localhost:8082", "yourappname"); service.LoginAs( "newUserName", "tenantAdminUserName@myTenantName", "tenantAdminPassword", true, roles, //optional param – may be null. Specified roles will be created if necessary. When null, a non-designer user (able to participate in flows but not create flows/forms) will be created if necessary. "newUserFirstName", //optional param – may be null "newUserLastName", //optional param – may be null "newUserEmailName@EmailServer.com", //optional param – may be null customParams); UserEntry user = service.GetUser("newUserName"); // interact with frevvo service.Logout();

When you login, the .NET client API initializes a local security token based on the supplied credentials.  It does not actually make a call however, until the first request is executed.  At that time, the forms service will attempt to authorize the user based on the provided token.  In the above examples, the first call is for the user entry.

 

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?

All references to Themes have been removed in version 5.3. This example does not pertain to

5.3 or later.

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 formTypes = service.Query(query); foreach (FormTypeEntry 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.Entries) { 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 create an Application?

FormsService fs = ....; ApplicationQuery query = fs.CreateApplicationQuery(null); ApplicationFeed apps = fs.Query(query); ApplicationEntry app = apps.CreateEntry(); app.Title.Text = "My First App"; app = apps.Insert(app);

How do I find an existing Application?

At this point you have to manually filter the entries in an ApplicationFeed. See the following snippet:

FormsService fs = ....; ApplicationQuery query = fs.CreateApplicationQuery(null); ApplicationFeed apps = fs.Query(query); foreach(ApplicationEntry app in apps.Entries) { if( app.Title.Text == "My First App" ) return app.Id.Uri; }

How do I delete an Application?

ApplicationEntry app = ...; // find the right application   app.Delete();

 

How do I upload an Application for a specific user?

First get a hold of the corresponding UserEntry for the desired user, and then use the users ApplicationFeed.

string fileName = ....; UserEntry user = ....;   MediaFileSource source = new MediaFileSource(fileName, ApplicationFeed.MEDIA_SOURCE_TYPE);   ApplicationFeed apps = user.ApplicationFeed; ApplicationEntry app = apps.CreateEntry();   app.MediaSource = source; app = apps.Insert(app);

How do I upload an Application?

string fileName = ....; string appName = ....; FormsService formsService = ....;   MediaFileSource source = new MediaFileSource(fileName, ApplicationFeed.MEDIA_SOURCE_TYPE);   ApplicationQuery query = formsService.CreateApplicationQuery(null); ApplicationFeed apps = formsService.Query(query); ApplicationEntry app = apps.CreateEntry(); app.MediaSource = source; app = apps.Insert(app);

 

How do I rename an application?

String filename = ...; ApplicationEntry app = ...; // find the right application app.Title.Text = appName; app.Update();

The method ApplicationEntry.Update() is only available in .Net Client API version 5.1 Patch 3 and later.

How do I download an Application?

FormsService formsService = ....; ApplicationEntry entry = ....; string fileName = ....;   Stream contentStream = formsService.QueryContent(entry.Content);      //if the Application needs to be written to a file: using (FileStream fileStream = File.Create(fileName)) { contentStream.CopyTo(fileStream); }

  

After I found a ApplicationEntry for the first time can I get the entry directly?

If you have an entry id you can retrieve the entry directly.

string appId = ...; FormsService fs = ....; ApplicationEntry app = fs.GetApplication(appId);

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.AbsoluteUri;