Interactions API SDKs
Client libraries for the DDx Interactions API, generated from its OpenAPI specification.
The Interactions API moves voter and supporter outreach data — canvass responses, event signups, activist codes, communication consent — from a Source to one or more Destinations. These SDKs give you a typed client for it instead of hand-rolled HTTP.
New to the API itself? Start with the overview and the setup guides.
Available SDKs
| Language | Package | Status |
|---|---|---|
| Python | ddx-interactions-api |
Available |
| Ruby | ddx_interactions_api |
Prerelease |
| Node.js | ddx-interactions-api |
Unreleased |
| C# | Ddx.InteractionsApi |
Unreleased |
Each SDK lives under sdks/<language>/v1/ and is generated from openapi/v1/swagger.json.
Versions are below 1.0 while the API stabilizes, so pin the minor version if you need a stable surface.
Authentication
HTTP Basic, with your API key in the password field and the username left empty. Authentication covers how to request a key.
Every SDK defaults to https://api.movementinfrastructure.org, so none of the
examples below set a host.
Quick start
Posting a batch of interactions, up to 100 per request. Every client takes the API version as its first positional argument, and the response carries a correlation ID for following the batch through the Exchange.
Python
Requires Python 3.8+.
pip install ddx-interactions-apiimport os
import ddx_interactions_api
from ddx_interactions_api.rest import ApiException
configuration = ddx_interactions_api.Configuration(
username="",
password=os.environ["DDX_API_KEY"],
)
with ddx_interactions_api.ApiClient(configuration) as api_client:
interactions = ddx_interactions_api.InteractionsApi(api_client)
payload = ddx_interactions_api.InteractionsDto(
# See sdks/python/v1/docs/InteractionsDto.md for the full shape.
)
try:
result = interactions.vversion_interactions_post("1", interactions_dto=payload)
except ApiException as e:
print(f"Interactions API returned {e.status}: {e.body}")
else:
# The correlation ID follows the batch through the Exchange.
statuses = interactions.vversion_interactions_exchange_status_get(
"1", correlation_id=result.correlation_id
)Ruby
Requires Ruby 3.0+.
gem install ddx_interactions_apirequire "ddx_interactions_api"
config = DdxInteractionsApi::Configuration.new
config.username = ""
config.password = ENV.fetch("DDX_API_KEY")
interactions = DdxInteractionsApi::InteractionsApi.new(
DdxInteractionsApi::ApiClient.new(config)
)
payload = DdxInteractionsApi::InteractionsDto.new(
# See sdks/ruby/v1/docs/InteractionsDto.md for the full shape.
interactions: []
)
begin
result = interactions.vversion_interactions_post("1", interactions_dto: payload)
rescue DdxInteractionsApi::ApiError => e
# The exception message is just the status line; the body says why.
abort "Interactions API returned #{e.code}: #{e.response_body}"
end
# The correlation ID follows the batch through the Exchange.
statuses = interactions.vversion_interactions_exchange_status_get(
"1", correlation_id: result.correlation_id
)C#
Requires .NET 8.0+.
dotnet add package Ddx.InteractionsApiusing Ddx.InteractionsApi.Api;
using Ddx.InteractionsApi.Client;
using Ddx.InteractionsApi.Model;
// BasePath is a full URL, scheme included
var config = new Configuration
{
BasePath = "https://api-dev.movementinfrastructure.org",
Username = "",
Password = Environment.GetEnvironmentVariable("DDX_API_KEY"),
};
var interactions = new InteractionsApi(config);
var payload = new InteractionsDto(
// See sdks/csharp/v1/docs/InteractionsDto.md for the full shape.
interactions: new List<InteractionDto>());
InteractionsBatchResultDto result;
try
{
result = interactions.VversionInteractionsPost("1", payload);
}
catch (ApiException e)
{
// ErrorCode is the status; ErrorContent carries the body that says why.
Console.Error.WriteLine($"Interactions API returned {e.ErrorCode}: {e.ErrorContent}");
throw;
}
// The correlation ID follows the batch through the Exchange.
var statuses = interactions.VversionInteractionsExchangeStatusGet(
"1", correlationId: result.CorrelationId);
### Node.js
Requires Node 18+.
```sh
npm install ddx-interactions-apiimport {
Configuration,
InteractionsApi,
ResponseError,
type InteractionsDto,
} from 'ddx-interactions-api';
const interactions = new InteractionsApi(
new Configuration({
username: '',
password: process.env.DDX_API_KEY,
}),
);
const interactionsDto: InteractionsDto = {
// See sdks/node/v1/src/models/InteractionsDto.ts for the full shape.
interactions: [],
};
let result;
try {
result = await interactions.vversionInteractionsPost({ version: '1', interactionsDto });
} catch (e) {
if (!(e instanceof ResponseError)) throw e;
// The thrown error carries only the status line. The body says why.
throw new Error(`Interactions API returned ${e.response.status}: ${await e.response.text()}`);
}
// The correlation ID follows the batch through the Exchange.
const statuses = await interactions.vversionInteractionsExchangeStatusGet({
version: '1',
correlationId: result?.correlationId,
});Endpoints
Method names are derived from the path and the verb, so they are the same in every language:
| Method | Endpoint |
|---|---|
vversion_interactions_post |
POST /v1/interactions |
vversion_interactions_exchange_status_get |
GET /v1/interactions/exchange-status |
vversion_interactions_exchange_status_range_get |
GET /v1/interactions/exchange-status/range |
vversion_interactions_interaction_id_transactions_get |
GET /v1/interactions/{interactionId}/transactions |
vversion_interactions_transactions_get |
GET /v1/interactions/transactions |
vversion_auth_me_get |
GET /v1/auth/me |
Full models are documented in each SDK's own README: Python, Ruby. A corresponding docs/ directory can be found alongside the README. The interactive reference is at docs.movementinfrastructure.org/reference.
Versioning
SDK versions are semantic; a major bump means the API changed in a way that requires work on your side. Each SDK ships a changelog generated from a diff of the specification, with breaking entries marked: Python, Ruby.
The SDK version tracks the package, not the API. The API version (v1) appears in the request path and changes far less often.
Reporting problems
SDK code is generated, and local edits are overwritten on the next sync — a broken client is almost always a specification bug.
- SDK bugs and questions: open an issue here.
- The API itself, keys, or Destinations: api@demexchange.com.
License
MIT. See LICENSE.
Contributing
A pull request that edits sdks/ directly will not survive the next sync. CONTRIBUTING.md explains where a change actually belongs.