Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
jotform-api-java
===============
[JotForm API](http://api.jotform.com/docs/) - Java Client
[JotForm API](https://api.jotform.com/docs/) - Java Client


### Installation
Expand All @@ -13,11 +13,11 @@ Install via git clone:

### Documentation

You can find the docs for the API of this client at [http://api.jotform.com/docs/](http://api.jotform.com/docs)
You can find the docs for the API of this client at [https://api.jotform.com/docs/](https://api.jotform.com/docs)

### Authentication

JotForm API requires API key for all user related calls. You can create your API Keys at [API section](http://www.jotform.com/myaccount/api) of My Account page.
JotForm API requires API key for all user related calls. You can create your API Keys at [API section](https://www.jotform.com/myaccount/api) of My Account page.

### Examples

Expand Down
40 changes: 40 additions & 0 deletions src/com/jotform/api/JotForm.java
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,47 @@ public JSONObject getReport(long reportID) {
public JSONObject getFolder(String folderID) {
return executeGetRequest("/folder/" + folderID, null);
}

/**
* Create a folder.
* @param folderProperties Properties of new folder.
* @return Returns report details and URL.
*/
public JSONObject createFolder(HashMap<String, String> folderProperties){
return executePostRequest("/folder", folderProperties);
}

/**
* Delete a folder and its subfolders.
* @param folderID You can get folder IDs when you call /user/folders.
* @return Returns status of request.
*/
public JSONObject deleteSubmission(String folderID) {
return executeDeleteRequest("/folder/" + folderID, null);
}

/**
* Update a specific folder.
* @param folderID You can get folder IDs when you call /user/folders.
* @param folderProperties New properties of the specified folder.
* @return Returns properties of the updated folder.
*/
public JSONObject updateFolder(String folderID, JSONObject folderProperties) {
return executePutRequest("/folder/" + folderID, folderProperties);
}

public JSONObject addFormsToFolder(String folderID, String[] formIDs) {
JSONArray formArray = new JSONArray(Arrays.asList(formIDs));
JSONObject data = new JSONObject();
data.put("forms", formArray);
return this.updateFolder(folderID, data);
}

public JSONObject addFormToFolder(String folderID, String formID) {
String formIDs[] = { formID };
return this.addFormsToFolder(folderID, formIDs);
}

/**
* Get a list of all properties on a form.
* @param formID Form ID is the numbers you see on a form URL. You can get form IDs when you call /user/forms.
Expand Down