> For the complete documentation index, see [llms.txt](https://docs.fieldmotion.com/fieldmotion-api-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fieldmotion.com/fieldmotion-api-docs/availability/_timeline.md).

# \_timeline

Returns a timeline of all Availabilities across an array of User IDs, can be set to a specific time period.

### Parameters

#### user\_ids

An array of User IDs to have Availability data gathered from.

#### start\_e

Sets an epoch time to collect Availability data from.

#### end\_e

Sets an epoch time to collect Availability data up to.

### Example

```
FM_api('Availability_timeline',[
  'user_ids' => '[113747,113763,113776,113867]',
  'start_e' => '1782774000',
  'end_e' => '1783378800'
  ]
);
```

### Result

#### On Success

```
{"113747":[{"user_id":113747,"start_e":1782774000,"end_e":1782802800,"id":0,"event_id":0,"event_type":"work_shift","name":"Outside work shift","title":"Outside work shift","source":"work_shift"},{"user_id":113747,"start_e":1782835200,"end_e":1782889200,"id":0,"event_id":0,"event_type":"work_shift","name":"Outside work shift","title":"Outside work shift","source":"work_shift"},{"user_id":113747,"start_e":1782921600,"end_e":1782975600,"id":0,"event_id":0,"event_type":"work_shift","name":"Outside work shift","title":"Outside work shift","source":"work_shift"},{"user_id":113747,"start_e":1783008000,"end_e":1783062000,"id":0,"event_id":0,"event_type":"work_shift","name":"Outside work shift","title":"Outside work shift","source":"work_shift"},{"user_id":113747,"start_e":1783094400,"end_e":1783321200,"id":0,"event_id":0,"event_type":"work_shift","name":"Outside work shift","title":"Outside work shift","source":"work_shift"},{"user_id":113747,"start_e":1783353600,"end_e":1783378800,"id":0,"event_id":0,"event_type":"work_shift","name":"Outside work shift","title":"Outside work shift","source":"work_shift"}],"113763":[{"user_id":113763,"start_e":1782774000,"end_e":1782802800,"id":0,"event_id":0,"event_type":"work_shift","name":"Outside work shift","title":"Outside work shift","source":"work_shift"},{"user_id":113763,"start_e":1782835200,"end_e":1782889200,"id":0,"event_id":0,"event_type":"work_shift","name":"Outside work shift","title":"Outside work shift","source":"work_shift"},{"user_id":113763,"start_e":1782921600,"end_e":1782975600,"id":0,"event_id":0,"event_type":"work_shift","name":"Outside work shift","title":"Outside work shift","source":"work_shift"},{"user_id":113763,"start_e":1783008000,"end_e":1783062000,"id":0,"event_id":0,"event_type":"work_shift","name":"Outside work shift","title":"Outside work shift","source":"work_shift"},{"user_id":113763,"start_e":1783094400,"end_e":1783321200,"id":0,"event_id":0,"event_type":"work_shift","name":"Outside work shift","title":"Outside work shift","source":"work_shift"},{"user_id":113763,"start_e":1783353600,"end_e":1783378800,"id":0,"event_id":0,"event_type":"work_shift","name":"Outside work shift","title":"Outside work shift","source":"work_shift"}],"113776":[{"user_id":113776,"start_e":1782774000,"end_e":1782802800,"id":0,"event_id":0,"event_type":"work_shift","name":"Outside work shift","title":"Outside work shift","source":"work_shift"},{"user_id":113776,"start_e":1782835200,"end_e":1782889200,"id":0,"event_id":0,"event_type":"work_shift","name":"Outside work shift","title":"Outside work shift","source":"work_shift"},{"user_id":113776,"start_e":1782921600,"end_e":1782975600,"id":0,"event_id":0,"event_type":"work_shift","name":"Outside work shift","title":"Outside work shift","source":"work_shift"},{"user_id":113776,"start_e":1783008000,"end_e":1783062000,"id":0,"event_id":0,"event_type":"work_shift","name":"Outside work shift","title":"Outside work shift","source":"work_shift"},{"user_id":113776,"start_e":1783094400,"end_e":1783321200,"id":0,"event_id":0,"event_type":"work_shift","name":"Outside work shift","title":"Outside work shift","source":"work_shift"},{"user_id":113776,"start_e":1783353600,"end_e":1783378800,"id":0,"event_id":0,"event_type":"work_shift","name":"Outside work shift","title":"Outside work shift","source":"work_shift"}],"113867":[{"user_id":113867,"start_e":1782774000,"end_e":1782802800,"id":0,"event_id":0,"event_type":"work_shift","name":"Outside work shift","title":"Outside work shift","source":"work_shift"},{"user_id":113867,"start_e":1782835200,"end_e":1782889200,"id":0,"event_id":0,"event_type":"work_shift","name":"Outside work shift","title":"Outside work shift","source":"work_shift"},{"user_id":113867,"start_e":1782921600,"end_e":1782975600,"id":0,"event_id":0,"event_type":"work_shift","name":"Outside work shift","title":"Outside work shift","source":"work_shift"},{"user_id":113867,"start_e":1783008000,"end_e":1783062000,"id":0,"event_id":0,"event_type":"work_shift","name":"Outside work shift","title":"Outside work shift","source":"work_shift"},{"user_id":113867,"start_e":1783094400,"end_e":1783321200,"id":0,"event_id":0,"event_type":"work_shift","name":"Outside work shift","title":"Outside work shift","source":"work_shift"},{"user_id":113867,"start_e":1783353600,"end_e":1783378800,"id":0,"event_id":0,"event_type":"work_shift","name":"Outside work shift","title":"Outside work shift","source":"work_shift"}]}
```

#### On Failure

If the "user\_ids" parameter is not set:

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

If the "start\_e" parameter is not set, has an integer value less than 1, or the "end\_e" parameter does not have a higher value than "start\_e".

```
{"error":"missing or invalid time window"}
```
