Skip to content

Latest commit

 

History

History
325 lines (222 loc) · 9.8 KB

CategoriesApi.md

File metadata and controls

325 lines (222 loc) · 9.8 KB

OpenAPI\Client\CategoriesApi

All URIs are relative to https://api.pocketsmith.com/v2, except if the operation defines another base path.

Method HTTP request Description
categoriesIdDelete() DELETE /categories/{id} Delete category
categoriesIdGet() GET /categories/{id} Get category
categoriesIdPut() PUT /categories/{id} Update category
usersIdCategoriesGet() GET /users/{id}/categories List categories in user
usersIdCategoriesPost() POST /users/{id}/categories Create category in user

categoriesIdDelete()

categoriesIdDelete($id)

Delete category

Deletes a particular category by its ID. This will delete all budgets within the category, and uncategorize all transactions assigned to the category.

Example

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


// Configure API key authorization: developerKey
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Developer-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Developer-Key', 'Bearer');


$apiInstance = new OpenAPI\Client\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
);
$id = 42; // int | The unique identifier of the category.

try {
    $apiInstance->categoriesIdDelete($id);
} catch (Exception $e) {
    echo 'Exception when calling CategoriesApi->categoriesIdDelete: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
id int The unique identifier of the category.

Return type

void (empty response body)

Authorization

developerKey

HTTP request headers

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

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

categoriesIdGet()

categoriesIdGet($id): \OpenAPI\Client\Model\Category

Get category

Gets a particular category by its ID.

Example

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


// Configure API key authorization: developerKey
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Developer-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Developer-Key', 'Bearer');


$apiInstance = new OpenAPI\Client\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
);
$id = 42; // int | The unique identifier of the category.

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

Parameters

Name Type Description Notes
id int The unique identifier of the category.

Return type

\OpenAPI\Client\Model\Category

Authorization

developerKey

HTTP request headers

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

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

categoriesIdPut()

categoriesIdPut($id, $categories_id_put_request): \OpenAPI\Client\Model\Category

Update category

Updates a category by its ID.

Example

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


// Configure API key authorization: developerKey
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Developer-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Developer-Key', 'Bearer');


$apiInstance = new OpenAPI\Client\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
);
$id = 42; // int | The unique identifier of the category.
$categories_id_put_request = new \OpenAPI\Client\Model\CategoriesIdPutRequest(); // \OpenAPI\Client\Model\CategoriesIdPutRequest

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

Parameters

Name Type Description Notes
id int The unique identifier of the category.
categories_id_put_request \OpenAPI\Client\Model\CategoriesIdPutRequest [optional]

Return type

\OpenAPI\Client\Model\Category

Authorization

developerKey

HTTP request headers

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

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

usersIdCategoriesGet()

usersIdCategoriesGet($id): \OpenAPI\Client\Model\Category[]

List categories in user

Lists all categories belonging to a user by their ID.

Example

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


// Configure API key authorization: developerKey
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Developer-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Developer-Key', 'Bearer');


$apiInstance = new OpenAPI\Client\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
);
$id = 42; // int | The unique identifier of the user.

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

Parameters

Name Type Description Notes
id int The unique identifier of the user.

Return type

\OpenAPI\Client\Model\Category[]

Authorization

developerKey

HTTP request headers

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

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

usersIdCategoriesPost()

usersIdCategoriesPost($id, $users_id_categories_post_request): \OpenAPI\Client\Model\Category

Create category in user

Creates a category belonging to the user by their ID.

Example

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


// Configure API key authorization: developerKey
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Developer-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Developer-Key', 'Bearer');


$apiInstance = new OpenAPI\Client\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
);
$id = 42; // int | The unique identifier of the user.
$users_id_categories_post_request = new \OpenAPI\Client\Model\UsersIdCategoriesPostRequest(); // \OpenAPI\Client\Model\UsersIdCategoriesPostRequest

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

Parameters

Name Type Description Notes
id int The unique identifier of the user.
users_id_categories_post_request \OpenAPI\Client\Model\UsersIdCategoriesPostRequest [optional]

Return type

\OpenAPI\Client\Model\Category

Authorization

developerKey

HTTP request headers

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

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