Mediaplan¶
Get the list of plans for a specific month¶
POST /project/mediaplan/target/list Use this method to get the list of plans for a specific month.
curl 'https://cloud.roistat.com/api/v1/project/mediaplan/target/list?project=12345' \
    --request POST \
    --header 'Content-type: application/json' \ 
    --header 'Api-key: {KEY}' \ 
    --data Request body - see below
Request Body:
{
    "date_from": "2021-11-01",
    "date_to": "2021-11-30"
}
{
    "data": [
        {
            "id": "25",
            "channel": "email",
            "metrics": [
                {
                    "name": "leads",
                    "value": 1
                },
                {
                    "name": "marketing_cost",
                    "value": 2
                },
                {
                    "name": "cpl",
                    "value": 2
                }
            ],
            "date_from": "2021-11-01",
            "date_to": "2021-11-30"
        },
        {
            "id": "16",
            "channel": "facebook5",
            "metrics": [
                {
                    "name": "leads",
                    "value": 53
                },
                {
                    "name": "marketing_cost",
                    "value": 10000
                },
                {
                    "name": "cpl",
                    "value": 188.68000000000001
                }
            ],
            "date_from": "2021-11-01",
            "date_to": "2021-11-30"
        },
        {
            "id": "18",
            "channel": "seo",
            "metrics": [
                {
                    "name": "leads",
                    "value": 16
                },
                {
                    "name": "marketing_cost",
                    "value": 10000
                },
                {
                    "name": "cpl",
                    "value": 625
                }
            ],
            "date_from": "2021-11-01",
            "date_to": "2021-11-30"
        }
    ],
    "total": 3,
    "status": "success"
}
Query String:
| Parameter | Type | Description | Required | 
|---|---|---|---|
| project | string | Project number | yes | 
Request Body:
| Parameter | Type | Description | Required | 
|---|---|---|---|
| date_from | string | First day of the month for receiving data (YYYY-MM-DD). Don't set other days of the month. | yes | 
| date_to | string | Last day of the month for receiving data (YYYY-MM-DD). Don't set other days of the month. | yes | 
| Parameter | Type | Description | 
|---|---|---|
| data | array[object] | |
| > id | string | Plan ID | 
| > channel | string | Channel name | 
| > metrics | array[object] | |
| >> name | string | Metrics: "leads", "marketing_cost", "cpl" | 
| >> value | integer | Value of the metric | 
| > date_from | string | First day of the month for receiving data | 
| > date_to | string | Last day of the month for receiving data | 
| total | integer | A number of plans for the specified month | 
| status | string | 
Delete a specific plan¶
POST /project/mediaplan/target/delete Use this method to delete a specific plan.
curl 'https://cloud.roistat.com/api/v1/project/mediaplan/target/delete?project=12345' \
    --request POST \
    --header 'Content-type: application/json' \ 
    --header 'Api-key: {KEY}' \ 
    --data Request body - see below
Request Body:
{
    "id": "12"
}
{
    "status": "success"
}
Query String:
| Parameter | Type | Description | Required | 
|---|---|---|---|
| project | string | Project number | yes | 
Request Body:
| Parameter | Type | Description | Required | 
|---|---|---|---|
| id | string | Plan ID which you can get using /project/mediaplan/target/list | yes | 
| Parameter | Type | Description | 
|---|---|---|
| status | string | 
Create a plan¶
POST /project/mediaplan/target/create Use this method to create a plan.
curl 'https://cloud.roistat.com/api/v1/project/mediaplan/target/create?project=12345' \
    --request POST \
    --header 'Content-type: application/json' \ 
    --header 'Api-key: {KEY}' \ 
    --data Request body - see below
Request Body:
{
    "channel": "unisender",
    "date_from": "2021-11-01",
    "date_to": "2021-11-30",
    "metrics": [
        {
            "name": "leads",
            "value": 25
        },
        {
            "name": "marketing_cost",
            "value": 350
        },
        {
            "name": "cpl",
            "value": 14
        }
    ]
}
{
    "status": "success"
}
Query String:
| Parameter | Type | Description | Required | 
|---|---|---|---|
| project | string | Project number | yes | 
Request Body:
| Parameter | Type | Description | Required | 
|---|---|---|---|
| channel | string | Channel name in Roistat | yes | 
| date_from | string | First day of the month for receiving data (YYYY-MM-DD). Don't set other days of the month. | yes | 
| date_to | string | Last day of the month for receiving data (YYYY-MM-DD). Don't set other days of the month. | yes | 
| metrics | array[object] | Here you can specify the following metrics and their values: "leads", "marketing_cost" , "cpl" | yes | 
| > name | string | Set the metric as the value: "leads", "marketing_cost", or "cpl" | no | 
| > value | integer | Set the value of the metric specified in the "name" field | no | 
| Parameter | Type | Description | 
|---|---|---|
| status | string | 
Update data for a specified plan¶
POST /project/mediaplan/target/update Use this method to update data for a specified plan.
curl 'https://cloud.roistat.com/api/v1/project/mediaplan/target/update?project=12345' \
    --request POST \
    --header 'Content-type: application/json' \ 
    --header 'Api-key: {KEY}' \ 
    --data Request body - see below
Request Body:
{
    "id": "26",
    "channel": "yamarket3",
    "date_from": "2021-11-01",
    "date_to": "2021-11-30",
    "metrics": [
        {
            "name": "leads",
            "value": 8
        },
        {
            "name": "marketing_cost",
            "value": 600
        },
        {
            "name": "cpl",
            "value": 75
        }
    ]
}
{
    "status": "success"
}
Query String:
| Parameter | Type | Description | Required | 
|---|---|---|---|
| project | string | Project number | yes | 
Request Body:
| Parameter | Type | Description | Required | 
|---|---|---|---|
| id | string | Plan ID which you can get using /project/mediaplan/target/list | yes | 
| channel | string | Channel name in Roistat | yes | 
| date_from | string | First day of the month for receiving data (YYYY-MM-DD). Don't set other days of the month. | yes | 
| date_to | string | Last day of the month for receiving data (YYYY-MM-DD). Don't set other days of the month. | yes | 
| metrics | array[object] | Here you can specify the following metrics and their values: "leads", "marketing_cost" , "cpl" | yes | 
| > name | string | Set the metric as the value: "leads", "marketing_cost", or "cpl" | no | 
| > value | integer | Set the value of the metric specified in the "name" field | no | 
| Parameter | Type | Description | 
|---|---|---|
| status | string |