====/api/events/search==== ===Usage=== This function is used to get a list of events that meet specific criteria. Most commonly, this is a //date range//, but you can also limit other factors such as the sources of data you want to search through. You can set a number of **hours** instead of a fixed date range. This will return data from the most recent 'x' hours of time. ===Details== ^Detail^Value^ |Group|Asset| |From Server Version|2024.0.0| |Permission|[[permission_guest|Guest]]| |Methods|GET or POST| ==Parameters== ^Parameter^Notes^Meaning^ |**from**|UTC Date (YYYY-mm-dd HH:MM:SS)|Starting Date| |**to**|UTC Date (YYYY-mm-dd HH:MM:SS)|Ending Date| |**hours**|Number (optional)|Relative Number of Hours| |**search**|String|Search Text| |**sources**|String|List of source names (2025.0.2+)| |**format**|String (xml)|Either 'xml' or 'json'| ===Examples=== ==Fixed Time Range== http://ardiserver.com/api/events/search?start=2025-01-01 10:00:00&end=2025-01-02 10:00:00&search=Batch //Searches for any events with 'Batch' in the name on the first day of 2025 after 10:00 UTC.// ==Success (XML)== Plain Sugar Cookies ==Success (JSON)== [ { "name": "Batch 2003", "start": "2025-01-01 12:42:55", "end": "2025-01-01 13:22:16", "product": "Plain Sugar Cookie" } ] ==Relative Time Range== http://ardiserver.com/api/events/search?hours=24&search=Breakdown&source=Downtime //Searches for any events with 'Breakdown' in the name over the last 24 hours. It only searches the source called 'downtime'.//