Campaigns
Campaigns are a way to organize your work. Campaigns are the basic organizing unit in Action Builder. This is where your data on entities, connections, and responses are stored.
Endpoints and URL Structures
https://[your-sub-domain].actionbuilder.org/api/rest/v1/campaigns
Campaign resources live exclusively at the above endpoint. The endpoint returns a collection of all the campaigns associated with your API key.
URL Structures:
https://[your-sub-domain].actionbuilder.org/api/rest/v1/campaigns/[id]
To address a specific campaign, use the resource type name like:
https://techworkersunited.actionbuilder.org/api/v1/rest/campaigns/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3
Back To Top ↑
Field Names and Descriptions
Campaign Fields
Field Name | Type | Description |
---|---|---|
origin_system | string | A human readable string identifying where this campaign originated. |
identifiers | strings[] | An array containing the read-only Action Builder identifier of this resource in the format [system name]:[id] . See the general concepts document for more information about identifiers. |
name | string | The campaign's title. |
created_date | datetime | The date and time the resource was created. System generated, not editable. |
modified_date | datetime | The date and time the resource was last modified. System generated, not editable. |
target_number | string | A number representing how many people you will be attempting to organize. |
total_number | string | A number representing how many people you have organized in this campaign. |
default_entity_type | string | The primary entity type for this campaign. |
archived | boolean | Indicates if the campaign has been archived. System generated, not editable. |
Back To Top ↑
Links
Link Name | Description |
---|---|
self | A link to this individual campaign resource. |
action_builder:entity_types | A link to a collection of all the entity type resources associated with this campaign. Click here for entity types documentation. |
action_builder:connection_types | A link to a collection of all the connection type resources associated with this campaign. Click here for connection types documentation. |
osdi:tags | A link to a collection of all the tag resources associated with this campaign. Click here for tags documentation. |
osdi:people | A link to a collection of all the people resources associated with this campaign. Click here for people documentation. |
Back To Top ↑
Related Resources
Scenario: Retrieving a collection of campaign resources (GET)
Campaign resources are sometimes presented as collections of campaigns. For example, calling the campaigns endpoint will return a collection of all the campaigns associated with that API key.
Request
GET https://techworkersunited.actionbulider.org/api/rest/v1/campaigns
Header:
OSDI-API-Token: your_api_key_here
Response
{
"per_page": 25,
"page": 1,
"total_pages": 458,
"_embedded": {
"action_builder:campaigns": [
{
"origin_system": "Action Builder",
"identifiers": [
"action_builder:32bbbdd2-86af-4832-b203-f384796eaec6"
],
"name": "DC Local Organizing",
"created_date": "2021-12-07T13:56:06.568Z",
"modified_date": "2021-12-07T13:56:15.076Z",
"target_number": 0,
"total_number": 10001,
"archived": false,
"_links": {
"self": {
"href": "https://techworkersunited.actionbuilder.org/api/rest/v1/campaigns/32bbbdd2-86af-4832-b203-f384796eaec6"
},
"action_builder:entity_types": {
"href": "https://techworkersunited.actionbuilder.org/api/rest/v1/campaigns/32bbbdd2-86af-4832-b203-f384796eaec6/entity_types"
},
"action_builder:connection_types": {
"href": "https://techworkersunited.actionbuilder.org/api/rest/v1/campaigns/32bbbdd2-86af-4832-b203-f384796eaec6/connection_types"
},
"osdi:tags": {
"href": "https://techworkersunited.actionbuilder.org/api/rest/v1/campaigns/32bbbdd2-86af-4832-b203-f384796eaec6/tags"
},
"osdi:people": {
"href": "https://techworkersunited.actionbuilder.org/api/rest/v1/campaigns/32bbbdd2-86af-4832-b203-f384796eaec6/people"
}
}
},
{
"origin_system": "Action Builder",
"identifiers": [
"action_builder:12e0d956-3414-418f-87b4-ffcea28d71ce"
],
"name": "MD Local Organizing",
"created_date": "2021-09-28T15:15:58.393Z",
"modified_date": "2021-09-28T15:15:58.393Z",
"target_number": 500,
"total_number": 326,
"archived": false,
"_links": {
"self": {
"href": "https://techworkersunited.actionbuilder.org/api/rest/v1/campaigns/12e0d956-3414-418f-87b4-ffcea28d71ce"
},
"action_builder:entity_types": {
"href": "https://techworkersunited.actionbuilder.org/api/rest/v1/campaigns/12e0d956-3414-418f-87b4-ffcea28d71ce/entity_types"
},
"action_builder:connection_types": {
"href": "https://techworkersunited.actionbuilder.org/api/rest/v1/campaigns/12e0d956-3414-418f-87b4-ffcea28d71ce/connection_types"
},
"osdi:tags": {
"href": "https://techworkersunited.actionbuilder.org/api/rest/v1/campaigns/12e0d956-3414-418f-87b4-ffcea28d71ce/tags"
},
"osdi:people": {
"href": "https://techworkersunited.actionbuilder.org/api/rest/v1/campaigns/12e0d956-3414-418f-87b4-ffcea28d71ce/people"
}
}
},
//truncated for brevity
]
},
"_links": {
"self": {
"href": "https://techworkersunited.actionbuilder.org/api/rest/v1/campaigns"
},
"previous": {
"href": "https://techworkersunited.actionbuilder.org/api/rest/v1/campaigns?page=457&per_page=25"
},
"curies": [
{
"name": "osdi",
"href": "https://actionbuilder.org/docs/v1/{rel}",
"templated": true
},
{
"name": "action_builder",
"href": "https://actionbuilder.org/docs/v1/{rel}",
"templated": true
}
],
"action_builder:campaigns": [
{
"href": "https://techworkersunited.actionbuilder.org/api/rest/v1/campaigns/d69744cd-1bfa-463b-b642-7a5e8ca19c5f"
},
{
"href": "https://techworkersunited.actionbuilder.org/api/rest/v1/campaigns/f8efd437-5887-40cc-9ffb-5aa7f4cd0699"
},
{
"href": "https://techworkersunited.actionbuilder.org/api/rest/v1/campaigns/9415a397-9197-49a2-98f0-b2cb2385cfac"
},
{
"href": "https://techworkersunited.actionbuilder.org/api/rest/v1/campaigns/ef9b1418-0568-4d15-8881-d71eb3248414"
},
{
"href": "https://techworkersunited.actionbuilder.org/api/rest/v1/campaigns/bd06a0d6-9bf0-4dc8-861d-5af5bc678a60"
},
{
"href": "https://techworkersunited.actionbuilder.org/api/rest/v1/campaigns/4dd2adc4-bac4-4345-a30d-7e4faa362683"
},
{
"href": "https://techworkersunited.actionbuilder.org/api/rest/v1/campaigns/dc7734ea-628f-43d1-b0ed-811a1e73b845"
},
{
"href": "https://techworkersunited.actionbuilder.org/api/rest/v1/campaigns/6d688e9d-fd5d-443f-83df-484fc95734d9"
},
{
"href": "https://techworkersunited.actionbuilder.org/api/rest/v1/campaigns/5649128c-fdf4-4154-93ff-2198d9272021"
}
]
}
}
Back To Top ↑
Scenario: Retrieving an individual campaign resource (GET)
Calling an individual campaign resource will return the campaign directly, along with all associated fields and appropriate links to additional information about the campaign.
Request
GET https://techworkersunited.actionbulider.org/api/rest/v1/campaigns/4c0fa555-10b0-4608-98db-ff25876ea9c0
Header:
OSDI-API-Token: your_api_key_here
Response
200 OK
Content-Type: application/hal+json
Cache-Control: max-age=0, private, must-revalidate
{
"origin_system": "Action Builder",
"identifiers": [
"action_builder:4c0fa555-10b0-4608-98db-ff25876ea9c0"
],
"name": "VA Local Organizing",
"created_date": "2021-09-07T22:43:00.782Z",
"modified_date": "2021-09-24T23:54:15.825Z",
"total_number": 754,
"default_entity_type": "person",
"archived": false,
"_links": {
"curies": [
{
"name": "osdi",
"href": "https://actionbuilder.org/docs/v1/{rel}",
"templated": true
},
{
"name": "action_builder",
"href": "https://actionbuilder.org/docs/v1/{rel}",
"templated": true
}
],
"self": {
"href": "https://techworkersunited.actionbuilder.org/api/rest/v1/campaigns/4c0fa555-10b0-4608-98db-ff25876ea9c0"
},
"action_builder:entity_types": {
"href": "https://techworkersunited.actionbuilder.org/api/rest/v1/campaigns/4c0fa555-10b0-4608-98db-ff25876ea9c0/entity_types"
},
"action_builder:connection_types": {
"href": "https://techworkersunited.actionbuilder.org/api/rest/v1/campaigns/4c0fa555-10b0-4608-98db-ff25876ea9c0/connection_types"
},
"osdi:tags": {
"href": "https://techworkersunited.actionbuilder.org/api/rest/v1/campaigns/4c0fa555-10b0-4608-98db-ff25876ea9c0/tags"
},
"osdi:people": {
"href": "https://techworkersunited.actionbuilder.org/api/rest/v1/campaigns/4c0fa555-10b0-4608-98db-ff25876ea9c0/people"
}
}
}
Back To Top ↑
Scenario: POST/PUT/DELETE
Posting, putting, and deleting of campaigns is not allowed. Attempts will result in errors.
Back To Top ↑