I’ve seen the question asked before but can’t see any answers but is there any API available that presents the recurring jobs information by any chance?
The use case we’re after is to create an calendar/schedule that we can use with customers on our digital noticeboards we have within our schemes.
Effectively letting them know when the cleaning will be carried out, the plan was to wrap around web service that would call ServiceM8 get the details and then format it in a presentable manner for the digital display either via an RSS standard or HTML format.
Happy for alternative solutions though if it can achieve the same aim, thanks very much
There isn’t currently a REST API endpoint that returns the Recurring Jobs “series” itself (recurrence pattern, next-run, start/end dates, etc.). The API only exposes the individual job records once each recurrence has generated a normal Job in ServiceM8.
For a noticeboard-style calendar, the best option is usually to build it from the actual scheduled visits: pull upcoming bookings from the Job Allocations endpoint, then look up each Job to get the address/description you want to display.
If you specifically need the list of recurring job setups, the Online Dashboard can export a “Recurring Job List” CSV (part of Advanced Reporting Pack plus Recurring Jobs + Reminders).
To keep the display updated without constant polling, you can also subscribe to job.created/job.updated webhooks and refresh your feed when the schedule changes.
Reply here with whether you’re aiming to show the recurring series, or the upcoming allocated jobs, and we’ll point you to the right approach.
Just wondering is it possible, to use the URL below, but replace X with either the API Key or an Authorisation token, this way I can call the report directly without having to do some automation work.
For pulling the recurring “series” itself, the closest built-in extract is the Recurring Job List Export in the Reports tab of the Online Dashboard, which exports current recurring jobs in CSV format.
That export is available when both the Advanced Reporting Pack and Recurring Jobs + Reminders add-ons are enabled.
On the authentication side, ServiceM8 API Keys aren’t passed by swapping something into a URL. API keys are supplied to the REST API in the X-API-Key request header, and OAuth access tokens are supplied to the REST API (for example) on the Authorization header as Bearer.
Also worth noting: recurring jobs are created and managed in the Online Dashboard, rather than via a report URL.
If you need this updating automatically for a noticeboard feed, email support@servicem8.com with what fields you need from the recurring series and how often it needs to refresh, and we’ll confirm the best supported approach.
Sorry think the link got changed in the posting of the reply, it’s this link below and the auth query string variable I meant, it appears some type of token or key is being passed and I was wondered whether that token is possible to generate via a API and then use that to download the file automatically
ServiceM8 API keys are used by including them in the X-API-Key header on REST API requests, and OAuth access tokens are used by including access_token as a POST parameter or by sending it as Bearer in the Authorization header.
Because of that, you won’t be able to authenticate a download link by swapping an API key or OAuth token into an s_auth=... query string parameter.
For the recurring series, the built-in extract is the “Recurring Job List Export”, which exports current recurring jobs in CSV format from the Reports tab in the Online Dashboard (Advanced Reporting Pack + Recurring Jobs + Reminders).
If the noticeboard can be based on confirmed upcoming visits, you can build the calendar from the scheduled bookings in the REST API; a “Scheduled Booking” is represented as a JobActivity record where activity_was_scheduled == 1.
Just note that ServiceM8 doesn’t create and schedule all future recurring bookings at once, and future bookings are inactive and “TBC” until they activate closer to the date by creating a job card and scheduling/allocating it.
Email support@servicem8.com with how far ahead you need to display dates (and whether inactive “TBC” bookings need to be included) and we’ll confirm the best supported approach.