Skip to content

Latest commit

 

History

History
217 lines (174 loc) · 7.49 KB

SearchApi.md

File metadata and controls

217 lines (174 loc) · 7.49 KB

FireflyIIINet.Api.SearchApi

All URIs are relative to https://demo.firefly-iii.org/api

Method HTTP request Description
SearchAccounts GET /v1/search/accounts Search for accounts
SearchTransactions GET /v1/search/transactions Search for transactions

SearchAccounts

AccountArray SearchAccounts (string query, AccountSearchFieldFilter field, Guid? xTraceId = null, int? page = null, AccountTypeFilter? type = null)

Search for accounts

Search for accounts

Example

using System.Collections.Generic;
using System.Diagnostics;
using FireflyIIINet.Api;
using FireflyIIINet.Client;
using FireflyIIINet.Model;

namespace Example
{
    public class SearchAccountsExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://demo.firefly-iii.org/api";
            // Configure OAuth2 access token for authorization: firefly_iii_auth
            config.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new SearchApi(config);
            var query = checking;  // string | The query you wish to search for.
            var field = new AccountSearchFieldFilter(); // AccountSearchFieldFilter | The account field(s) you want to search in.
            var xTraceId = "xTraceId_example";  // Guid? | Unique identifier associated with this request. (optional) 
            var page = 1;  // int? | Page number. The default pagination is 50 (optional) 
            var type = new AccountTypeFilter?(); // AccountTypeFilter? | The type of accounts you wish to limit the search to. (optional) 

            try
            {
                // Search for accounts
                AccountArray result = apiInstance.SearchAccounts(query, field, xTraceId, page, type);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling SearchApi.SearchAccounts: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the SearchAccountsWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Search for accounts
    ApiResponse<AccountArray> response = apiInstance.SearchAccountsWithHttpInfo(query, field, xTraceId, page, type);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling SearchApi.SearchAccountsWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
query string The query you wish to search for.
field AccountSearchFieldFilter The account field(s) you want to search in.
xTraceId Guid? Unique identifier associated with this request. [optional]
page int? Page number. The default pagination is 50 [optional]
type AccountTypeFilter? The type of accounts you wish to limit the search to. [optional]

Return type

AccountArray

Authorization

firefly_iii_auth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/vnd.api+json, application/json

HTTP response details

Status code Description Response headers
200 A list of accounts. -
401 Unauthenticated -
404 Page not found -
400 Bad request -
500 Internal exception -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

SearchTransactions

TransactionArray SearchTransactions (string query, Guid? xTraceId = null, int? page = null)

Search for transactions

Searches through the users transactions.

Example

using System.Collections.Generic;
using System.Diagnostics;
using FireflyIIINet.Api;
using FireflyIIINet.Client;
using FireflyIIINet.Model;

namespace Example
{
    public class SearchTransactionsExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://demo.firefly-iii.org/api";
            // Configure OAuth2 access token for authorization: firefly_iii_auth
            config.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new SearchApi(config);
            var query = groceries;  // string | The query you wish to search for.
            var xTraceId = "xTraceId_example";  // Guid? | Unique identifier associated with this request. (optional) 
            var page = 1;  // int? | Page number. The default pagination is 50 (optional) 

            try
            {
                // Search for transactions
                TransactionArray result = apiInstance.SearchTransactions(query, xTraceId, page);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling SearchApi.SearchTransactions: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the SearchTransactionsWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Search for transactions
    ApiResponse<TransactionArray> response = apiInstance.SearchTransactionsWithHttpInfo(query, xTraceId, page);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling SearchApi.SearchTransactionsWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
query string The query you wish to search for.
xTraceId Guid? Unique identifier associated with this request. [optional]
page int? Page number. The default pagination is 50 [optional]

Return type

TransactionArray

Authorization

firefly_iii_auth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/vnd.api+json, application/json

HTTP response details

Status code Description Response headers
200 A list of transactions. -
401 Unauthenticated -
404 Page not found -
400 Bad request -
500 Internal exception -

[Back to top] [Back to API list] [Back to Model list] [Back to README]