Kanka logo Kanka

Campaigns


User Campaigns

You can get a list of all the campaigns the user has access to using the following endpoint.

{warning} Don't forget that all endpoints documented here need to be prefixed with api/1.0/. For example, campaigns becomes kanka.io/api/1.0/campaigns.

Method Endpoint Headers
GET campaigns Default

Results

{
    "data": [
        {
            "id": 1,
            "name": "Thaelia",
            "locale": "fr",
            "entry": "\r\n<p>Aenean sit amet vehicula.</p>\r\n",
            "image": "{path}",
            "image_full": "{url}",
            "image_thumb": "{url}",
            "visibility": "public",
            "created_at": {
                "date": "2017-10-27 13:36:19.000000",
                "timezone_type": 3,
                "timezone": "UTC"
            },
            "updated_at": {
                "date": "2019-01-28 20:46:42.000000",
                "timezone_type": 3,
                "timezone": "UTC"
            },
            "members": [
                {
                    "id": 1,
                    "user": {
                        "id": 1,
                        "name": "Ilestis",
                        "avatar": "{url}"
                    }
                }
            ]
        }
    ],
    "links": {
        "first": "https://kanka.io/api/1.0/campaigns?page=1",
        "last": "https://kanka.io/api/1.0/campaigns?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "path": "http://kanka.io/api/1.0/campaigns",
        "per_page": 15,
        "to": 3,
        "total": 3
    }
}

Single Campaign

Getting a single campaign is straightforward. {id} is to be replaced with the campaign's id returned in the campaigns call.

Method Endpoint Headers
GET campaigns/{id} Default

Results

{
    "data": {
        "id": 1,
        "name": "Thaelia",
        "locale": "fr",
        "entry": "\r\n<p>Aenean sit amet vehicula.</p>\r\n",
        "image": "{path}",
        "image_full": "{url}",
        "image_thumb": "{url}",
        "visibility": "public",
        "created_at": {
            "date": "2017-10-27 13:36:19.000000",
            "timezone_type": 3,
            "timezone": "UTC"
        },
        "updated_at": {
            "date": "2019-01-28 20:46:42.000000",
            "timezone_type": 3,
            "timezone": "UTC"
        },
        "members": [
            {
                "id": 1,
                "user": {
                    "id": 1,
                    "name": "Ilestis",
                    "avatar": "{url}"
                }
            }
        ]
    }
}

Campaign Members

To get a list of all the members of a campaign, use the following endpoint.

Method Endpoint Headers
GET campaigns/{id}/users Default

Results

{
    "data": [
        {
            "id": 1,
            "name": "Ilestis",
            "avatar": "{url}"
        } 
    ]
}