_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

Boolean value used to decide if Jobs are filtered based on whether they are complete or not: false => Only includes Jobs which are yet to be completed. true => Only includes Jobs which are completed.

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' => 'false',
    '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:

[]

Last updated