package com.orgsync.api.examples;

import java.util.List;
import java.util.concurrent.ExecutionException;

import com.orgsync.api.ApiClient;
import com.orgsync.api.ApiResponse;
import com.orgsync.api.OrgSync;
import com.orgsync.api.OrgsResource;
import com.orgsync.api.Resources;
import com.orgsync.api.Util;
import com.orgsync.api.Version;
import com.orgsync.api.model.accounts.Account;
import com.orgsync.api.model.orgs.Org;

public class SimpleRequest {

    public static void main(final String[] args) throws InterruptedException,
            ExecutionException {
        String apiKey = "dd6b9d2beb614611c5eb9f56c34b743d1d86f385";
        String host = "https://api.orgsync.com/api/";
        ApiClient client = OrgSync.newApiClient(apiKey, Version.V2, host);

        try {
            System.out.println("Requesting orgs");
            OrgsResource resource = client.getResource(Resources.ORGS);
            ApiResponse<List<Org>> orgsResponse = resource.getOrgs().get();

            if (isSuccess(orgsResponse)) {
                System.out.println("Recieved following orgs:");
                System.out.println(Util.joinList(orgsResponse.getResult(), "\n"));
            }

            ApiResponse<List<Account>> accountsResponse = resource
                    .listAccounts(225).get();
            if (isSuccess(accountsResponse)) {
                System.out.println("Received list of accounts: \n"
                        + Util.joinList(accountsResponse.getResult(), "\n"));
            }

            System.out.println("Cleanup client");
        } finally {
            client.destroy();
        }

        System.out.println("Exiting...");
    }

    private static boolean isSuccess(final ApiResponse<?> response) {
        if (response.isSuccess())
            return true;

        System.out.println("Error making request: " + response.getError());
        return false;
    }
}

@@ -170,16 +170,54 @@
 sponse;%0A
+import com.orgsync.api.FormsResource;%0A
 import c
@@ -415,24 +415,75 @@
 ts.Account;%0A
+import com.orgsync.api.model.forms.FormSubmission;%0A
 import com.o
@@ -1580,32 +1580,360 @@
 %0A            %7D%0A%0A
+            FormsResource forms = client.getResource(Resources.FORMS);%0A            ApiResponse%3CFormSubmission%3E submissionResponse = forms.getFormSubmission(3827851).get();%0A            if (isSuccess(submissionResponse)) %7B%0A                System.out.println(%22Recived form info: %22 + submissionResponse.getResult());%0A            %7D%0A%0A
             Syst

Add getting a form submission to simple request.