# \_exportChanges

Exports a list of changes to a Customer's information as a .csv file, fields can be filtered.

### Parameters

#### customer\_id

The ID of the Customer you wish to export the changes of.

#### f-field

An optional filter that will only include changes to Customer fields which contain the value given.

For example:

* The value "account\_manager" for the **f-field** parameter will make the .csv file only include changes to fields with "account\_manager" in their name.
* If there was a field made with just the name "account", the value "account" for the **f-field** parameter will make the .csv file include any changes to both the "account" and "account\_manager" fields.
* Not giving the **f-field** parameter a value will include all recorded changes in the .csv file.

### Example

```
FM_api('Customer_exportChanges',[
  'customer_id'=>'682978',
  'f-field'=>''
]);
```

### Results

#### On Success

An example where f-field was not given a value

```
Date,User,Field,"Change From","Change To"
2023-10-01,"api tests",credit_terms,,fffffffff
2023-10-01,"api tests",industry,,1
2023-10-01,"api tests",postcode,,35321
2023-10-01,"api tests",county,"tEst county",
2023-10-01,"api tests",landline,012345678,0123456783
```

An example where f-field was given the value "c"

```
Date,User,Field,"Change From","Change To"
2023-10-01,"api tests",account_manager,0,92447
2023-10-01,"api tests",county,"tEst county"
```

#### On Failure

If the "customer\_id" parameter is not set, has a value less than 0 or does not contain any numerical characters:

```
{"error":"missing or invalid parameter: customer_id"}
```

If the "customer\_id" parameter does not match the ID of an existing Customer, or there are no changes recorded:

```
Date,User,Field,"Change From","Change To"
```
