pwrd by

Engagement

Determine how engaged relations are with a given theme by linking their incoming behavior to outgoing actions

Accept header for requests to Engagement

application/vnd.procurios.engagement+json; version=1

Actions

GET /l/engagement_api/action

Get the list of available actions

Parameters

Parameter Type Description
page int The api will provide 25 results per page

Examples

[]
200
[
    {
        "code": 123,
        "description": "What we did to engage with people",
        "campaign": 3,
        "theme": "5170a0df-a908-4962-ac7f-6221e61457c4",
        "channel": "5170a0df-a908-4962-ac7f-6221e61457c5"
    }
]

Action

POST /l/engagement_api/action

Register a new action

Examples

The minimum required set of parameters

{
    "description": "Mailing Y for goal X 2020-12-07",
    "campaignId": 8
}
201
{
    "actionId": 123
}

The full available set of parameters

{
    "description": "Mailing Y for goal X 2020-12-07",
    "campaignId": 8,
    "themeId": "c03445f9-9958-423d-bb9d-27ad0573baa3",
    "channelId": "9e48f7d3-8be2-43c0-983a-3827424d9b20"
}
201
{
    "actionId": 124
}

Using bad ids for campaign, theme or channel

{
    "description": "Mailing Y for goal X 2020-12-07",
    "campaignId": 999,
    "themeId": "c03445f9-9958-423d-bb9d-27ad0573baa3",
    "channelId": "9e48f7d3-8be2-43c0-983a-3827424d9b20"
}
400
{
    "errors": [
        "Unknown campaign",
        "Unknown theme",
        "Unknown channel"
    ]
}

Campaigns

GET /l/engagement_api/campaign

Get the list of available campaigns

Parameters

Parameter Type Description
page int The api will provide 25 results per page

Examples

[]
200
[
    {
        "campaignId": 123,
        "title": "Engage for some time!",
        "description": "The (short term) goal for which we engaged with people",
        "startDate": "2020-01-02",
        "endDate": null
    }
]

Channels

GET /l/engagement_api/channel

Get the list of available channels. This list should be short and relatively static and no pagination is available.

Examples

[]
200
[
    {
        "channelId": "01fb1755-e5ef-4905-8315-51e6f7e9ddaa",
        "title": "Newsletter"
    },
    {
        "channelId": "01fb1755-e5ef-4905-8315-51e6f7e9ddab",
        "title": "Facebook"
    },
    {
        "channelId": "01fb1755-e5ef-4905-8315-51e6f7e9ddac",
        "title": "Twitter"
    },
    {
        "channelId": "01fb1755-e5ef-4905-8315-51e6f7e9ddad",
        "title": "Door-to-door"
    }
]

Themes

GET /l/engagement_api/theme

Get the list of available themes. This list should be short and relatively static and no pagination is available.

Examples

[]
200
[
    {
        "themeId": "5170a0df-a908-4962-ac7f-6221e61457c4",
        "title": "Engage for some reason!",
        "description": "The world should be changed towards goal X",
        "startDate": "2020-01-02",
        "endDate": null
    }
]