- Notifications
You must be signed in to change notification settings - Fork11
jotform/jotform-api-csharp
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
JotForm API - C# Client
Install via git clone:
$ git clone git://github.com/jotform/jotform-api-csharp.git $ cd jotform-api-csharpYou can find the docs for the API of this client athttps://api.jotform.com/docs/
JotForm API requires API key for all user related calls. You can create your API Keys atAPI section of My Account page.
Print all forms of the user
usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;usingJotForm;usingNewtonsoft.Json;usingNewtonsoft.Json.Linq;namespaceJotFormTest{classPrintFormList{staticvoidMain(string[]args){varclient=newJotForm.APIClient("YOUR API KEY");// If your account is in Eu Protected mode, set euProtected to true.// client.euProtected = false;varforms=client.getForms()["content"];varformTitles=fromforminformsselectform.Value<string>("title");foreach(variteminformTitles){Console.Out.WriteLine(item);}Console.ReadLine();}}}
Get submissions of the latest form
usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;usingJotForm;usingNewtonsoft.Json;usingNewtonsoft.Json.Linq;namespaceJotFormTest{classPrintFormSubmissions{staticvoidMain(string[]args){varclient=newJotForm.APIClient("YOUR API KEY");varforms=client.getForms(0,1,null,"")["content"];varlatestForm=forms[0];varsubmissions=client.getFormSubmissons(Convert.ToInt64(latestForm["id"]));Console.Out.WriteLine(submissions);Console.ReadLine();}}}
Get latest 100 submissions ordered by creation date
usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;usingJotForm;usingNewtonsoft.Json;usingNewtonsoft.Json.Linq;namespaceJotFormTest{classPrintLastSubmissions{staticvoidMain(string[]args){varclient=newJotForm.APIClient("YOUR API KEY");varsubmissions=client.getSubmissions(0,100,null,"created_at");Console.Out.WriteLine(submissions);Console.ReadLine();}}}
Submission and form filter examples
usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;usingJotForm;usingNewtonsoft.Json;usingNewtonsoft.Json.Linq;namespaceJotFormTest{classFilters{staticvoidMain(string[]args){varclient=newJotForm.APIClient("YOUR API KEY");Dictionary<String,String>submissionFilter=newDictionary<string,string>();submissionFilter.Add("id:gt","FORM ID");submissionFilter.Add("created_at:gt","DATE");varsubmissions=client.getSubmissions(0,0,submissionFilter,"");Console.Out.WriteLine(submissions);Dictionary<String,String>formFilter=newDictionary<string,string>();formFilter.Add("id:gt","FORM ID");varforms=client.getForms(0,0,formFilter,"");Console.Out.WriteLine(forms);Console.ReadLine();}}}
Delete last 50 submissions
usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;usingJotForm;usingNewtonsoft.Json;usingNewtonsoft.Json.Linq;namespaceJotFormTest{classDeleteSubmissions{staticvoidMain(string[]args){varclient=newJotForm.APIClient("YOUR API KEY");varsubmissions=client.getSubmissions(0,50,null,"")["content"];foreach(varsubmissioninsubmissions){varresult=client.deleteSubmission(Convert.ToInt64(submission["id"]));Console.Out.WriteLine(result);}Console.ReadLine();}}}
First theAPIClient class is included from thejotform-api-csharp/APIClient.cs file. This class provides access to JotForm's API. You have to create an API client instance with your API key.In case of an exception (wrong authentication etc.), you can catch it or let it fail with a fatal error.
About
JotForm API - C# Client
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors7
Uh oh!
There was an error while loading.Please reload this page.