smartConnectors SDK Reference
Cross-platform libraries and domain classes for integrating with smartObjx services. Not just DTOs — rich domain objects with built-in validation and behavior.
Installation
.NET (NuGet)
dotnet add package SmartObjx.Connectors
Or via the NuGet Package Manager:
Install-Package SmartObjx.Connectors
JavaScript / Node.js (npm)
npm install @smartobjx/smart.connectors @smartobjx/smart.objx.models
Two packages: @smartobjx/smart.connectors for API client classes and @smartobjx/smart.objx.models for the domain model classes.
Configuration
SDK clients are configured with a configuration object that holds your API base URL and authentication keys. The configuration class varies by product:
- smartRules and smartStructures use
ApiConfiguration - smartSettings uses
smartConnectorInstace
C# Setup — smartRules / smartStructures
var config = new ApiConfiguration();
config.BasePath = "https://your-api-base-url";
config.ApiKey.Add("Ocp-Apim-Subscription-Key", "your-subscription-key");
config.ApiKey.Add("Ocp-Apim-POV-Key", "your-pov-key");
C# Setup — smartSettings
var config = new smartConnectorInstace();
config.BasePath = "https://your-settings-api-url";
config.ApiKey.Add("Ocp-Apim-Subscription-Key", "your-subscription-key");
config.ApiKey.Add("Ocp-Apim-POV-Key", "your-pov-key");
Sandbox Setup
var config = new ApiConfiguration();
config.BasePath = "https://api.dev.smartobjx.com/settings-demo";
config.ApiKey.Add("Ocp-Apim-Subscription-Key", "fd8efd80-f215-4c73-95f2-23841e98acbd");
config.ApiKey.Add("Ocp-Apim-POV-Key", "45ef2936-160e-47dc-bd17-3dc0060acec9");
API Client Classes
RulesApi
Client for the smartRules service.
| Class | Description |
|---|---|
RulesApi | API client for creating, retrieving, and evaluating rules |
UseCase | Entry point for a body of rules in an application workflow |
RuleSet | Collection of rules or nested rulesets |
Rule | A conditional logic statement (true/false) |
AbstractRule | Base class for Rule and RuleSet |
Factbase | Input data for rule evaluation |
PropositionConstant | A named condition with a truth value |
SettingsApi / ApplicationApi
Clients for the smartSettings service.
| Class | Description |
|---|---|
SettingsApi | API client for configurations, settings, and distributions |
ApplicationApi | API client for application-level operations |
Application | Settings container for an application or module |
Configuration | Collection of settings, supports nesting |
Setting | Individual setting with name, value, type, encryption |
SettingDistribution | Distribution of a setting value across clients |
StructuresApi
Client for the smartStructures service.
| Class | Description |
|---|---|
StructuresApi | API client for perspectives and organizations |
Perspective | Named view of an organizational hierarchy |
Organization | A node in the hierarchy tree |
Tree | Hierarchical arrangement of organizations |
Serialization
smartObjx domain objects use polymorphic serialization with $type discriminators. When sending objects via HTTP directly (without the SDK), include the type information:
{
"$type": "smart.Objx.Rules.RuleSet, smart.Objx.Rules",
"Name": "My RuleSet"
}
When using the SDK classes, serialization is handled automatically via JsonSerializationSettingsFactory:
var payload = JsonConvert.SerializeObject(
ruleSet,
typeof(AbstractRule),
JsonSerializationSettingsFactory.GetSettingsInstance()
);
JavaScript / fetch
If you prefer using fetch() directly instead of the npm packages, all smartObjx APIs follow the same pattern:
const headers = {
'Content-Type': 'application/json',
'Ocp-Apim-Subscription-Key': 'your-subscription-key',
'Ocp-Apim-POV-Key': 'your-pov-key'
};
// GET request
const data = await fetch('https://your-api-base-url/endpoint', {
method: 'GET', headers
}).then(r => r.json());
// POST request
const result = await fetch('https://your-api-base-url/endpoint', {
method: 'POST', headers,
body: JSON.stringify(requestBody)
}).then(r => r.json());
Related
- Authentication — required headers for all API calls
- smartRules API — rules engine endpoints
- smartSettings API — configuration management endpoints
- smartStructures API — organizational hierarchy endpoints
- smartConnectors product page