# Behaviors

Target based on user actions or their past buying behavior. Take all possible behavior targeting options with type=adTargetingCategory\&class=behaviors.

Use these fields in flexible targeting:

| Value for parameter \`adTargetingCategory\` | Description                                             |
| ------------------------------------------- | ------------------------------------------------------- |
| interests                                   |                                                         |
| behaviors                                   |                                                         |
| demographics                                |                                                         |
| life\_events                                | Array of objects with 'id' and optional 'name' fields   |
| industries                                  | Array of objects with 'id' and optional 'name' fields   |
| income                                      | Array of objects with 'id' and optional 'name' fields   |
| family\_statuses                            | Array of objects with 'id' and (optional) 'name' fields |
| user\_device                                | Devices must match the value in `user_os`               |
| user\_os                                    | One or more values from OS                              |

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

#### Query Parameters

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

#### Headers

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

{% tabs %}
{% tab title="200: OK Success" %}

```javascript
{
  "data": [
    {
      "id": "6002839660079",
      "name": "Kosmetik",
      "type": "interests",
      "path": [
        "Belanja dan busana",
        "Kecantikan",
        "Kosmetik"
      ],
      "lifecycle": 2,
      "audience_size_lower_bound": 954268571,
      "audience_size_upper_bound": 1122219840
    },
    {
      "id": "6002866718622",
      "name": "Ilmu Pengetahuan",
      "type": "interests",
      "path": [
        "Bisnis dan industri",
        "Ilmu Pengetahuan"
      ],
      "lifecycle": 2,
      "audience_size_lower_bound": 600334489,
      "audience_size_upper_bound": 705993360
    },
    {
      "id": "6002867432822",
      "name": "Kecantikan",
      "type": "interests",
      "path": [
        "Belanja dan busana",
        "Kecantikan"
      ],
      "lifecycle": 2,
      "audience_size_lower_bound": 1271912474,
      "audience_size_upper_bound": 1495769070
    },
    {
      "id": "6002868021822",
      "name": "Perjalanan petualangan",
      "type": "interests",
      "path": [
        "Hobi dan aktivitas",
        "Perjalanan",
        "Perjalanan petualangan"
      ],
      "lifecycle": 2,
      "audience_size_lower_bound": 275203844,
      "audience_size_upper_bound": 323639721
    },
    {
      "id": "6002868910910",
      "name": "Makanan organik",
      "type": "interests",
      "path": [
        "Makanan dan minuman",
        "Makanan",
        "Makanan organik"
      ],
      "lifecycle": 2,
      "audience_size_lower_bound": 273132221,
      "audience_size_upper_bound": 321203492
    },
    ...
  ]
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="cURL" %}

```shell
curl --location --request GET 'https://us-central1-appgregator.cloudfunctions.net/facebook/targeting/behaviors?name=ft-4&connection_name=fbads-01&type=adTargetingCategory&class=interests' \
--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/targeting/behaviors?name=ft-4&connection_name=fbads-01&type=adTargetingCategory&class=interests',
  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/targeting/behaviors?name=ft-4&connection_name=fbads-01&type=adTargetingCategory&class=interests',
  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 %}
