...
For a list of Frequently Asked question about common tasks using the API with server, please see the API .Net Client FAQ topic.
Logging In and Out of the Forms Server
When interacting with , an application first needs to establish a session using the Data API. See the C# code snipped below for an example.
Code Block |
---|
FormsService service = new FormsService("http://localhost:8082", "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 before logging out. Logging out ensures that will release any unneeded resources and the user count will be decremented, as the number of users is affected by your license.
Browser URL API
The client libraries are built on top of the browser API. However since these URLs can be used directly from your browser, it is a great way to experiment with the API before you start writing code.
This section describes the basic protocol used to interact with 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 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 Server using any programming language that lets you issue HTTP requests and consume XML-based responses.
You can use the Resource URIs listed Browser API Reference Guide in the browser address bar when you're logged into . The URIs return data from the server as either web pages or XML files. To use the URIs, you edit the URL in the address bar when you're logged into a tenant to include the URI of the resource feed you want to use. For example:
- FormTypeFeed: ../frevvo/web/tn/{tenantId/api/formtypes?ownerId={appId}
- FormTypeEntry: ../frevvo/web/tn/{tenantId}/api/formtype/{id}
The browser URL API provides:
- A useful tool for debugging
- An easy way to try out the API without having to write code
- A way to experiment with and learn the API
This example shows how to use the formtypes feed to have the server return a list of all the forms belonging to the user who's currently logged in.
- After logging in, edit the URL in the browser address bar to insert api/formtypes immediately after the tenant name - which in this example is monahan.com.
- So in this example, we change the URL ''from:'' http: //localhost:8082/frevvo/web/tn/monahan.com user/david/app
- to: http: //localhost:8082/frevvo/web/tn/monahan.com/api/formtypes, and press Enter.
The browser returns the page below.
If you click on the Address Book link and either open or save the XML file, you see the XML for the form, the first portion of which is shown below.
Warning |
---|
Depending on which browser you're using, the browser may return the XML rather than the page in the illustration above. |
...
Browser URL API
The client libraries are built on top of the browser API. However since these URLs can be used directly from your browser, it is a great way to experiment with the API before you start writing code.
This section describes the basic protocol used to interact with 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 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 Server using any programming language that lets you issue HTTP requests and consume XML-based responses.
You can use the Resource URIs listed Browser API Reference Guide in the browser address bar when you're logged into . The URIs return data from the server as either web pages or XML files. To use the URIs, you edit the URL in the address bar when you're logged into a tenant to include the URI of the resource feed you want to use. For example:
- FormTypeFeed: ../frevvo/web/tn/{tenantId/api/formtypes?ownerId={appId}
- FormTypeEntry: ../frevvo/web/tn/{tenantId}/api/formtype/{id}
The browser URL API provides:
- A useful tool for debugging
- An easy way to try out the API without having to write code
- A way to experiment with and learn the API
This example shows how to use the formtypes feed to have the server return a list of all the forms belonging to the user who's currently logged in.
- After logging in, edit the URL in the browser address bar to insert api/formtypes immediately after the tenant name - which in this example is monahan.com.
- So in this example, we change the URL ''from:'' http: //localhost:8082/frevvo/web/tn/monahan.com user/david/app
- to: http: //localhost:8082/frevvo/web/tn/monahan.com/api/formtypes, and press Enter.
The browser returns the page below.
If you click on the Address Book link and either open or save the XML file, you see the XML for the form, the first portion of which is shown below.
Warning |
---|
Depending on which browser you're using, the browser may return the XML rather than the page in the illustration above. |
Code Block |
---|
<entry xmlns:fd="http://schemas.frevvo.com/fdata/2008" xmlns="http://www.w3.org/2005/Atom" xml:lang="en" xml:base="http://localhost:8082"> <id>_fNScEK4rEeCMGZK99v93jw!_W0jPga4rEeCMGZK99v93jw!david</id> <title type="text">Address Book</title> <summary type="text">David - July 2011</summary> <updated>2011-07-22T11:23:25.326</updated> <category scheme="http://schemas.frevvo.com/fdata/2008#kind" term="FORM"/> <link type="application/atom+xml" xmlnshref="http:/frevvo/www.w3.org/2005/Atom"web/tn/monahan.com/api/formtype/_fNScEK4rEeCMGZK99v93jw!_W0jPga4rEeCMGZK99v93jw!david"/> <link xml:lang="enrel="self" type="application/atom+xml" xml:base="http://localhost:8082"> <id>href="/frevvo/web/tn/monahan.com/api/formtype/_fNScEK4rEeCMGZK99v93jw!_W0jPga4rEeCMGZK99v93jw!david<david"/id>> <title<link typerel="textedit">Address Book</title> <summary type="text">David - July 2011</summary> type="application/atom+xml" <updated>2011-07-22T11:23:25.326</updated> <category scheme="http://schemas.frevvo.com/fdata/2008#kind" term="FORM"/> <link type="application/atom+xml" href=" href="/frevvo/web/tn/monahan.com/api/formtype/_fNScEK4rEeCMGZK99v93jw!_W0jPga4rEeCMGZK99v93jw!david"/> |
This example shows how to use the controltypes feed to get a list of all the control types that belong to the currently logged-in user, regardless of which forms they're used in.
- After logging in, edit the URL in the browser address bar to insert api/controltypes immediately after the tenant name - which in this example is monahan.com.
- So in this example, we change the URL from: http: //localhost:8082/frevvo/web/tn/monahan.com/
...
- user/
...
- david/app
- to: http: //localhost:8082/frevvo/web/tn/monahan.com/api/
...
- controltypes, and press Enter.
The browser returns the page below. Scroll though the page to see all the controls in all the user's forms.
This example shows how to use the controltypes?ownerId={formTypeId} feed to get a list of all the control types that belong to the currently logged-in user, regardless of which forms they're used inin a specific form - in this case the Address Book form in the example above.
- After logging in, edit the URL in the browser address bar to insert api/controltypes?ownerId={formTypeId} immediately after the tenant name - which in this example is monahan.com.
- So in this example, we change the URL from: http: //localhost:8082/frevvo/web/tn/monahan.com/user/david/app
- to: http: //localhost:8082/frevvo/web/tn/monahan.com/api/controltypes?ownerId=_fNScEK4rEeCMGZK99v93jw!_W0jPga4rEeCMGZK99v93jw!david, and press Enter.
The browser returns the page below. Scroll though the page to see all the controls in all the user's forms.
This example shows how to use the controltypes?ownerId={formTypeId} feed to get a list of the control types in a specific form - in this case the Address Book form in the example above.
- After logging in, edit the URL in the browser address bar to insert api/controltypes?ownerId={formTypeId} immediately after the tenant name - which in this example is monahan.com.
- So in this example, we change the URL from: http: //localhost:8082/frevvo/web/tn/monahan.com/user/david/app
- to: http: //localhost:8082/frevvo/web/tn/monahan.com/api/controltypes?ownerId=_fNScEK4rEeCMGZK99v93jw!_W0jPga4rEeCMGZK99v93jw!david, and press Enter.
Note |
---|
Note that the value of the ownerId= parameter is the form type definition for the Address Book form shown in the XML example above, including the ID (david) of the user who created the form. |
The browser returns the page below.
If you click on the RequiredFieldPrompt link and either open or save the XML file, you see the XML for the control, which is shown below.
...
Note |
---|
Note that the value of the ownerId= parameter is the form type definition for the Address Book form shown in the XML example above, including the ID (david) of the user who created the form. |
The browser returns the page below.
If you click on the RequiredFieldPrompt link and either open or save the XML file, you see the XML for the control, which is shown below.
Code Block |
---|
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:fd="http://schemas.frevvo.com/fdata/2008" xml:base="http://localhost:8082"> <id>_bjLLYbIIEeClr-dcvjFaZg!_fNScEK4rEeCMGZK99v93jw!_W0jPga4rEeCMGZK99v93jw!david</id> <title type="text">RequiredFieldPrompt_</title> <summary type="text">Message 39</summary> <category scheme="http://schemas.frevvo.com/fdata/2008#controltype" xmlns:fd term="OutputControlType"/> <category scheme="http://schemas.frevvo.com/fdata/20082008#displaytype" xml:base="http://localhost:8082"term="Message"/> <id>_bjLLYbIIEeClr-dcvjFaZg!_fNScEK4rEeCMGZK99v93jw!_W0jPga4rEeCMGZK99v93jw!david</id><updated>2011-07-25T13:52:22.017-04:00</updated> <title<fd:required typevalue="texttrue">RequiredFieldPrompt_</title>> <summary<fd:readonly typevalue="textfalse">Message/> 39</summary> <link <category schemerel="parent" type="http://schemas.frevvo.com/fdata/2008#controltype" application/atom+xml" term="OutputControlType"/> <category scheme="http://schemas.frevvo.com/fdata/2008#displaytype" term="Message"/> href="/frevvo/web/tn/monahan.com/api/controltype/_fQoD8a4rEeCMGZK99v93jw!_fNScEK4rEeCMGZK99v93jw!_W0jPga4rEeCMGZK99v93jw!david" <updated>2011-07-25T13:52:22.017-04:00</updated> <fd:required valuetitle="true"/> <fd:readonly value="falseThis entry's parent control type"/> <link rel="parent" type="application/atom+xml" href="/frevvo/web/tn/monahan.com/api/controltype/_fQoD8a4rEeCMGZK99v93jwbjLLYbIIEeClr-dcvjFaZg!_fNScEK4rEeCMGZK99v93jw!_W0jPga4rEeCMGZK99v93jw!david" title="This entry's parent control type"/> <link rel="self" type="application/atom+xml" href="/frevvo/web/tn/monahan.com/api/controltype/_bjLLYbIIEeClr-dcvjFaZg!_fNScEK4rEeCMGZK99v93jw!_W0jPga4rEeCMGZK99v93jw!david" title="This entry"/> <link rel="self" type="application/atom+xml" href="/frevvo/web/tn/monahan.com/api/controltype/_bjLLYbIIEeClr-dcvjFaZg!_fNScEK4rEeCMGZK99v93jw!_W0jPga4rEeCMGZK99v93jw!david"</entry> |
Logging In and Out of the Forms Server
When interacting with , an application first needs to establish a session using the Data API. See the C# code snipped below for an example.
Code Block |
---|
FormsService service = new FormsService("http://localhost:8082", "yourappname"); service.Login("myuser", "mypassword"); // interact with frevvo title="This entry"/> </entry> 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 before logging out. Logging out ensures that will release any unneeded resources and the user count will be decremented, as the number of users is affected by your license.
Calling the API from a JSP Page
...