Campaigns

List Campaigns

Request

GET /api/v3/campaign/

Response

[
    {
        "name" : "Your campaign",
        "token" : "token",
        "start_date" : "2018-01-01",
        "end_date" : "2018-06-01",
        "category" : "Alcohol",
        "brand" : "Your Brand",
        "reach" : 400,
        "last_modified": "2019-01-01 13:59:00",
        "target_geography" : [
            "New Zealand",
            "Australia"
        ],
        "objective" : "Conversion"
    },
    ...
]

Create a Campaign

Request

POST /api/v3/campaign/

Parameters

Parameter Name Description
name (required) The campaign name.
start_date (required) The campaign start date. In YYYY-mm-dd format.
end_date (required) The campaign end date. In YYYY-mm-dd format.
category (required) The campaign category. See table below for valid options.
brand (optional) The name of the brand you're measuring content for.
reach (optional) The reach goal for your campaign.
target_geography (optional) The target country for your campaign. From the ISO-3166 standard list. This can either be a single value, or an array of values.
objective (optional) The objective category for your campaign. Details below.
Valid Categories Valid Objectives
Alcohol Page Views
Auto Uniques
Beauty Social Engagement
Charity Attention
Education Reach
Entertainment Combination
Fashion Conversion
Finance Brand Lift
Food / Drink Brand Awareness
Health & Fitness
Retail
Technology
Travel & Tourism
Other

Response

If everything runs without a problem, Nudge will return a HTTP200 with data:

{
    "token" : "<your token>",
    "name" : "<your campaign name>",
    "start_date" : "<start date>",
    "end_date" : "<end date>",
    "category" : "<campaign category>",
    "brand" : "<campaign brand>",
    "reach" : 1000,
    "last_modified": "2019-01-01 13:59:00",
    "target_geography" : [
        "New Zealand",
        "Australia",
        "United States of America"
    ],
    "objective" : "Reach"    
}

If any of the fields are invalid, or - if required - not present, we will return a HTTP400.

Edit a Campaign

Request

POST /api/v3/campaign/<campaign token>/

Parameters

Please reference the above tables for creating a campaign.

Response

If the edit is successful, Nudge will return a HTTP200 with the campaign data.

{
    "token" : "<your token>",
    "start_date" : "<start date>",
    "end_date" : "<end date>",
    "category" : "<campaign category>",
    "brand" : "<campaign brand>",
    "reach" : 1000,
    "target_geography" : [
        "New Zealand",
        "Australia",
        "United States of America"
    ],
    "objective" : "Reach"    
}

If the edit is unsuccessful, Nudge will return a HTTP400 with information about the error.

List content in a campaign

Request

GET /api/v3/campaign/<campaign token>/

Response

{
    "name" : "Campaign Name",
    "token" : "Campaign Token",
    "start_date" : "2018-01-01",
    "end_date" : "2018-06-01",
    "category" : "Alcohol",
    "brand" : "Your Brand",
    "reach" : 400,
    "target_geography" : [
        "New Zealand"
    ],
    "objective" : "Conversion",
    "content" : [
        {
            "url" : "https://www.giveitanudge.com/",
            "content_type" : "Article",
            "added" : "2018-01-01 13:51:51",
            "token" : "abcdef",
            "state" : "active",
            "title": "Hello World",
        }
    ]
}

NB: Options for state are 'active' or 'inactive'.

Delete a campaign

Request

DELETE /api/v3/campaign/<campaign token/>/

Response

If the deletion was successful, Nudge will return a blank HTTP204.