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 |
\YNAB\Model\CategoriesResponse getCategories($budgetId)
List categories
Returns all categories grouped by category group.
<?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;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
budgetId | string | The ID of the Budget. "last-used" can also be used to specify the last used budget. |
\YNAB\Model\CategoriesResponse
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\YNAB\Model\CategoryResponse getCategoryById($budgetId, $categoryId)
Single category
Returns a single category
<?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;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
budgetId | string | The ID of the Budget. "last-used" can also be used to specify the last used budget. | |
categoryId | string | The ID of the Category. |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]