# Campaign



<mark style="color:blue;">`GET`</mark> `https://us-central1-appgregator.cloudfunctions.net/facebook/adaccounts/campaign/`

#### Query Parameters

| Name                                               | Type   | Description |
| -------------------------------------------------- | ------ | ----------- |
| name<mark style="color:red;">\*</mark>             | String | ft-4        |
| connection\_name<mark style="color:red;">\*</mark> | String | fbads-01    |

#### Headers

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| x-api-key<mark style="color:red;">\*</mark> | String | U2Fsd...    |

{% tabs %}
{% tab title="200: OK Success" %}
```javascript
{
    "adaccounts": {
        "data": [
            {
                "campaigns": {
                    "data": [
                        {
                            "id": "23852124768350549",
                            "name": "[19/09/2022] Mempromosikan Lahan bagus",
                            "daily_budget": "70000",
                            "account_id": "1514519918873559",
                            "budget_remaining": "10089",
                            "created_time": "2022-09-19T20:31:57+0700",
                            "status": "ACTIVE",
                            "effective_status": "ACTIVE",
                            "start_time": "2022-09-19T20:32:27+0700",
                            "stop_time": "2022-09-24T20:32:27+0700"
                        },
                        {
                            "id": "23851629832580549",
                            "name": "Promosi Situs Web yang Sedang Berjalan https://appgregator.co/",
                            "daily_budget": "46000",
                            "account_id": "1514519918873559",
                            "budget_remaining": "46000",
                            "created_time": "2022-08-04T11:28:46+0700",
                            "status": "ACTIVE",
                            "effective_status": "ACTIVE",
                            "start_time": "2022-08-04T11:29:16+0700"
                        },
                        {
                            "id": "23851629142770549",
                            "name": "Promosi Situs Web yang Sedang Berjalan https://www.facebook.com/Source-code-Tutorial-1842784136033747/",
                            "daily_budget": "46000",
                            "account_id": "1514519918873559",
                            "budget_remaining": "46000",
                            "created_time": "2022-08-04T09:50:53+0700",
                            "status": "ACTIVE",
                            "effective_status": "ACTIVE",
                            "start_time": "2022-08-04T09:51:23+0700"
                        }
                    ],
                    "paging": {
                        "cursors": {
                            "before": "QVFIUi11c3BtRUx1UzVLZAk4ySkdCdktuRlpLcnJWTU1ULUJrV0t1VHpQTzlNWGRqbjE1Sno5U1p5ZAnhXcjRxWVp4ejJtWjRSa3ZALY1RIbTEzMHNnTXM1ckFR",
                            "after": "QVFIUk95NDk3QVJQaFI3NjF2cWxkX2FOdlpVdnVxOFhTNWhzc2taY2UybjNQSm56T29OWFUzWmktbl9ORzAzYnk1dWJjQmYtMlRKUE9GRkJCb2pyYWR2MThB"
                        }
                    }
                },
                "ads": {
                    "data": [
                        {
                            "id": "23852124768900549",
                            "name": "[19/09/2022] Mempromosikan Lahan bagus",
                            "created_time": "2022-09-19T20:31:57+0700",
                            "status": "ACTIVE",
                            "effective_status": "ACTIVE"
                        },
                        {
                            "id": "23851629832700549",
                            "name": "Iklan Situs Web yang Sedang Berjalan",
                            "created_time": "2022-08-04T11:28:46+0700",
                            "status": "ACTIVE",
                            "effective_status": "ACTIVE"
                        },
                        {
                            "id": "23851629142940549",
                            "name": "Iklan Situs Web yang Sedang Berjalan",
                            "created_time": "2022-08-04T09:50:53+0700",
                            "status": "ACTIVE",
                            "effective_status": "ACTIVE"
                        }
                    ],
                    "paging": {
                        "cursors": {
                            "before": "QVFIUk42T3ZA1bGpXNXJDN013V0J4aW5rTHNrZA0FBU1RQamh6aUxVRms5bEVFVGQ0OFhxYzRsUjB4RVdDcTdySzBZANlBPVTd3akdkaWZAHM0h2ZAmZANeEVQb0FB",
                            "after": "QVFIUkdMQ0M5VDJpT1ZAfYU9WNXBxeXBXcDZAJQXY1QXBoYlgzMjdrWVZAYajRsU0xyNnpSWGdaVmhmbDBzMHk4ODdZAWlJVMjc1OFp5T0hCWVBESUlwaE1JRi1n"
                        }
                    }
                },
                "id": "act_1514519918873559"
            },
            {
                "id": "act_1217648562383717"
            }
        ],
        "paging": {
            "cursors": {
                "before": "MjM4NDI2MTA0NTYyODA1NDkZD",
                "after": "MjM4NTAyNzk3MTI0ODA2ODQZD"
            }
        }
    },
    "id": "3305578009767732"
}
```
{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="cURL" %}
```shell
curl --location --request GET 'https://us-central1-appgregator.cloudfunctions.net/facebook/adaccounts/campaign?name=ft-4&connection_name=fbads-01' \
--header 'x-api-key: U2Fsd...'
```
{% endtab %}

{% tab title="NodeJS - Axios" %}
```javascript
var axios = require('axios');

var config = {
  method: 'get',
  url: 'https://us-central1-appgregator.cloudfunctions.net/facebook/adaccounts/campaign?name=ft-4&connection_name=fbads-01',
  headers: { 
    'x-api-key': 'U2Fsd...'
  }
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});

```
{% endtab %}

{% tab title="PHP - cURL" %}
```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://us-central1-appgregator.cloudfunctions.net/facebook/adaccounts/campaign?name=ft-4&connection_name=fbads-01',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'x-api-key: U2Fsd...'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

```
{% endtab %}
{% endtabs %}
