# \_list

Returns a list of Jobs, which are filtered based on several parameters, additional info on these jobs returned can also be requested under a "fields" array.

### Parameters

#### date\_from

Filters out any Jobs where the meeting time is before a specific date, this date is calculated by a given number of days relative to when this function is ran.\
(e.g "-30" will filter out any Jobs where their meeting times were more than 30 days ago, "30" will filter out any Jobs which also have meeting times within 30 days from today)

#### date\_to

Filters out any Jobs where their meeting time is after a specific date, this date is also calculated by a given number of days relative to when this function is ran.\
(e.g "14" will filter out any Jobs where their meeting date is more than 2 weeks later than today)

#### form\_id

The ID of a Form, used to only include Jobs linked to this Form.

#### is\_complete

String used to filter Jobs by their `is_complete` status.\
If the string is empty, then Jobs with status 0,1,3,4 will be returned (incomplete, complete, requires authentication, authorised). All others (processed, cancelled, etc) are filtered out.\
Otherwise, the string should be an integer or list of integers delimited by `|` , where the first integer is a specific `is_complete` to be returned, and the (optional) second integer is the `user_status` to be returned.

#### job\_ref

Filters out any Jobs which do not have a Job Reference under the exact full name given by this parameter.\
(e.g "2nd test job reference" will only include Jobs which have a Job reference under that specific name)

#### last\_edited

A string for a date and time, in the format: YYYY-MM-DD d:m:s\
Any Jobs which were last edited before this parameter's given date are excluded, only including Jobs where were last edited between the "last\_edited" parameter's date/time and the current time this function is used at. (e.g "2024-05-21 15:00:00")

#### fields

An array of extra parameters which if included within, will add more details to the returned Job results:

last\_edited\
meeting\_time\
customer\_type\
customer\_id\
customer\_details\
due\_date\
user\_id\
user\_type\
location\
hours\
priority\
meta\
form\_id\
job\_ref

### Example

```
FM_api('Jobs_list', [
    'dateFrom' => '-30',
    'dateTo' => '30',
    'form_id' => '520362',
    'is_complete' => '0',
    'fields' => '["last_edited","user_id","job_ref"]'
]);
```

### Results

#### On Success

With two existing Jobs and parameters of the Example above:

```
[
    {
       "id":532028,
       "meeting_time":"2015-11-02 16:18:00",
       "is_complete":"0",
       "last_edited":"2024-05-21 14:42:54",
       "user_id":"0",
       "job_ref":"test create\/complete 358",
       "meeting_time_e":1446481080
    },
    {
       "id":532029,
       "meeting_time":"2024-05-30 22:44:02",
       "is_complete":"0",
       "last_edited":"2024-05-21 21:44:57",
       "user_id":"92447",
       "job_ref":"2nd test job reference",
       "meeting_time_e":1717109042
    }
]
```

With two existing Jobs but no parameters to filter them:

```
[{"id":502037,"meeting_time":"2015-11-02 16:18:00","is_complete":"0","meeting_time_e":1446481080},{"id":502038,"meeting_time":"2015-11-02 16:18:00","is_complete":"0","meeting_time_e":1446481080}]
```

#### On Failure

If there are no existing Jobs or no Jobs match with the filtering parameters used:

```
[]
```
