コード例 #1
0
        /*
         * Fetch four of them back, all available fields
         */
        public void getAPIData()
        {
            Dictionary <string, object> filter3 = new Dictionary <string, object> ();

            //Merge the limit_select and then add array of arrays
            filter3.Add("_sort", "id");
            filter3.Add("_dir", "ASC");
            filter3.Add("_ff[]", new String[] { "key", "key", "key", "key" });
            filter3.Add("_ft[]", new String[] { "eq", "eq", "eq", "eq" });
            filter3.Add("_fc[]", new String[] { "api_data_example: the answer",
                                                "api_data_example: null",
                                                "api_data_example: ten thousand characters",
                                                "api_data_example: multibyte characters" });
            filter3.Add("_fm", "or");

            try {
                WorkbooksApiResponse response = workbooks.assertGet("automation/api_data", filter3, null);

                workbooks.log("getAPIData Total fetched", new Object[] { response.getTotal() });
                workbooks.log("getAPIData First Data", new Object[] { response.getFirstData() });
            } catch (Exception e) {
                workbooks.log("Error while getting the apiData:", new Object[] { e });
                Console.WriteLine(e.StackTrace);
                login.testExit(workbooks, 1);
            }
        }
コード例 #2
0
ファイル: SimpleExample.cs プロジェクト: neilmcd/client_lib
    private void getOrganisations()
    {
        String[] columns = { "id",
                             "lock_version",
                             "name",
                             "object_ref",
                             "main_location[town]",
                             "updated_at",
                             "updated_by_user[person_name]" };
        Dictionary <string, object> filter_limit_select = new Dictionary <string, object> ();

        filter_limit_select.Add("_start", "0");                                   // Starting from the 'zeroth' record
        filter_limit_select.Add("_limit", "100");                                 //   fetch up to 100 records
        filter_limit_select.Add("_sort", "id");                                   // Sort by 'id'
        filter_limit_select.Add("_dir", "ASC");                                   //   in ascending order
        filter_limit_select.Add("_ff[]", "main_location[county_province_state]"); // Filter by this column
        filter_limit_select.Add("_ft[]", "ct");                                   //   containing
        filter_limit_select.Add("_fc[]", "Berkshire");                            //   'Berkshire'
        filter_limit_select.Add("_select_columns[]", columns);                    // An array, of columns to select
        try {
            WorkbooksApiResponse response = workbooks.assertGet("crm/organisations", filter_limit_select, null);
            workbooks.log("Total organisations: ", new Object[] { response.getTotal() });
            workbooks.log("First Organisation: ", new object[] { response.print(response.getFirstData()) });
        } catch (Exception e) {
            Console.WriteLine(e.StackTrace);
        }
    }
コード例 #3
0
        /*
         * Fetch a single item using the alternate filter syntax
         */
        public void getSingleAPIData()
        {
            Dictionary <string, object> filter3 = new Dictionary <string, object> ();

            filter3.Add("_filter_json", "[['key', 'eq', 'api_data_example: poppins']]");

            try {
                WorkbooksApiResponse response = workbooks.assertGet("automation/api_data", filter3, null);

                workbooks.log("getAPIData Total fetched", new Object[] { response.getTotal() });
                workbooks.log("getAPIData First Data", new Object[] { response.getFirstData() });
            } catch (Exception e) {
                workbooks.log("Error while getting the apiData:", new Object[] { e });
                Console.WriteLine(e.StackTrace);
                login.testExit(workbooks, 1);
            }
        }