Skip to content
This repository has been archived by the owner on Jan 30, 2024. It is now read-only.

Latest commit

 

History

History
122 lines (86 loc) · 4.12 KB

CategoriesApi.md

File metadata and controls

122 lines (86 loc) · 4.12 KB

YNAB\CategoriesApi

All URIs are relative to https://api.youneedabudget.com/v1

Method HTTP request Description
getCategories GET /budgets/{budget_id}/categories List categories
getCategoryById GET /budgets/{budget_id}/categories/{category_id} Single category

getCategories

\YNAB\Model\CategoriesResponse getCategories($budgetId)

List categories

Returns all categories grouped by category group.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: bearer
$config = YNAB\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = YNAB\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');

$apiInstance = new YNAB\Api\CategoriesApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$budgetId = "budgetId_example"; // string | The ID of the Budget.  \"last-used\" can also be used to specify the last used budget.

try {
    $result = $apiInstance->getCategories($budgetId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CategoriesApi->getCategories: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
budgetId string The ID of the Budget. &quot;last-used&quot; can also be used to specify the last used budget.

Return type

\YNAB\Model\CategoriesResponse

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

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

getCategoryById

\YNAB\Model\CategoryResponse getCategoryById($budgetId, $categoryId)

Single category

Returns a single category

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: bearer
$config = YNAB\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = YNAB\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');

$apiInstance = new YNAB\Api\CategoriesApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$budgetId = "budgetId_example"; // string | The ID of the Budget.  \"last-used\" can also be used to specify the last used budget.
$categoryId = "categoryId_example"; // string | The ID of the Category.

try {
    $result = $apiInstance->getCategoryById($budgetId, $categoryId);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CategoriesApi->getCategoryById: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
budgetId string The ID of the Budget. &quot;last-used&quot; can also be used to specify the last used budget.
categoryId string The ID of the Category.

Return type

\YNAB\Model\CategoryResponse

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

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