go-monobank/docs/DefaultApi.md
2024-04-10 22:21:45 +03:00

7.9 KiB
Raw Permalink Blame History

\DefaultApi

All URIs are relative to https://api.monobank.ua

Method HTTP request Description
BankCurrencyGet Get /bank/currency Отримання курсів валют
PersonalClientInfoGet Get /personal/client-info Інформація про клієнта
PersonalStatementAccountFromToGet Get /personal/statement/{account}/{from}/{to} Виписка
PersonalWebhookPost Post /personal/webhook Встановлення WebHook

BankCurrencyGet

[]CurrencyInfoInner BankCurrencyGet(ctx).Execute()

Отримання курсів валют

Example

package main

import (
	"context"
	"fmt"
	"os"
	monobankclient "gitea.stuzer.link/stuzer05/go-monobank"
)

func main() {

	configuration := monobankclient.NewConfiguration()
	apiClient := monobankclient.NewAPIClient(configuration)
	resp, r, err := apiClient.DefaultApi.BankCurrencyGet(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.BankCurrencyGet``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `BankCurrencyGet`: []CurrencyInfoInner
	fmt.Fprintf(os.Stdout, "Response from `DefaultApi.BankCurrencyGet`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

Other parameters are passed through a pointer to a apiBankCurrencyGetRequest struct via the builder pattern

Return type

**[]CurrencyInfoInner**

Authorization

No authorization required

HTTP request headers

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

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

PersonalClientInfoGet

UserInfo PersonalClientInfoGet(ctx).XToken(xToken).Execute()

Інформація про клієнта

Example

package main

import (
	"context"
	"fmt"
	"os"
	monobankclient "gitea.stuzer.link/stuzer05/go-monobank"
)

func main() {
	xToken := "u3AulkpZFI1lIuGsik6vuPsVWqN7GoWs6o_MO2sdf301" // string | Token для особистого доступу до API

	configuration := monobankclient.NewConfiguration()
	apiClient := monobankclient.NewAPIClient(configuration)
	resp, r, err := apiClient.DefaultApi.PersonalClientInfoGet(context.Background()).XToken(xToken).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.PersonalClientInfoGet``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `PersonalClientInfoGet`: UserInfo
	fmt.Fprintf(os.Stdout, "Response from `DefaultApi.PersonalClientInfoGet`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiPersonalClientInfoGetRequest struct via the builder pattern

Name Type Description Notes
xToken string Token для особистого доступу до API

Return type

UserInfo

Authorization

No authorization required

HTTP request headers

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

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

PersonalStatementAccountFromToGet

[]StatementItemsInner PersonalStatementAccountFromToGet(ctx, account, from, to).XToken(xToken).Execute()

Виписка

Example

package main

import (
	"context"
	"fmt"
	"os"
	monobankclient "gitea.stuzer.link/stuzer05/go-monobank"
)

func main() {
	xToken := "xToken_example" // string | Token для особистого доступу до API
	account := "account_example" // string | Ідентифікатор рахунку або банки з переліків Statement list або 0 - дефолтний рахунок.
	from := "1546304461" // string | Початок часу виписки.
	to := "1546306461" // string | Останній час виписки (якщо відсутній, буде використовуватись поточний час). (optional)

	configuration := monobankclient.NewConfiguration()
	apiClient := monobankclient.NewAPIClient(configuration)
	resp, r, err := apiClient.DefaultApi.PersonalStatementAccountFromToGet(context.Background(), account, from, to).XToken(xToken).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.PersonalStatementAccountFromToGet``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `PersonalStatementAccountFromToGet`: []StatementItemsInner
	fmt.Fprintf(os.Stdout, "Response from `DefaultApi.PersonalStatementAccountFromToGet`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
account string Ідентифікатор рахунку або банки з переліків Statement list або 0 - дефолтний рахунок.
from string Початок часу виписки.
to string Останній час виписки (якщо відсутній, буде використовуватись поточний час).

Other Parameters

Other parameters are passed through a pointer to a apiPersonalStatementAccountFromToGetRequest struct via the builder pattern

Name Type Description Notes
xToken string Token для особистого доступу до API

Return type

**[]StatementItemsInner**

Authorization

No authorization required

HTTP request headers

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

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

PersonalWebhookPost

PersonalWebhookPost(ctx).XToken(xToken).SetWebHook(setWebHook).Execute()

Встановлення WebHook

Example

package main

import (
	"context"
	"fmt"
	"os"
	monobankclient "gitea.stuzer.link/stuzer05/go-monobank"
)

func main() {
	xToken := "xToken_example" // string | Token для особистого доступу до API
	setWebHook := *monobankclient.NewSetWebHook() // SetWebHook | 

	configuration := monobankclient.NewConfiguration()
	apiClient := monobankclient.NewAPIClient(configuration)
	r, err := apiClient.DefaultApi.PersonalWebhookPost(context.Background()).XToken(xToken).SetWebHook(setWebHook).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.PersonalWebhookPost``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiPersonalWebhookPostRequest struct via the builder pattern

Name Type Description Notes
xToken string Token для особистого доступу до API
setWebHook SetWebHook

Return type

(empty response body)

Authorization

No authorization required

HTTP request headers

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

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