Skip to content

Microsoft Business Center REST (oData) client

Notifications You must be signed in to change notification settings

spysystem/msbc-rest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenAPIClient-php

The Microsoft Business Center API is a RESTful API that provides an interface to the Microsoft Business Center service.

Installation & Usage

Requirements

PHP 7.4 and later. Should also work with PHP 8.0.

Composer

To install the bindings via Composer, add the following to composer.json:

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/spysystem/msbc-rest.git"
    }
  ],
  "require": {
    "spysystem/msbc-rest": "*@dev"
  }
}

Then run composer install

Manual Installation

Download the files and include autoload.php:

<?php
require_once('/path/to/OpenAPIClient-php/vendor/autoload.php');

Getting Started

Please follow the installation procedure and then run the following:

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




$apiInstance = new Spy\MsbcRestClient\Api\AuthenticateApi(
    // 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()
);
$grant_type = 'client_credentials'; // string
$client_id = 'b8f8f8f8-f8f8-f8f8-f8f8-f8f8f8f8f8f8'; // string
$client_secret = 'b8f8f8f8-f8f8-f8f8-f8f8-f8f8f8f8f8f8'; // string
$scope = 'https://api.businesscentral.dynamics.com/.default'; // string

try {
    $result = $apiInstance->authenticate($grant_type, $client_id, $client_secret, $scope);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AuthenticateApi->authenticate: ', $e->getMessage(), PHP_EOL;
}

API Endpoints

All URIs are relative to https://api.businesscentral.dynamics.com/v2.0/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/Production/ODataV4/Company(&#39;XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&#39;)

Class Method HTTP request Description
AuthenticateApi authenticate POST /token
BatchApi callBatchService POST /$batch
CompanyApi getCompanies GET /companies
JournalLinesPageApi deleteTempJournalLine DELETE /journalLines(&#39;{id}&#39;)
SpyApplyCustomerTemplatesCodeUnitApi applyCustomerTemplates POST /SpyApplyCustomerTemplates_ApplyTemplates
SpyCalcCustomerBalanceCodeUnitApi calcCustomerBalance POST /SpyCalcCustomerBalance_calcCustomerBalance
SpyCountryPageApi createSpyCountry POST /SpyCountryPage
SpyCountryPageApi deleteSpyCountry DELETE /SpyCountryPage(&#39;{Code}&#39;)
SpyCountryPageApi editSpyCountry PATCH /SpyCountryPage(&#39;{Code}&#39;)
SpyCountryPageApi getSpyCountries GET /SpyCountryPage
SpyCountryPageApi getSpyCountry GET /SpyCountryPage(&#39;{Code}&#39;)
SpyCustLedgerPageApi createCustomerLedgerEntry POST /SpyCustLedgerPage
SpyCustLedgerPageApi deleteCustomerLedgerEntry DELETE /SpyCustLedgerPage({Entry_No})
SpyCustLedgerPageApi editCustomerLedgerEntry PATCH /SpyCustLedgerPage({Entry_No})
SpyCustLedgerPageApi getCustomerLedgerEntries GET /SpyCustLedgerPage
SpyCustLedgerPageApi getCustomerLedgerEntry GET /SpyCustLedgerPage({Entry_No})
SpyCustomerPageApi createCustomer POST /SpyCustomer
SpyCustomerPageApi deleteCustomer DELETE /SpyCustomer(&#39;{account}&#39;)
SpyCustomerPageApi editCustomer PATCH /SpyCustomer(&#39;{account}&#39;)
SpyCustomerPageApi getCustomer GET /SpyCustomer(&#39;{account}&#39;)
SpyCustomerPageApi getCustomers GET /SpyCustomer
SpyCustomerTemplatePageApi createCustomerTemplate POST /SpyCustomerTemplate
SpyCustomerTemplatePageApi deleteCustomerTemplate DELETE /SpyCustomerTemplate(&#39;{Code}&#39;)
SpyCustomerTemplatePageApi editCustomerTemplate PATCH /SpyCustomerTemplate(&#39;{Code}&#39;)
SpyCustomerTemplatePageApi getCustomerTemplate GET /SpyCustomerTemplate(&#39;{Code}&#39;)
SpyCustomerTemplatePageApi getCustomerTemplates GET /SpyCustomerTemplate
SpyCustomerTransPageApi createCustomerTransaction POST /SpyCustomerTrans
SpyCustomerTransPageApi deleteCustomerTransaction DELETE /SpyCustomerTrans({Entry_No})
SpyCustomerTransPageApi editCustomerTransaction PATCH /SpyCustomerTrans({Entry_No})
SpyCustomerTransPageApi getCustomerTransaction GET /SpyCustomerTrans({Entry_No})
SpyCustomerTransPageApi getCustomerTransactions GET /SpyCustomerTrans
SpyDefaultDimensionPageApi createDefaultDimension POST /SpyDefaultDimension
SpyDefaultDimensionPageApi deleteDefaultDimension DELETE /SpyDefaultDimension({TableID},&#39;{No}&#39;,&#39;{DimensionCode}&#39;)
SpyDefaultDimensionPageApi editDefaultDimension PATCH /SpyDefaultDimension({TableID},&#39;{No}&#39;,&#39;{DimensionCode}&#39;)
SpyDefaultDimensionPageApi getDefaultDimension GET /SpyDefaultDimension({TableID},&#39;{No}&#39;,&#39;{DimensionCode}&#39;)
SpyDefaultDimensionPageApi getDefaultDimensions GET /SpyDefaultDimension
SpyExchangeRatesPageApi createExchangeRate POST /SpyExchangeRates
SpyExchangeRatesPageApi deleteExchangeRate DELETE /SpyExchangeRates(&#39;{CurrencyCode}&#39;,{StartingDate})
SpyExchangeRatesPageApi editExchangeRate PATCH /SpyExchangeRates(&#39;{CurrencyCode}&#39;,{StartingDate})
SpyExchangeRatesPageApi getExchangeRate GET /SpyExchangeRates(&#39;{CurrencyCode}&#39;,{StartingDate})
SpyExchangeRatesPageApi getExchangeRates GET /SpyExchangeRates
SpyFieldsPageApi createField POST /SpyFieldsPage
SpyFieldsPageApi deleteField DELETE /SpyFieldsPage({TableNo},{FieldNo})
SpyFieldsPageApi editField PATCH /SpyFieldsPage({TableNo},{FieldNo})
SpyFieldsPageApi getField GET /SpyFieldsPage({TableNo},{FieldNo})
SpyFieldsPageApi getFields GET /SpyFieldsPage
SpyInsertPostCodeCodeUnitApi insertPostCode POST /SpyInsertPostCode_InsertPostCode
SpyJournalPageApi createJournalEntry POST /SpyJournalPage
SpyJournalPageApi deleteJournalEntry DELETE /SpyJournalPage(&#39;{JournalTemplateName}&#39;,&#39;{JournalBatchName}&#39;,{LineNo})
SpyJournalPageApi editJournalEntry PATCH /SpyJournalPage(&#39;{JournalTemplateName}&#39;,&#39;{JournalBatchName}&#39;,{LineNo})
SpyJournalPageApi getJournalEntries GET /SpyJournalPage
SpyJournalPageApi getJournalEntry GET /SpyJournalPage(&#39;{JournalTemplateName}&#39;,&#39;{JournalBatchName}&#39;,{LineNo})
SpyLedgerAccountPageApi createLedgerAccount POST /SpyLedgerAccount
SpyLedgerAccountPageApi deleteLedgerAccount DELETE /SpyLedgerAccount(&#39;{No}&#39;)
SpyLedgerAccountPageApi editLedgerAccount PATCH /SpyLedgerAccount(&#39;{No}&#39;)
SpyLedgerAccountPageApi getLedgerAccount GET /SpyLedgerAccount(&#39;{No}&#39;)
SpyLedgerAccountPageApi getLedgerAccounts GET /SpyLedgerAccount
SpyLedgerTransPageApi createLedgerTransactionEntry POST /SpyLedgerTrans
SpyLedgerTransPageApi deleteLedgerTransactionEntry DELETE /SpyLedgerTrans({Entry_No})
SpyLedgerTransPageApi editLedgerTransactionEntry PATCH /SpyLedgerTrans({Entry_No})
SpyLedgerTransPageApi getLedgerTransactionEntries GET /SpyLedgerTrans
SpyLedgerTransPageApi getLedgerTransactionEntry GET /SpyLedgerTrans({Entry_No})
SpyPaymentTermPageApi createPaymentTerm POST /SpyPaymentTerm
SpyPaymentTermPageApi deletePaymentTerm DELETE /SpyPaymentTerm(&#39;{code}&#39;)
SpyPaymentTermPageApi editPaymentTerm PATCH /SpyPaymentTerm(&#39;{code}&#39;)
SpyPaymentTermPageApi getPaymentTerm GET /SpyPaymentTerm(&#39;{code}&#39;)
SpyPaymentTermPageApi getPaymentTerms GET /SpyPaymentTerm
SpyPostCodePageApi createPostalCode POST /SpyPostCode
SpyPostCodePageApi deletePostalCode DELETE /SpyPostCode(&#39;{Code}&#39;,&#39;{City}&#39;)
SpyPostCodePageApi editPostalCode PATCH /SpyPostCode(&#39;{Code}&#39;,&#39;{City}&#39;)
SpyPostCodePageApi getPostalCode GET /SpyPostCode(&#39;{Code}&#39;,&#39;{City}&#39;)
SpyPostCodePageApi getPostalCodes GET /SpyPostCode
SpySupplierPageApi createSupplier POST /SpySupplier
SpySupplierPageApi deleteSupplier DELETE /SpySupplier(&#39;{No}&#39;)
SpySupplierPageApi editSupplier PATCH /SpySupplier(&#39;{No}&#39;)
SpySupplierPageApi getSupplier GET /SpySupplier(&#39;{No}&#39;)
SpySupplierPageApi getSuppliers GET /SpySupplier
SpySupplierTransPageApi createSupplierTransaction POST /SpySupplierTrans
SpySupplierTransPageApi deleteSupplierTransaction DELETE /SpySupplierTrans({Entry_No})
SpySupplierTransPageApi editSupplierTransaction PATCH /SpySupplierTrans({Entry_No})
SpySupplierTransPageApi getSupplierTransaction GET /SpySupplierTrans({Entry_No})
SpySupplierTransPageApi getSupplierTransactions GET /SpySupplierTrans
SpyTemplateLinePageApi createTemplateLine POST /SpyTemplateLine
SpyTemplateLinePageApi deleteTemplateLine DELETE /SpyTemplateLine(&#39;{Template}&#39;,{LineNo})
SpyTemplateLinePageApi editTemplateLine PATCH /SpyTemplateLine(&#39;{Template}&#39;,{LineNo})
SpyTemplateLinePageApi getTemplateLine GET /SpyTemplateLine(&#39;{Template}&#39;,{LineNo})
SpyTemplateLinePageApi getTemplateLines GET /SpyTemplateLine
SpyVatPostingSetupPageApi createSpyVatSetting POST /SpyVatPostingSetup
SpyVatPostingSetupPageApi deleteSpyVatSetting DELETE /SpyVatPostingSetup(&#39;{VatBusPostingGroup}&#39;,&#39;{VatProdPostingGroup}&#39;)
SpyVatPostingSetupPageApi editSpyVatSetting PATCH /SpyVatPostingSetup(&#39;{VatBusPostingGroup}&#39;,&#39;{VatProdPostingGroup}&#39;)
SpyVatPostingSetupPageApi getSpyVatSetting GET /SpyVatPostingSetup(&#39;{VatBusPostingGroup}&#39;,&#39;{VatProdPostingGroup}&#39;)
SpyVatPostingSetupPageApi getSpyVatSettings GET /SpyVatPostingSetup
SpyVendLedgerPageApi createSupplierLedgerEntry POST /SpyVendLedgerPage
SpyVendLedgerPageApi deleteSupplierLedgerEntry DELETE /SpyVendLedgerPage({Entry_No})
SpyVendLedgerPageApi editSupplierLedgerEntry PATCH /SpyVendLedgerPage({Entry_No})
SpyVendLedgerPageApi getSupplierLedgerEntries GET /SpyVendLedgerPage
SpyVendLedgerPageApi getSupplierLedgerEntry GET /SpyVendLedgerPage({Entry_No})
TempJournalLinesPageApi commitToJournalLine POST /SpyCreateJournalLine_commitToJournalLine
TempJournalLinesPageApi commitToJournalLineWithFileData POST /SpyCreateJournalLine_commitToJournalLineWithFileData
TempJournalLinesPageApi createTempJournalLine POST /journalLines
TempJournalLinesPageApi deleteAllTempJournalLines POST /SpyCreateJournalLine_deleteAllEntries
TempJournalLinesPageApi editTempJournalLine PATCH /journalLines(&#39;{id}&#39;)
TempJournalLinesPageApi getTempJournalLine GET /journalLines(&#39;{id}&#39;)
TempJournalLinesPageApi getTempJournalLines GET /journalLines

Models

Authorization

Authentication schemes defined for the API:

bearerAuth

  • Type: Bearer authentication

Tests

To run the tests, use:

composer install
vendor/bin/phpunit

Author

About this package

This PHP package is automatically generated by the OpenAPI Generator project:

  • API version: 1.0.0
    • Generator version: 7.6.0
  • Build package: org.openapitools.codegen.languages.PhpClientCodegen

About

Microsoft Business Center REST (oData) client

Resources

Stars

Watchers

Forks

Packages

 
 
 

Languages