ApideckUnifySdk 0.16.0
dotnet add package ApideckUnifySdk --version 0.16.0
NuGet\Install-Package ApideckUnifySdk -Version 0.16.0
<PackageReference Include="ApideckUnifySdk" Version="0.16.0" />
<PackageVersion Include="ApideckUnifySdk" Version="0.16.0" />
<PackageReference Include="ApideckUnifySdk" />
paket add ApideckUnifySdk --version 0.16.0
#r "nuget: ApideckUnifySdk, 0.16.0"
#:package ApideckUnifySdk@0.16.0
#addin nuget:?package=ApideckUnifySdk&version=0.16.0
#tool nuget:?package=ApideckUnifySdk&version=0.16.0
ApideckUnifySdk
SDK Example Usage
Example
using ApideckUnifySdk;
using ApideckUnifySdk.Models.Components;
using ApideckUnifySdk.Models.Requests;
using System.Collections.Generic;
var sdk = new Apideck(
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
apiKey: "<YOUR_BEARER_TOKEN_HERE>"
);
AccountingTaxRatesAllRequest req = new AccountingTaxRatesAllRequest() {
ServiceId = "salesforce",
Filter = new TaxRatesFilter() {
Assets = true,
Equity = true,
Expenses = true,
Liabilities = true,
Revenue = true,
},
PassThrough = new Dictionary<string, object>() {
{ "search", "San Francisco" },
},
Fields = "id,updated_at",
};
AccountingTaxRatesAllResponse? res = await sdk.Accounting.TaxRates.ListAsync(req);
while(res != null)
{
// handle items
res = await res.Next!();
}
Authentication
Per-Client Security Schemes
This SDK supports the following security scheme globally:
Name | Type | Scheme |
---|---|---|
ApiKey |
http | HTTP Bearer |
To authenticate with the API the ApiKey
parameter must be set when initializing the SDK client instance. For example:
using ApideckUnifySdk;
using ApideckUnifySdk.Models.Components;
using ApideckUnifySdk.Models.Requests;
using System.Collections.Generic;
var sdk = new Apideck(
apiKey: "<YOUR_BEARER_TOKEN_HERE>",
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX"
);
AccountingTaxRatesAllRequest req = new AccountingTaxRatesAllRequest() {
ServiceId = "salesforce",
Filter = new TaxRatesFilter() {
Assets = true,
Equity = true,
Expenses = true,
Liabilities = true,
Revenue = true,
},
PassThrough = new Dictionary<string, object>() {
{ "search", "San Francisco" },
},
Fields = "id,updated_at",
};
AccountingTaxRatesAllResponse? res = await sdk.Accounting.TaxRates.ListAsync(req);
while(res != null)
{
// handle items
res = await res.Next!();
}
Pagination
Some of the endpoints in this SDK support pagination. To use pagination, you make your SDK calls as usual, but the
returned response object will have a Next
method that can be called to pull down the next group of results. If the
return value of Next
is null
, then there are no more pages to be fetched.
Here's an example of one such pagination call:
using ApideckUnifySdk;
using ApideckUnifySdk.Models.Components;
using ApideckUnifySdk.Models.Requests;
using System.Collections.Generic;
var sdk = new Apideck(
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
apiKey: "<YOUR_BEARER_TOKEN_HERE>"
);
AccountingTaxRatesAllRequest req = new AccountingTaxRatesAllRequest() {
ServiceId = "salesforce",
Filter = new TaxRatesFilter() {
Assets = true,
Equity = true,
Expenses = true,
Liabilities = true,
Revenue = true,
},
PassThrough = new Dictionary<string, object>() {
{ "search", "San Francisco" },
},
Fields = "id,updated_at",
};
AccountingTaxRatesAllResponse? res = await sdk.Accounting.TaxRates.ListAsync(req);
while(res != null)
{
// handle items
res = await res.Next!();
}
Retries
Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.
To change the default retry strategy for a single API call, simply pass a RetryConfig
to the call:
using ApideckUnifySdk;
using ApideckUnifySdk.Models.Components;
using ApideckUnifySdk.Models.Requests;
using System.Collections.Generic;
var sdk = new Apideck(
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
apiKey: "<YOUR_BEARER_TOKEN_HERE>"
);
AccountingTaxRatesAllRequest req = new AccountingTaxRatesAllRequest() {
ServiceId = "salesforce",
Filter = new TaxRatesFilter() {
Assets = true,
Equity = true,
Expenses = true,
Liabilities = true,
Revenue = true,
},
PassThrough = new Dictionary<string, object>() {
{ "search", "San Francisco" },
},
Fields = "id,updated_at",
};
AccountingTaxRatesAllResponse? res = await sdk.Accounting.TaxRates.ListAsync(
retryConfig: new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: new BackoffStrategy(
initialIntervalMs: 1L,
maxIntervalMs: 50L,
maxElapsedTimeMs: 100L,
exponent: 1.1
),
retryConnectionErrors: false
),
request: req
);
while(res != null)
{
// handle items
res = await res.Next!();
}
If you'd like to override the default retry strategy for all operations that support retries, you can use the RetryConfig
optional parameter when intitializing the SDK:
using ApideckUnifySdk;
using ApideckUnifySdk.Models.Components;
using ApideckUnifySdk.Models.Requests;
using System.Collections.Generic;
var sdk = new Apideck(
retryConfig: new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: new BackoffStrategy(
initialIntervalMs: 1L,
maxIntervalMs: 50L,
maxElapsedTimeMs: 100L,
exponent: 1.1
),
retryConnectionErrors: false
),
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
apiKey: "<YOUR_BEARER_TOKEN_HERE>"
);
AccountingTaxRatesAllRequest req = new AccountingTaxRatesAllRequest() {
ServiceId = "salesforce",
Filter = new TaxRatesFilter() {
Assets = true,
Equity = true,
Expenses = true,
Liabilities = true,
Revenue = true,
},
PassThrough = new Dictionary<string, object>() {
{ "search", "San Francisco" },
},
Fields = "id,updated_at",
};
AccountingTaxRatesAllResponse? res = await sdk.Accounting.TaxRates.ListAsync(req);
while(res != null)
{
// handle items
res = await res.Next!();
}
Error Handling
ApideckError
is the base exception class for all HTTP error responses. It has the following properties:
Property | Type | Description |
---|---|---|
Message |
string | Error message |
Request |
HttpRequestMessage | HTTP request object |
Response |
HttpResponseMessage | HTTP response object |
Some exceptions in this SDK include an additional Payload
field, which will contain deserialized custom error data when present. Possible exceptions are listed in the Error Classes section.
Example
using ApideckUnifySdk;
using ApideckUnifySdk.Models.Components;
using ApideckUnifySdk.Models.Errors;
using ApideckUnifySdk.Models.Requests;
using System.Collections.Generic;
var sdk = new Apideck(
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
apiKey: "<YOUR_BEARER_TOKEN_HERE>"
);
try
{
AccountingTaxRatesAllRequest req = new AccountingTaxRatesAllRequest() {
ServiceId = "salesforce",
Filter = new TaxRatesFilter() {
Assets = true,
Equity = true,
Expenses = true,
Liabilities = true,
Revenue = true,
},
PassThrough = new Dictionary<string, object>() {
{ "search", "San Francisco" },
},
Fields = "id,updated_at",
};
AccountingTaxRatesAllResponse? res = await sdk.Accounting.TaxRates.ListAsync(req);
while(res != null)
{
// handle items
res = await res.Next!();
}
}
catch (ApideckError ex) // all SDK exceptions inherit from ApideckError
{
// ex.ToString() provides a detailed error message
System.Console.WriteLine(ex);
// Base exception fields
HttpRequestMessage request = ex.Request;
HttpResponseMessage response = ex.Response;
var statusCode = (int)response.StatusCode;
var responseBody = ex.Body;
if (ex is BadRequestResponse) // different exceptions may be thrown depending on the method
{
// Check error data fields
BadRequestResponsePayload payload = ex.Payload;
double StatusCode = payload.StatusCode;
string Error = payload.Error;
// ...
}
// An underlying cause may be provided
if (ex.InnerException != null)
{
Exception cause = ex.InnerException;
}
}
catch (System.Net.Http.HttpRequestException ex)
{
// Check ex.InnerException for Network connectivity errors
}
Error Classes
Primary exceptions:
ApideckError
: The base class for HTTP error responses.UnauthorizedResponse
: Unauthorized. Status code401
.PaymentRequiredResponse
: Payment Required. Status code402
.NotFoundResponse
: The specified resource was not found. Status code404
. *BadRequestResponse
: Bad Request. Status code400
. *UnprocessableResponse
: Unprocessable. Status code422
. *
<details><summary>Less common exceptions (2)</summary>
System.Net.Http.HttpRequestException
: Network connectivity error. For more details about the underlying cause, inspect theex.InnerException
.Inheriting from
ApideckError
:ResponseValidationError
: Thrown when the response data could not be deserialized into the expected type. </details>
* Refer to the relevant documentation to determine whether an exception applies to a specific operation.
Server Selection
Override Server URL Per-Client
The default server can be overridden globally by passing a URL to the serverUrl: string
optional parameter when initializing the SDK client instance. For example:
using ApideckUnifySdk;
using ApideckUnifySdk.Models.Components;
using ApideckUnifySdk.Models.Requests;
using System.Collections.Generic;
var sdk = new Apideck(
serverUrl: "https://unify.apideck.com",
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
apiKey: "<YOUR_BEARER_TOKEN_HERE>"
);
AccountingTaxRatesAllRequest req = new AccountingTaxRatesAllRequest() {
ServiceId = "salesforce",
Filter = new TaxRatesFilter() {
Assets = true,
Equity = true,
Expenses = true,
Liabilities = true,
Revenue = true,
},
PassThrough = new Dictionary<string, object>() {
{ "search", "San Francisco" },
},
Fields = "id,updated_at",
};
AccountingTaxRatesAllResponse? res = await sdk.Accounting.TaxRates.ListAsync(req);
while(res != null)
{
// handle items
res = await res.Next!();
}
Override Server URL Per-Operation
The server URL can also be overridden on a per-operation basis, provided a server list was specified for the operation. For example:
using ApideckUnifySdk;
using ApideckUnifySdk.Models.Components;
using ApideckUnifySdk.Models.Requests;
using System;
var sdk = new Apideck(
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
apiKey: "<YOUR_BEARER_TOKEN_HERE>"
);
AccountingAttachmentsUploadRequest req = new AccountingAttachmentsUploadRequest() {
ReferenceType = AttachmentReferenceType.Invoice,
ReferenceId = "123456",
XApideckMetadata = "{\"name\":\"document.pdf\",\"description\":\"Invoice attachment\"}",
ServiceId = "salesforce",
RequestBody = System.Text.Encoding.UTF8.GetBytes("0x506D4BD16D"),
};
var res = await sdk.Accounting.Attachments.UploadAsync(
request: req,
serverUrl: "https://upload.apideck.com"
);
// handle response
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- newtonsoft.json (>= 13.0.3)
- nodatime (>= 3.1.9)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
0.16.0 | 194 | 10/1/2025 |
0.15.1 | 242 | 9/23/2025 |
0.15.0 | 290 | 9/8/2025 |
0.14.0 | 341 | 8/25/2025 |
0.13.4 | 262 | 8/21/2025 |
0.13.3 | 158 | 8/21/2025 |
0.13.2 | 145 | 8/20/2025 |
0.13.1 | 953 | 8/13/2025 |
0.13.0 | 242 | 8/6/2025 |
0.12.5 | 560 | 7/22/2025 |
0.12.3 | 175 | 7/14/2025 |
0.12.2 | 429 | 7/9/2025 |
0.12.1 | 179 | 6/26/2025 |
0.12.0 | 156 | 6/23/2025 |
0.11.2 | 354 | 6/10/2025 |
0.11.1 | 171 | 6/3/2025 |
0.11.0 | 134 | 5/30/2025 |
0.10.4 | 175 | 5/26/2025 |
0.10.3 | 162 | 5/22/2025 |
0.10.2 | 246 | 5/15/2025 |
0.10.1 | 215 | 4/28/2025 |
0.10.0 | 412 | 4/22/2025 |
0.9.0 | 218 | 4/11/2025 |
0.8.0 | 7,940 | 4/4/2025 |
0.7.2 | 497 | 3/24/2025 |
0.7.1 | 180 | 3/19/2025 |
0.7.0 | 183 | 3/18/2025 |
0.6.0 | 14,630 | 3/12/2025 |
0.5.4 | 246 | 3/5/2025 |
0.5.3 | 181 | 2/24/2025 |
0.5.2 | 136 | 2/20/2025 |
0.5.1 | 361 | 2/5/2025 |
0.5.0 | 318 | 1/27/2025 |
0.4.1 | 216 | 1/21/2025 |
0.4.0 | 147 | 1/21/2025 |
0.3.1 | 129 | 1/14/2025 |
0.3.0 | 132 | 1/14/2025 |
0.2.2 | 147 | 1/2/2025 |
0.2.1 | 143 | 12/27/2024 |
0.2.0 | 154 | 12/17/2024 |
0.1.0 | 185 | 12/13/2024 |
0.0.5 | 146 | 12/11/2024 |
0.0.4 | 164 | 12/6/2024 |
0.0.3 | 169 | 12/5/2024 |
0.0.2 | 162 | 12/5/2024 |