darbiadev_businesscentral.businesscentral_services — Main
Provides BusinessCentralServices
- class darbiadev_businesscentral.businesscentral_services.BusinessCentralServices(base_url: str, tenant_id: str, environment: str, company_name: str, client_id: str, client_secret: str)[source]
This class wraps Business Central’s API.
- make_request(method: str, resource: str, resource_data: Optional[dict[str, str | int | bool]] = None, values: Optional[list[str]] = None, params: Optional[dict[str, str]] = None, etag: Optional[str] = None) dict[source]
Make an authenticated ODataV4 request.
- Parameters
method – The HTTP method
resource – The requested resource
resource_data – The data to update on the resource
values – Resource PK values
params – Extra URL parameters
etag – Resource ETAG
- Returns
The resource data returned by the API
- Return type
dict
- make_unbound_request(codeunit: str, procedure: str, data: dict[str, str]) dict[source]
Make an authenticated ODataV4 request.
- Parameters
codeunit – The requested codeunit
procedure – The requested procedure
data – Data to supply to the procedure
- Returns
The response JSON from the server
- Return type
dict