On this page:
Table of Contents | ||
---|---|---|
|
Note |
---|
In v9.1 and later 's "Applications" are known as "Projects," and "Themes" are known as "Styles." The API objects and methods still use the words application, 'app', and theme. |
How do I login/logout to/from a Form server?
...
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 useful when you want to login using the same user that is logged into your application project without having to know their password.
...
Code Block |
---|
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 flowsworkflows but not create flowsworkflows/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(); |
Note |
---|
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 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 projects for the current user?
Code Block |
---|
FormsService service = ...; ApplicationQuery query = service.CreateApplicationQuery(null); ApplicationFeed apps = service.Query(query); foreach (ApplicationEntry app in apps.Entries) { Console.WriteLine("App: " + app.Title.Text); // ... } |
...
Code Block |
---|
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
...
project?
The code snippet below prints the name of all forms in the appEntry application:
...
Code Block |
---|
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
...
project?
The code snippet below prints the name of all schemas in the appEntry application:
Code Block |
---|
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
...
a project?
Code Block |
---|
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
...
project?
At this point you have to manually filter the entries in an ApplicationFeed. See the following snippet:
Code Block |
---|
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
...
a project?
Code Block |
---|
ApplicationEntry app = ...; // find the right application app.Delete(); |
How do I upload
...
a project for a specific user?
First get a hold of the corresponding UserEntry for the desired user, and then use the users ApplicationFeed.
Code Block |
---|
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
...
a project?
Code Block |
---|
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
...
a project?
Code Block |
---|
String filename = ...; ApplicationEntry app = ...; // find the right application app.Title.Text = appName; app.Update(); |
Note |
---|
The method ApplicationEntry.Update() is only available in .Net Client API version 5.1 Patch 3 and later. |
How do I download
...
a project?
Code Block |
---|
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); } |
...
Code Block |
---|
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 URL as shown in the snipped below:
Code Block |
---|
FormTypeEntry formType = ...; // find the correct formtype entry string formTypeUrl = formType.FormTypeEmbedLink.AbsoluteUri; |
Then using the url URL in formTypeUrl above you can generate the following script tag in your html page:
...
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 URL as shown in the snipped below:
Code Block |
---|
FormTypeEntry formType = ...; // find the correct formtype entry string designerUrl = formType.FormTypeEditorEmbedLink.AbsoluteUri; |
Then using the designerUr' above designerUrl above you can generate the following script tag in your html page:
...
This will embed the form designer in your page inside an <iframe/>.
How do I get the url 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 URL as shown in the snipped below:
...
This will embed the submissions view in your page inside an <iframe/>.
How do I get the
...
URL to the form instance so it can be embedded in my HTML pages?
First get a hold of the corresponding FormTypeEntry, then get the form instance url URL as shown in the snippet below:
...
This will embed the form instance in your page inside an <iframe/>.
How do I get the
...
URL to return the form instance embed java script?
First get a hold of the corresponding FormTypeEntry and then get the url URL as shown in the snippet below:
...
Note |
---|
The _formActionDocs parameter is only supported by .Net Client API version 5.1 Patch 3 and later. |
How do I receive the document set (including attachments) for the Form when submitted?
...
Warning |
---|
Objects, of any kind, that are part of a Flow workflow cannot access the list of controls for the Flowworkflow. Attempted access of FormTypeEntry.ControlTypeFeed, FormTypeEntry.ControlTypeFeedLink, FormEntry. ControlFeed, or FormEntry.ControlFeedLink will result in a NotSupportedException. |
...
Warning |
---|
Printing objects of any kind that are part of a Flow workflow is not supported and will result in a NotSupportedException. |
...
Note |
---|
The updates listed here are only available in .net client API version 5.2 or later. |
How do I upload
...
a project for a specific user?
There are three options when uploading an application for a project for a user: Insert, Copy or Replace:
Code Block |
---|
string fileName = ....; UserEntry user = ....; // If an entry with the same id already exists, it will be replaced. // Otherwise, the archive will be uploaded with the same id. ApplicationEntry entry = user.ApplicationFeed.UploadAndReplaceApplication(fileName); // If an entry with the same id already exists, it will be copied. // Otherwise, the archive will be uploaded with the same id. ApplicationEntry entry = user.ApplicationFeed.UploadAndCopyApplication(fileName); // If an entry with the same id already exists, it will be copied. // Otherwise, the archive will be uploaded with a new id. ApplicationEntry entry = user.ApplicationFeed.UploadAndInsertApplication(fileName); |
How do I update the ElementName for a Form or
...
Workflow?
Code Block |
---|
FormTypeEntry fe = TestApplication.FormTypeFeed.CreateEntry(); fe.ElementName = "test"; TestApplication.FormTypeFeed.Insert(fe);. |
...
Code Block |
---|
fe.ElementName = "TemporaryForm"; fe.Update(); |
How do I upload a form/
...
workflow?
There are three options when uploading a Flow workflow or Formform: Insert, Copy or Replace:
...
Code Block |
---|
FormsService service = ....; StyleQuery query = service.CreateStyleQuery(); StyleFeed styles = service.Query(query) as StyleFeed; foreach (StyleEntry style in styles.Entries) { Console.WriteLine("Style: " + style.Title.Text); } |
How do I set the Style property for a Form or
...
Workflow?
Code Block |
---|
FormTypeEntry formTypeEntry = ....; formTypeEntry.Style = "blue"; formTypeEntry.Update(); |
How do I upload a form/
...
workflow?
There are three options when uploading a Flow workflow or Formform: Insert, Copy or Replace. You can use a Stream or a file path location when uploading.
Code Block |
---|
string fileName = ....; bool isForm = ....; ApplicationEntry appEntry = ....; // If an entry with the same id already exists, it will be replaced. // Otherwise, the archive will be uploaded with the same id. FormTypeEntry entry = appEntry. FormTypeFeed.UploadAndInsertFormType(filename, isForm); // If an entry with the same id already exists, a copy will be made. // Otherwise, the archive will be uploaded with the same id. FormTypeEntry entry = appEntry.FormTypeFeed.UploadAndCopyFormType(filename, isForm); // If an entry with the same id already exists, it will be replaced. // Otherwise, the archive will be uploaded with the same id. FormTypeEntry entry = appEntry.FormTypeFeed.UploadAndReplaceFormType(filename, isForm); Stream appStream = ....; bool isForm = ....; ApplicationEntry appEntry = ....; // If an entry with the same id already exists, it will be replaced. // Otherwise, the archive will be uploaded with the same id. FormTypeEntry entry = appEntry. FormTypeFeed.UploadAndInsertFormType(appStream,isForm); // If an entry with the same id already exists, a copy will be made. // Otherwise, the archive will be uploaded with the same id. FormTypeEntry entry = appEntry.FormTypeFeed.UploadAndCopyFormType(appStream, isForm); // If an entry with the same id already exists, it will be replaced. // Otherwise, the archive will be uploaded with the same id. FormTypeEntry entry = appEntry.FormTypeFeed.UploadAndReplaceFormType(appStream, isForm); |
...
Section | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Get the Raw Link to the form/
...
workflow from the FormTypeEntry:
Code Block |
---|
FormTypeEntry fte = ….; //Get Raw Link AtomLink rawLink = fte.GetFormTypeLink(null); |
...
You can specify who receives an email reporting the upload status when it is done through the API. The email is sent to the "notificationEmailAddress" that is passed in the API. The email may say something like this if there are errors during the upload:
Code Block |
---|
Validation occurred with errors. Users data NOT loaded. Refer to attached CSV data file for validation and/or loading result details. |
...
What do I do if API submission access fails?
Ensure the form/flow workflow submissions you are trying to access has either the userid or Roles that the user is a member of in "Who can view submissions" ACL.
...