Chilkat Online Tools

SQL Server / easybill REST API / Fetch customers list

Back to Collection Items

-- Important: See this note about string length limitations for strings returned by sp_OAMethod calls.
--
CREATE PROCEDURE ChilkatSample
AS
BEGIN
    DECLARE @hr int
    DECLARE @iTmp0 int
    -- Important: Do not use nvarchar(max).  See the warning about using nvarchar(max).
    DECLARE @sTmp0 nvarchar(4000)
    -- This example assumes the Chilkat API to have been previously unlocked.
    -- See Global Unlock Sample for sample code.

    DECLARE @http int
    -- Use "Chilkat_9_5_0.Http" for versions of Chilkat < 10.0.0
    EXEC @hr = sp_OACreate 'Chilkat.Http', @http OUT
    IF @hr <> 0
    BEGIN
        PRINT 'Failed to create ActiveX component'
        RETURN
    END

    DECLARE @success int

    DECLARE @queryParams int
    -- Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0
    EXEC @hr = sp_OACreate 'Chilkat.JsonObject', @queryParams OUT

    EXEC sp_OAMethod @queryParams, 'UpdateString', @success OUT, 'limit', '<integer>'
    EXEC sp_OAMethod @queryParams, 'UpdateString', @success OUT, 'page', '<integer>'
    EXEC sp_OAMethod @queryParams, 'UpdateString', @success OUT, 'group_id', '<string>'
    EXEC sp_OAMethod @queryParams, 'UpdateString', @success OUT, 'additional_group_id', '<string>'
    EXEC sp_OAMethod @queryParams, 'UpdateString', @success OUT, 'number', '<string>'
    EXEC sp_OAMethod @queryParams, 'UpdateString', @success OUT, 'country', '<string>'
    EXEC sp_OAMethod @queryParams, 'UpdateString', @success OUT, 'zip_code', '<string>'
    EXEC sp_OAMethod @queryParams, 'UpdateString', @success OUT, 'emails', '<string>'
    EXEC sp_OAMethod @queryParams, 'UpdateString', @success OUT, 'first_name', '<string>'
    EXEC sp_OAMethod @queryParams, 'UpdateString', @success OUT, 'last_name', '<string>'
    EXEC sp_OAMethod @queryParams, 'UpdateString', @success OUT, 'company_name', '<string>'
    EXEC sp_OAMethod @queryParams, 'UpdateString', @success OUT, 'created_at', '<string>'

    EXEC sp_OAMethod @http, 'SetRequestHeader', NULL, 'Authorization', '{{apiKey}}'
    EXEC sp_OAMethod @http, 'SetRequestHeader', NULL, 'Accept', 'application/json'

    DECLARE @resp int
    EXEC sp_OAMethod @http, 'QuickRequestParams', @resp OUT, 'GET', 'https://api.easybill.de/rest/v1/customers', @queryParams
    EXEC sp_OAGetProperty @http, 'LastMethodSuccess', @iTmp0 OUT
    IF @iTmp0 = 0
      BEGIN
        EXEC sp_OAGetProperty @http, 'LastErrorText', @sTmp0 OUT
        PRINT @sTmp0
        EXEC @hr = sp_OADestroy @http
        EXEC @hr = sp_OADestroy @queryParams
        RETURN
      END

    DECLARE @sbResponseBody int
    -- Use "Chilkat_9_5_0.StringBuilder" for versions of Chilkat < 10.0.0
    EXEC @hr = sp_OACreate 'Chilkat.StringBuilder', @sbResponseBody OUT

    EXEC sp_OAMethod @resp, 'GetBodySb', @success OUT, @sbResponseBody

    DECLARE @jResp int
    -- Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0
    EXEC @hr = sp_OACreate 'Chilkat.JsonObject', @jResp OUT

    EXEC sp_OAMethod @jResp, 'LoadSb', @success OUT, @sbResponseBody
    EXEC sp_OASetProperty @jResp, 'EmitCompact', 0


    PRINT 'Response Body:'
    EXEC sp_OAMethod @jResp, 'Emit', @sTmp0 OUT
    PRINT @sTmp0

    DECLARE @respStatusCode int
    EXEC sp_OAGetProperty @resp, 'StatusCode', @respStatusCode OUT

    PRINT 'Response Status Code = ' + @respStatusCode
    IF @respStatusCode >= 400
      BEGIN

        PRINT 'Response Header:'
        EXEC sp_OAGetProperty @resp, 'Header', @sTmp0 OUT
        PRINT @sTmp0

        PRINT 'Failed.'
        EXEC @hr = sp_OADestroy @resp

        EXEC @hr = sp_OADestroy @http
        EXEC @hr = sp_OADestroy @queryParams
        EXEC @hr = sp_OADestroy @sbResponseBody
        EXEC @hr = sp_OADestroy @jResp
        RETURN
      END
    EXEC @hr = sp_OADestroy @resp

    -- Sample JSON response:
    -- (Sample code for parsing the JSON response is shown below)

    -- {
    --   "page": "<integer>",
    --   "pages": "<integer>",
    --   "limit": "<integer>",
    --   "total": "<integer>",
    --   "items": [
    --     {
    --       "last_name": "<string>",
    --       "company_name": "<string>",
    --       "acquire_options": 7,
    --       "additional_groups_ids": [
    --         "<integer>",
    --         "<integer>"
    --       ],
    --       "bank_account": "<string>",
    --       "bank_account_owner": "<string>",
    --       "bank_bic": "<string>",
    --       "bank_code": "<string>",
    --       "bank_iban": "<string>",
    --       "bank_name": "<string>",
    --       "birth_date": "<date>",
    --       "cash_allowance": "<float>",
    --       "cash_allowance_days": 7,
    --       "cash_discount": "<float>",
    --       "cash_discount_type": "PERCENT",
    --       "city": "<string>",
    --       "state": "<string>",
    --       "country": "<string>",
    --       "created_at": "<date>",
    --       "updated_at": "<string>",
    --       "delivery_title": "<string>",
    --       "delivery_city": "<string>",
    --       "delivery_state": "<string>",
    --       "delivery_company_name": "<string>",
    --       "delivery_country": "<string>",
    --       "delivery_first_name": "<string>",
    --       "delivery_last_name": "<string>",
    --       "delivery_personal": "<boolean>",
    --       "delivery_salutation": 0,
    --       "delivery_street": "<string>",
    --       "delivery_suffix_1": "<string>",
    --       "delivery_suffix_2": "<string>",
    --       "delivery_zip_code": "<string>",
    --       "display_name": "<string>",
    --       "emails": [
    --         "<string>",
    --         "<string>"
    --       ],
    --       "fax": "<string>",
    --       "first_name": "<string>",
    --       "grace_period": "<integer>",
    --       "due_in_days": "<integer>",
    --       "group_id": "<integer>",
    --       "id": "<long>",
    --       "info_1": "<string>",
    --       "info_2": "<string>",
    --       "internet": "<string>",
    --       "login_id": "<long>",
    --       "mobile": "<string>",
    --       "note": "<string>",
    --       "number": "<string>",
    --       "payment_options": 3,
    --       "personal": false,
    --       "phone_1": "<string>",
    --       "phone_2": "<string>",
    --       "postbox": "<string>",
    --       "postbox_city": "<string>",
    --       "postbox_state": "<string>",
    --       "postbox_country": "<string>",
    --       "postbox_zip_code": "<string>",
    --       "sale_price_level": "SALEPRICE10",
    --       "salutation": 0,
    --       "sepa_agreement": "COR1",
    --       "sepa_agreement_date": "<date>",
    --       "sepa_mandate_reference": "<string>",
    --       "since_date": "<date>",
    --       "street": "<string>",
    --       "suffix_1": "<string>",
    --       "suffix_2": "<string>",
    --       "tax_number": "<string>",
    --       "court": "<string>",
    --       "court_registry_number": "<string>",
    --       "tax_options": "sStfr",
    --       "title": "<string>",
    --       "archived": "<boolean>",
    --       "vat_identifier": "<string>",
    --       "zip_code": "<string>",
    --       "document_pdf_type": "default",
    --       "buyer_reference": "<string>",
    --       "foreign_supplier_number": "<string>"
    --     },
    --     {
    --       "last_name": "<string>",
    --       "company_name": "<string>",
    --       "acquire_options": 7,
    --       "additional_groups_ids": [
    --         "<integer>",
    --         "<integer>"
    --       ],
    --       "bank_account": "<string>",
    --       "bank_account_owner": "<string>",
    --       "bank_bic": "<string>",
    --       "bank_code": "<string>",
    --       "bank_iban": "<string>",
    --       "bank_name": "<string>",
    --       "birth_date": "<date>",
    --       "cash_allowance": "<float>",
    --       "cash_allowance_days": 7,
    --       "cash_discount": "<float>",
    --       "cash_discount_type": "PERCENT",
    --       "city": "<string>",
    --       "state": "<string>",
    --       "country": "<string>",
    --       "created_at": "<date>",
    --       "updated_at": "<string>",
    --       "delivery_title": "<string>",
    --       "delivery_city": "<string>",
    --       "delivery_state": "<string>",
    --       "delivery_company_name": "<string>",
    --       "delivery_country": "<string>",
    --       "delivery_first_name": "<string>",
    --       "delivery_last_name": "<string>",
    --       "delivery_personal": "<boolean>",
    --       "delivery_salutation": 0,
    --       "delivery_street": "<string>",
    --       "delivery_suffix_1": "<string>",
    --       "delivery_suffix_2": "<string>",
    --       "delivery_zip_code": "<string>",
    --       "display_name": "<string>",
    --       "emails": [
    --         "<string>",
    --         "<string>"
    --       ],
    --       "fax": "<string>",
    --       "first_name": "<string>",
    --       "grace_period": "<integer>",
    --       "due_in_days": "<integer>",
    --       "group_id": "<integer>",
    --       "id": "<long>",
    --       "info_1": "<string>",
    --       "info_2": "<string>",
    --       "internet": "<string>",
    --       "login_id": "<long>",
    --       "mobile": "<string>",
    --       "note": "<string>",
    --       "number": "<string>",
    --       "payment_options": 3,
    --       "personal": false,
    --       "phone_1": "<string>",
    --       "phone_2": "<string>",
    --       "postbox": "<string>",
    --       "postbox_city": "<string>",
    --       "postbox_state": "<string>",
    --       "postbox_country": "<string>",
    --       "postbox_zip_code": "<string>",
    --       "sale_price_level": "SALEPRICE6",
    --       "salutation": 0,
    --       "sepa_agreement": "NULL",
    --       "sepa_agreement_date": "<date>",
    --       "sepa_mandate_reference": "<string>",
    --       "since_date": "<date>",
    --       "street": "<string>",
    --       "suffix_1": "<string>",
    --       "suffix_2": "<string>",
    --       "tax_number": "<string>",
    --       "court": "<string>",
    --       "court_registry_number": "<string>",
    --       "tax_options": "nStb",
    --       "title": "<string>",
    --       "archived": "<boolean>",
    --       "vat_identifier": "<string>",
    --       "zip_code": "<string>",
    --       "document_pdf_type": "default",
    --       "buyer_reference": "<string>",
    --       "foreign_supplier_number": "<string>"
    --     }
    --   ]
    -- }

    -- Sample code for parsing the JSON response...
    -- Use this online tool to generate parsing code from sample JSON: Generate JSON Parsing Code

    DECLARE @last_name nvarchar(4000)

    DECLARE @company_name nvarchar(4000)

    DECLARE @acquire_options int

    DECLARE @bank_account nvarchar(4000)

    DECLARE @bank_account_owner nvarchar(4000)

    DECLARE @bank_bic nvarchar(4000)

    DECLARE @bank_code nvarchar(4000)

    DECLARE @bank_iban nvarchar(4000)

    DECLARE @bank_name nvarchar(4000)

    DECLARE @birth_date nvarchar(4000)

    DECLARE @cash_allowance nvarchar(4000)

    DECLARE @cash_allowance_days int

    DECLARE @cash_discount nvarchar(4000)

    DECLARE @cash_discount_type nvarchar(4000)

    DECLARE @city nvarchar(4000)

    DECLARE @state nvarchar(4000)

    DECLARE @country nvarchar(4000)

    DECLARE @created_at nvarchar(4000)

    DECLARE @updated_at nvarchar(4000)

    DECLARE @delivery_title nvarchar(4000)

    DECLARE @delivery_city nvarchar(4000)

    DECLARE @delivery_state nvarchar(4000)

    DECLARE @delivery_company_name nvarchar(4000)

    DECLARE @delivery_country nvarchar(4000)

    DECLARE @delivery_first_name nvarchar(4000)

    DECLARE @delivery_last_name nvarchar(4000)

    DECLARE @delivery_personal nvarchar(4000)

    DECLARE @delivery_salutation int

    DECLARE @delivery_street nvarchar(4000)

    DECLARE @delivery_suffix_1 nvarchar(4000)

    DECLARE @delivery_suffix_2 nvarchar(4000)

    DECLARE @delivery_zip_code nvarchar(4000)

    DECLARE @display_name nvarchar(4000)

    DECLARE @fax nvarchar(4000)

    DECLARE @first_name nvarchar(4000)

    DECLARE @grace_period nvarchar(4000)

    DECLARE @due_in_days nvarchar(4000)

    DECLARE @group_id nvarchar(4000)

    DECLARE @id nvarchar(4000)

    DECLARE @info_1 nvarchar(4000)

    DECLARE @info_2 nvarchar(4000)

    DECLARE @internet nvarchar(4000)

    DECLARE @login_id nvarchar(4000)

    DECLARE @mobile nvarchar(4000)

    DECLARE @note nvarchar(4000)

    DECLARE @v_number nvarchar(4000)

    DECLARE @payment_options int

    DECLARE @personal int

    DECLARE @phone_1 nvarchar(4000)

    DECLARE @phone_2 nvarchar(4000)

    DECLARE @postbox nvarchar(4000)

    DECLARE @postbox_city nvarchar(4000)

    DECLARE @postbox_state nvarchar(4000)

    DECLARE @postbox_country nvarchar(4000)

    DECLARE @postbox_zip_code nvarchar(4000)

    DECLARE @sale_price_level nvarchar(4000)

    DECLARE @salutation int

    DECLARE @sepa_agreement nvarchar(4000)

    DECLARE @sepa_agreement_date nvarchar(4000)

    DECLARE @sepa_mandate_reference nvarchar(4000)

    DECLARE @since_date nvarchar(4000)

    DECLARE @street nvarchar(4000)

    DECLARE @suffix_1 nvarchar(4000)

    DECLARE @suffix_2 nvarchar(4000)

    DECLARE @tax_number nvarchar(4000)

    DECLARE @court nvarchar(4000)

    DECLARE @court_registry_number nvarchar(4000)

    DECLARE @tax_options nvarchar(4000)

    DECLARE @title nvarchar(4000)

    DECLARE @archived nvarchar(4000)

    DECLARE @vat_identifier nvarchar(4000)

    DECLARE @zip_code nvarchar(4000)

    DECLARE @document_pdf_type nvarchar(4000)

    DECLARE @buyer_reference nvarchar(4000)

    DECLARE @foreign_supplier_number nvarchar(4000)

    DECLARE @j int

    DECLARE @count_j int

    DECLARE @strVal nvarchar(4000)

    DECLARE @page nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @page OUT, 'page'
    DECLARE @pages nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @pages OUT, 'pages'
    DECLARE @limit nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @limit OUT, 'limit'
    DECLARE @total nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @total OUT, 'total'
    DECLARE @i int
    SELECT @i = 0
    DECLARE @count_i int
    EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_i OUT, 'items'
    WHILE @i < @count_i
      BEGIN
        EXEC sp_OASetProperty @jResp, 'I', @i
        EXEC sp_OAMethod @jResp, 'StringOf', @last_name OUT, 'items[i].last_name'
        EXEC sp_OAMethod @jResp, 'StringOf', @company_name OUT, 'items[i].company_name'
        EXEC sp_OAMethod @jResp, 'IntOf', @acquire_options OUT, 'items[i].acquire_options'
        EXEC sp_OAMethod @jResp, 'StringOf', @bank_account OUT, 'items[i].bank_account'
        EXEC sp_OAMethod @jResp, 'StringOf', @bank_account_owner OUT, 'items[i].bank_account_owner'
        EXEC sp_OAMethod @jResp, 'StringOf', @bank_bic OUT, 'items[i].bank_bic'
        EXEC sp_OAMethod @jResp, 'StringOf', @bank_code OUT, 'items[i].bank_code'
        EXEC sp_OAMethod @jResp, 'StringOf', @bank_iban OUT, 'items[i].bank_iban'
        EXEC sp_OAMethod @jResp, 'StringOf', @bank_name OUT, 'items[i].bank_name'
        EXEC sp_OAMethod @jResp, 'StringOf', @birth_date OUT, 'items[i].birth_date'
        EXEC sp_OAMethod @jResp, 'StringOf', @cash_allowance OUT, 'items[i].cash_allowance'
        EXEC sp_OAMethod @jResp, 'IntOf', @cash_allowance_days OUT, 'items[i].cash_allowance_days'
        EXEC sp_OAMethod @jResp, 'StringOf', @cash_discount OUT, 'items[i].cash_discount'
        EXEC sp_OAMethod @jResp, 'StringOf', @cash_discount_type OUT, 'items[i].cash_discount_type'
        EXEC sp_OAMethod @jResp, 'StringOf', @city OUT, 'items[i].city'
        EXEC sp_OAMethod @jResp, 'StringOf', @state OUT, 'items[i].state'
        EXEC sp_OAMethod @jResp, 'StringOf', @country OUT, 'items[i].country'
        EXEC sp_OAMethod @jResp, 'StringOf', @created_at OUT, 'items[i].created_at'
        EXEC sp_OAMethod @jResp, 'StringOf', @updated_at OUT, 'items[i].updated_at'
        EXEC sp_OAMethod @jResp, 'StringOf', @delivery_title OUT, 'items[i].delivery_title'
        EXEC sp_OAMethod @jResp, 'StringOf', @delivery_city OUT, 'items[i].delivery_city'
        EXEC sp_OAMethod @jResp, 'StringOf', @delivery_state OUT, 'items[i].delivery_state'
        EXEC sp_OAMethod @jResp, 'StringOf', @delivery_company_name OUT, 'items[i].delivery_company_name'
        EXEC sp_OAMethod @jResp, 'StringOf', @delivery_country OUT, 'items[i].delivery_country'
        EXEC sp_OAMethod @jResp, 'StringOf', @delivery_first_name OUT, 'items[i].delivery_first_name'
        EXEC sp_OAMethod @jResp, 'StringOf', @delivery_last_name OUT, 'items[i].delivery_last_name'
        EXEC sp_OAMethod @jResp, 'StringOf', @delivery_personal OUT, 'items[i].delivery_personal'
        EXEC sp_OAMethod @jResp, 'IntOf', @delivery_salutation OUT, 'items[i].delivery_salutation'
        EXEC sp_OAMethod @jResp, 'StringOf', @delivery_street OUT, 'items[i].delivery_street'
        EXEC sp_OAMethod @jResp, 'StringOf', @delivery_suffix_1 OUT, 'items[i].delivery_suffix_1'
        EXEC sp_OAMethod @jResp, 'StringOf', @delivery_suffix_2 OUT, 'items[i].delivery_suffix_2'
        EXEC sp_OAMethod @jResp, 'StringOf', @delivery_zip_code OUT, 'items[i].delivery_zip_code'
        EXEC sp_OAMethod @jResp, 'StringOf', @display_name OUT, 'items[i].display_name'
        EXEC sp_OAMethod @jResp, 'StringOf', @fax OUT, 'items[i].fax'
        EXEC sp_OAMethod @jResp, 'StringOf', @first_name OUT, 'items[i].first_name'
        EXEC sp_OAMethod @jResp, 'StringOf', @grace_period OUT, 'items[i].grace_period'
        EXEC sp_OAMethod @jResp, 'StringOf', @due_in_days OUT, 'items[i].due_in_days'
        EXEC sp_OAMethod @jResp, 'StringOf', @group_id OUT, 'items[i].group_id'
        EXEC sp_OAMethod @jResp, 'StringOf', @id OUT, 'items[i].id'
        EXEC sp_OAMethod @jResp, 'StringOf', @info_1 OUT, 'items[i].info_1'
        EXEC sp_OAMethod @jResp, 'StringOf', @info_2 OUT, 'items[i].info_2'
        EXEC sp_OAMethod @jResp, 'StringOf', @internet OUT, 'items[i].internet'
        EXEC sp_OAMethod @jResp, 'StringOf', @login_id OUT, 'items[i].login_id'
        EXEC sp_OAMethod @jResp, 'StringOf', @mobile OUT, 'items[i].mobile'
        EXEC sp_OAMethod @jResp, 'StringOf', @note OUT, 'items[i].note'
        EXEC sp_OAMethod @jResp, 'StringOf', @v_number OUT, 'items[i].number'
        EXEC sp_OAMethod @jResp, 'IntOf', @payment_options OUT, 'items[i].payment_options'
        EXEC sp_OAMethod @jResp, 'BoolOf', @personal OUT, 'items[i].personal'
        EXEC sp_OAMethod @jResp, 'StringOf', @phone_1 OUT, 'items[i].phone_1'
        EXEC sp_OAMethod @jResp, 'StringOf', @phone_2 OUT, 'items[i].phone_2'
        EXEC sp_OAMethod @jResp, 'StringOf', @postbox OUT, 'items[i].postbox'
        EXEC sp_OAMethod @jResp, 'StringOf', @postbox_city OUT, 'items[i].postbox_city'
        EXEC sp_OAMethod @jResp, 'StringOf', @postbox_state OUT, 'items[i].postbox_state'
        EXEC sp_OAMethod @jResp, 'StringOf', @postbox_country OUT, 'items[i].postbox_country'
        EXEC sp_OAMethod @jResp, 'StringOf', @postbox_zip_code OUT, 'items[i].postbox_zip_code'
        EXEC sp_OAMethod @jResp, 'StringOf', @sale_price_level OUT, 'items[i].sale_price_level'
        EXEC sp_OAMethod @jResp, 'IntOf', @salutation OUT, 'items[i].salutation'
        EXEC sp_OAMethod @jResp, 'StringOf', @sepa_agreement OUT, 'items[i].sepa_agreement'
        EXEC sp_OAMethod @jResp, 'StringOf', @sepa_agreement_date OUT, 'items[i].sepa_agreement_date'
        EXEC sp_OAMethod @jResp, 'StringOf', @sepa_mandate_reference OUT, 'items[i].sepa_mandate_reference'
        EXEC sp_OAMethod @jResp, 'StringOf', @since_date OUT, 'items[i].since_date'
        EXEC sp_OAMethod @jResp, 'StringOf', @street OUT, 'items[i].street'
        EXEC sp_OAMethod @jResp, 'StringOf', @suffix_1 OUT, 'items[i].suffix_1'
        EXEC sp_OAMethod @jResp, 'StringOf', @suffix_2 OUT, 'items[i].suffix_2'
        EXEC sp_OAMethod @jResp, 'StringOf', @tax_number OUT, 'items[i].tax_number'
        EXEC sp_OAMethod @jResp, 'StringOf', @court OUT, 'items[i].court'
        EXEC sp_OAMethod @jResp, 'StringOf', @court_registry_number OUT, 'items[i].court_registry_number'
        EXEC sp_OAMethod @jResp, 'StringOf', @tax_options OUT, 'items[i].tax_options'
        EXEC sp_OAMethod @jResp, 'StringOf', @title OUT, 'items[i].title'
        EXEC sp_OAMethod @jResp, 'StringOf', @archived OUT, 'items[i].archived'
        EXEC sp_OAMethod @jResp, 'StringOf', @vat_identifier OUT, 'items[i].vat_identifier'
        EXEC sp_OAMethod @jResp, 'StringOf', @zip_code OUT, 'items[i].zip_code'
        EXEC sp_OAMethod @jResp, 'StringOf', @document_pdf_type OUT, 'items[i].document_pdf_type'
        EXEC sp_OAMethod @jResp, 'StringOf', @buyer_reference OUT, 'items[i].buyer_reference'
        EXEC sp_OAMethod @jResp, 'StringOf', @foreign_supplier_number OUT, 'items[i].foreign_supplier_number'
        SELECT @j = 0
        EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_j OUT, 'items[i].additional_groups_ids'
        WHILE @j < @count_j
          BEGIN
            EXEC sp_OASetProperty @jResp, 'J', @j
            EXEC sp_OAMethod @jResp, 'StringOf', @strVal OUT, 'items[i].additional_groups_ids[j]'
            SELECT @j = @j + 1
          END
        SELECT @j = 0
        EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_j OUT, 'items[i].emails'
        WHILE @j < @count_j
          BEGIN
            EXEC sp_OASetProperty @jResp, 'J', @j
            EXEC sp_OAMethod @jResp, 'StringOf', @strVal OUT, 'items[i].emails[j]'
            SELECT @j = @j + 1
          END
        SELECT @i = @i + 1
      END

    EXEC @hr = sp_OADestroy @http
    EXEC @hr = sp_OADestroy @queryParams
    EXEC @hr = sp_OADestroy @sbResponseBody
    EXEC @hr = sp_OADestroy @jResp


END
GO

Curl Command

curl -G -d "limit=%3Cinteger%3E"
	-d "page=%3Cinteger%3E"
	-d "group_id=%3Cstring%3E"
	-d "additional_group_id=%3Cstring%3E"
	-d "number=%3Cstring%3E"
	-d "country=%3Cstring%3E"
	-d "zip_code=%3Cstring%3E"
	-d "emails=%3Cstring%3E"
	-d "first_name=%3Cstring%3E"
	-d "last_name=%3Cstring%3E"
	-d "company_name=%3Cstring%3E"
	-d "created_at=%3Cstring%3E"
	-H "Authorization: {{apiKey}}"
	-H "Accept: application/json"
https://api.easybill.de/rest/v1/customers

Postman Collection Item JSON

{
  "name": "Fetch customers list",
  "request": {
    "method": "GET",
    "header": [
      {
        "key": "Accept",
        "value": "application/json"
      }
    ],
    "url": {
      "raw": "{{baseUrl}}/customers?limit=<integer>&page=<integer>&group_id=<string>&additional_group_id=<string>&number=<string>&country=<string>&zip_code=<string>&emails=<string>&first_name=<string>&last_name=<string>&company_name=<string>&created_at=<string>",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "customers"
      ],
      "query": [
        {
          "key": "limit",
          "value": "<integer>",
          "description": "Limited the result. Default is 100. Maximum can be 1000."
        },
        {
          "key": "page",
          "value": "<integer>",
          "description": "Set current Page. Default is 1."
        },
        {
          "key": "group_id",
          "value": "<string>",
          "description": "Filter customers by group_id. You can add multiple group ids separate by comma like id,id,id."
        },
        {
          "key": "additional_group_id",
          "value": "<string>",
          "description": "Filter customers by additional_group_id. You can add multiple group ids separate by comma like id,id,id."
        },
        {
          "key": "number",
          "value": "<string>",
          "description": "Filter customers by number. You can add multiple numbers separate by comma like no,no,no."
        },
        {
          "key": "country",
          "value": "<string>",
          "description": "Filter customers by country. You can add multiple countries separate by comma like DE,PL,FR."
        },
        {
          "key": "zip_code",
          "value": "<string>",
          "description": "Filter customers by zip_code. You can add multiple zip codes separate by comma like zip,zip,zip."
        },
        {
          "key": "emails",
          "value": "<string>",
          "description": "Filter customers by emails. You can add multiple emails separate by comma like mail,mail,mail."
        },
        {
          "key": "first_name",
          "value": "<string>",
          "description": "Filter customers by first_name. You can add multiple names separate by comma like name,name,name."
        },
        {
          "key": "last_name",
          "value": "<string>",
          "description": "Filter customers by first_name. You can add multiple names separate by comma like name,name,name."
        },
        {
          "key": "company_name",
          "value": "<string>",
          "description": "Filter customers by first_name. You can add multiple names separate by comma like name,name,name."
        },
        {
          "key": "created_at",
          "value": "<string>",
          "description": "Filter customers by created_at. You can filter one date with created_at=2014-12-10 or between like 2015-01-01,2015-12-31."
        }
      ]
    }
  },
  "response": [
    {
      "name": "Successful operation",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          },
          {
            "description": "Added as a part of security scheme: apikey",
            "key": "Authorization",
            "value": "<API Key>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/customers?limit=<integer>&page=<integer>&group_id=<string>&additional_group_id=<string>&number=<string>&country=<string>&zip_code=<string>&emails=<string>&first_name=<string>&last_name=<string>&company_name=<string>&created_at=<string>",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "customers"
          ],
          "query": [
            {
              "key": "limit",
              "value": "<integer>",
              "description": "Limited the result. Default is 100. Maximum can be 1000."
            },
            {
              "key": "page",
              "value": "<integer>",
              "description": "Set current Page. Default is 1."
            },
            {
              "key": "group_id",
              "value": "<string>",
              "description": "Filter customers by group_id. You can add multiple group ids separate by comma like id,id,id."
            },
            {
              "key": "additional_group_id",
              "value": "<string>",
              "description": "Filter customers by additional_group_id. You can add multiple group ids separate by comma like id,id,id."
            },
            {
              "key": "number",
              "value": "<string>",
              "description": "Filter customers by number. You can add multiple numbers separate by comma like no,no,no."
            },
            {
              "key": "country",
              "value": "<string>",
              "description": "Filter customers by country. You can add multiple countries separate by comma like DE,PL,FR."
            },
            {
              "key": "zip_code",
              "value": "<string>",
              "description": "Filter customers by zip_code. You can add multiple zip codes separate by comma like zip,zip,zip."
            },
            {
              "key": "emails",
              "value": "<string>",
              "description": "Filter customers by emails. You can add multiple emails separate by comma like mail,mail,mail."
            },
            {
              "key": "first_name",
              "value": "<string>",
              "description": "Filter customers by first_name. You can add multiple names separate by comma like name,name,name."
            },
            {
              "key": "last_name",
              "value": "<string>",
              "description": "Filter customers by first_name. You can add multiple names separate by comma like name,name,name."
            },
            {
              "key": "company_name",
              "value": "<string>",
              "description": "Filter customers by first_name. You can add multiple names separate by comma like name,name,name."
            },
            {
              "key": "created_at",
              "value": "<string>",
              "description": "Filter customers by created_at. You can filter one date with created_at=2014-12-10 or between like 2015-01-01,2015-12-31."
            }
          ]
        }
      },
      "status": "OK",
      "code": 200,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n  \"page\": \"<integer>\",\n  \"pages\": \"<integer>\",\n  \"limit\": \"<integer>\",\n  \"total\": \"<integer>\",\n  \"items\": [\n    {\n      \"last_name\": \"<string>\",\n      \"company_name\": \"<string>\",\n      \"acquire_options\": 7,\n      \"additional_groups_ids\": [\n        \"<integer>\",\n        \"<integer>\"\n      ],\n      \"bank_account\": \"<string>\",\n      \"bank_account_owner\": \"<string>\",\n      \"bank_bic\": \"<string>\",\n      \"bank_code\": \"<string>\",\n      \"bank_iban\": \"<string>\",\n      \"bank_name\": \"<string>\",\n      \"birth_date\": \"<date>\",\n      \"cash_allowance\": \"<float>\",\n      \"cash_allowance_days\": 7,\n      \"cash_discount\": \"<float>\",\n      \"cash_discount_type\": \"PERCENT\",\n      \"city\": \"<string>\",\n      \"state\": \"<string>\",\n      \"country\": \"<string>\",\n      \"created_at\": \"<date>\",\n      \"updated_at\": \"<string>\",\n      \"delivery_title\": \"<string>\",\n      \"delivery_city\": \"<string>\",\n      \"delivery_state\": \"<string>\",\n      \"delivery_company_name\": \"<string>\",\n      \"delivery_country\": \"<string>\",\n      \"delivery_first_name\": \"<string>\",\n      \"delivery_last_name\": \"<string>\",\n      \"delivery_personal\": \"<boolean>\",\n      \"delivery_salutation\": 0,\n      \"delivery_street\": \"<string>\",\n      \"delivery_suffix_1\": \"<string>\",\n      \"delivery_suffix_2\": \"<string>\",\n      \"delivery_zip_code\": \"<string>\",\n      \"display_name\": \"<string>\",\n      \"emails\": [\n        \"<string>\",\n        \"<string>\"\n      ],\n      \"fax\": \"<string>\",\n      \"first_name\": \"<string>\",\n      \"grace_period\": \"<integer>\",\n      \"due_in_days\": \"<integer>\",\n      \"group_id\": \"<integer>\",\n      \"id\": \"<long>\",\n      \"info_1\": \"<string>\",\n      \"info_2\": \"<string>\",\n      \"internet\": \"<string>\",\n      \"login_id\": \"<long>\",\n      \"mobile\": \"<string>\",\n      \"note\": \"<string>\",\n      \"number\": \"<string>\",\n      \"payment_options\": 3,\n      \"personal\": false,\n      \"phone_1\": \"<string>\",\n      \"phone_2\": \"<string>\",\n      \"postbox\": \"<string>\",\n      \"postbox_city\": \"<string>\",\n      \"postbox_state\": \"<string>\",\n      \"postbox_country\": \"<string>\",\n      \"postbox_zip_code\": \"<string>\",\n      \"sale_price_level\": \"SALEPRICE10\",\n      \"salutation\": 0,\n      \"sepa_agreement\": \"COR1\",\n      \"sepa_agreement_date\": \"<date>\",\n      \"sepa_mandate_reference\": \"<string>\",\n      \"since_date\": \"<date>\",\n      \"street\": \"<string>\",\n      \"suffix_1\": \"<string>\",\n      \"suffix_2\": \"<string>\",\n      \"tax_number\": \"<string>\",\n      \"court\": \"<string>\",\n      \"court_registry_number\": \"<string>\",\n      \"tax_options\": \"sStfr\",\n      \"title\": \"<string>\",\n      \"archived\": \"<boolean>\",\n      \"vat_identifier\": \"<string>\",\n      \"zip_code\": \"<string>\",\n      \"document_pdf_type\": \"default\",\n      \"buyer_reference\": \"<string>\",\n      \"foreign_supplier_number\": \"<string>\"\n    },\n    {\n      \"last_name\": \"<string>\",\n      \"company_name\": \"<string>\",\n      \"acquire_options\": 7,\n      \"additional_groups_ids\": [\n        \"<integer>\",\n        \"<integer>\"\n      ],\n      \"bank_account\": \"<string>\",\n      \"bank_account_owner\": \"<string>\",\n      \"bank_bic\": \"<string>\",\n      \"bank_code\": \"<string>\",\n      \"bank_iban\": \"<string>\",\n      \"bank_name\": \"<string>\",\n      \"birth_date\": \"<date>\",\n      \"cash_allowance\": \"<float>\",\n      \"cash_allowance_days\": 7,\n      \"cash_discount\": \"<float>\",\n      \"cash_discount_type\": \"PERCENT\",\n      \"city\": \"<string>\",\n      \"state\": \"<string>\",\n      \"country\": \"<string>\",\n      \"created_at\": \"<date>\",\n      \"updated_at\": \"<string>\",\n      \"delivery_title\": \"<string>\",\n      \"delivery_city\": \"<string>\",\n      \"delivery_state\": \"<string>\",\n      \"delivery_company_name\": \"<string>\",\n      \"delivery_country\": \"<string>\",\n      \"delivery_first_name\": \"<string>\",\n      \"delivery_last_name\": \"<string>\",\n      \"delivery_personal\": \"<boolean>\",\n      \"delivery_salutation\": 0,\n      \"delivery_street\": \"<string>\",\n      \"delivery_suffix_1\": \"<string>\",\n      \"delivery_suffix_2\": \"<string>\",\n      \"delivery_zip_code\": \"<string>\",\n      \"display_name\": \"<string>\",\n      \"emails\": [\n        \"<string>\",\n        \"<string>\"\n      ],\n      \"fax\": \"<string>\",\n      \"first_name\": \"<string>\",\n      \"grace_period\": \"<integer>\",\n      \"due_in_days\": \"<integer>\",\n      \"group_id\": \"<integer>\",\n      \"id\": \"<long>\",\n      \"info_1\": \"<string>\",\n      \"info_2\": \"<string>\",\n      \"internet\": \"<string>\",\n      \"login_id\": \"<long>\",\n      \"mobile\": \"<string>\",\n      \"note\": \"<string>\",\n      \"number\": \"<string>\",\n      \"payment_options\": 3,\n      \"personal\": false,\n      \"phone_1\": \"<string>\",\n      \"phone_2\": \"<string>\",\n      \"postbox\": \"<string>\",\n      \"postbox_city\": \"<string>\",\n      \"postbox_state\": \"<string>\",\n      \"postbox_country\": \"<string>\",\n      \"postbox_zip_code\": \"<string>\",\n      \"sale_price_level\": \"SALEPRICE6\",\n      \"salutation\": 0,\n      \"sepa_agreement\": \"NULL\",\n      \"sepa_agreement_date\": \"<date>\",\n      \"sepa_mandate_reference\": \"<string>\",\n      \"since_date\": \"<date>\",\n      \"street\": \"<string>\",\n      \"suffix_1\": \"<string>\",\n      \"suffix_2\": \"<string>\",\n      \"tax_number\": \"<string>\",\n      \"court\": \"<string>\",\n      \"court_registry_number\": \"<string>\",\n      \"tax_options\": \"nStb\",\n      \"title\": \"<string>\",\n      \"archived\": \"<boolean>\",\n      \"vat_identifier\": \"<string>\",\n      \"zip_code\": \"<string>\",\n      \"document_pdf_type\": \"default\",\n      \"buyer_reference\": \"<string>\",\n      \"foreign_supplier_number\": \"<string>\"\n    }\n  ]\n}"
    },
    {
      "name": "Too Many Requests",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "description": "Added as a part of security scheme: apikey",
            "key": "Authorization",
            "value": "<API Key>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/customers?limit=<integer>&page=<integer>&group_id=<string>&additional_group_id=<string>&number=<string>&country=<string>&zip_code=<string>&emails=<string>&first_name=<string>&last_name=<string>&company_name=<string>&created_at=<string>",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "customers"
          ],
          "query": [
            {
              "key": "limit",
              "value": "<integer>",
              "description": "Limited the result. Default is 100. Maximum can be 1000."
            },
            {
              "key": "page",
              "value": "<integer>",
              "description": "Set current Page. Default is 1."
            },
            {
              "key": "group_id",
              "value": "<string>",
              "description": "Filter customers by group_id. You can add multiple group ids separate by comma like id,id,id."
            },
            {
              "key": "additional_group_id",
              "value": "<string>",
              "description": "Filter customers by additional_group_id. You can add multiple group ids separate by comma like id,id,id."
            },
            {
              "key": "number",
              "value": "<string>",
              "description": "Filter customers by number. You can add multiple numbers separate by comma like no,no,no."
            },
            {
              "key": "country",
              "value": "<string>",
              "description": "Filter customers by country. You can add multiple countries separate by comma like DE,PL,FR."
            },
            {
              "key": "zip_code",
              "value": "<string>",
              "description": "Filter customers by zip_code. You can add multiple zip codes separate by comma like zip,zip,zip."
            },
            {
              "key": "emails",
              "value": "<string>",
              "description": "Filter customers by emails. You can add multiple emails separate by comma like mail,mail,mail."
            },
            {
              "key": "first_name",
              "value": "<string>",
              "description": "Filter customers by first_name. You can add multiple names separate by comma like name,name,name."
            },
            {
              "key": "last_name",
              "value": "<string>",
              "description": "Filter customers by first_name. You can add multiple names separate by comma like name,name,name."
            },
            {
              "key": "company_name",
              "value": "<string>",
              "description": "Filter customers by first_name. You can add multiple names separate by comma like name,name,name."
            },
            {
              "key": "created_at",
              "value": "<string>",
              "description": "Filter customers by created_at. You can filter one date with created_at=2014-12-10 or between like 2015-01-01,2015-12-31."
            }
          ]
        }
      },
      "status": "Too Many Requests",
      "code": 429,
      "_postman_previewlanguage": "text",
      "header": [
      ],
      "cookie": [
      ],
      "body": ""
    }
  ]
}