# Update the settings for an affiliate

| HTTP method | Endpoint                           |
| ----------- | ---------------------------------- |
| **PUT**     | **/v1/affiliates/{affiliate\_id}** |

## Path parameters <a href="#path-parameters" id="path-parameters"></a>

| Parameter     | Description                      |
| ------------- | -------------------------------- |
| affiliate\_id | The unique id for the affiliate. |

## Request body parameters <a href="#request-body-parameters-0" id="request-body-parameters-0"></a>

***Note: individual field can be selected when updating. If the selected field is non-empty field, then the field value can not be empty.***

|                | Field                     | Type    | Description                                                                                                                     | Nullable |   |
| -------------- | ------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------- | -------- | - |
| affiliate      |                           |         |                                                                                                                                 |          |   |
|                | first\_name               | string  | The first\_name of the this affiliate.                                                                                          | No       |   |
|                | last\_name                | string  | The last\_name of the this affiliate.                                                                                           | No       |   |
|                | email                     | string  | The email of the this affiliate.                                                                                                | No       |   |
|                | company                   | string  | The company of the this affiliate.                                                                                              | No       |   |
|                | country                   | string  | The country of the affiliate’s physical address.                                                                                |          |   |
|                | status                    | string  | The status of the affiliate and only fill the active when create .   Allowed values when update:  active ; blocked ; deleted    |          |   |
|                | instant\_message\_account | string  | Instant message account.                                                                                                        |          |   |
|                | instant\_message\_type    | integer | Types of instant message.  Allowed values:  0 Other;  1 Skype;  2 Gtalk;   3 QQ;   4 Yahoo;   5 Facebook;  6 WeChat;  7 Twitter |          |   |
|                | manager\_id               | integer | Manager id                                                                                                                      | No       |   |
|                | phone                     | string  | The phone number of the affiliate.                                                                                              |          |   |
|                | website                   | string  |                                                                                                                                 |          |   |
|                | password                  | string  | Password                                                                                                                        | No       |   |
| affiliate\_tag |                           |         |                                                                                                                                 |          |   |
|                | name                      | string  | Tag name.                                                                                                                       |          |   |

## Response body parameters <a href="#response-body-parameters-0" id="response-body-parameters-0"></a>

|                | Field                     | Type    | Description                                       |
| -------------- | ------------------------- | ------- | ------------------------------------------------- |
| affiliate      |                           |         |                                                   |
|                | id                        | integer | A string that uniquely identifies this affiliate. |
|                | first\_name               | string  | The first\_name of the this affiliate.            |
|                | last\_name                | string  | The last\_name of the this affiliate.             |
|                | email                     | string  | The email of the this affiliate.                  |
|                | company                   | string  | The company of the this affiliate.                |
|                | country                   | string  | The country of the affiliate’s physical address.  |
|                | status                    | string  | Affiliate's status.                               |
|                | instant\_message\_account | string  | Instant message account.                          |
|                | instant\_message\_type    | integer | Types of instant message.                         |
|                | manager\_id               | integer | Manager id.                                       |
|                | phone                     | string  | The phone number of the affiliate.                |
|                | website                   | string  |                                                   |
|                | create\_time              | integer | Create time.                                      |
| affiliate\_tag |                           |         |                                                   |
|                | id                        | integer | A string that uniquely identifies this tag.       |
|                | affiliate\_id             | integer | A string that uniquely identifies this affiliate. |
|                | name                      | string  | Tag name                                          |

## Example request <a href="#example-request-0" id="example-request-0"></a>

**Request PUT** <https://{networkname}.api.offerslook.com/v1/affiliates/4866>

**Request PUT** <http://{networkname}.api.offerslook.com/v1/affiliates/4866>

```
    {
      "affiliate": {
        "company": "UC Union",
        "country": "Asia/Pacific Region",
        "email": "test@test.com",
        "first_name": "affiliate",
        "instant_message_account": "test@facebook.com",
        "instant_message_type": 3,
        "last_name": "test",
        "manager_id": 7,
        "phone": "11122223333",
        "status": "active",
        "website": "http://www.offerslook.com",
        "password": "test123"
      },
      "affiliate_tag": [
        {
          "name": "Other"
        },
        {
          "name": "FOOD"
        }
      ]
    }
```

## Example response <a href="#example-response-0" id="example-response-0"></a>

```
    {
      "code": 0,
      "message": "Success",
      "data": {
        "affiliate_tag": [
          {
            "id": 21,
            "name": "Other",
            "affiliate_id": 4866
          },
          {
            "id": 22,
            "name": "FOOD",
            "affiliate_id": 4866
          }
        ],
        "affiliate": {
          "id": 4866,
          "email": "test@test.com",
          "first_name": "affiliate",
          "last_name": "test",
          "country": "Asia/Pacific Region",
          "status": "active",
          "website": "http://www.offerslook.com",
          "create_time": 1458650346,
          "company": "UC Union",
          "phone": "11122223333",
          "manager_id": 7,
          "instant_message_type": 3,
          "instant_message_account": "test@facebook.com"
        }
      }
    }
```
