Discussions

Ask a Question
Back to all

API Support for Moving Scheduled Job to Queue Folder

Hello,

I just wanted to ask if it’s possible to automatically move a scheduled Job into a specific Queue Folder.

For example, after creating and scheduling a Job, I’d like to send an HTTP request that moves this new Job to one of my Queue Folders. Does ServiceM8 have an API endpoint for this functionality?

I tried using the following endpoint:
https://api.servicem8.com/api_1.0/queue.json

and sent a POST request, but received an error. Here’s my code:

await axios.post( 'https://api.servicem8.com/api_1.0/queue.json', qs.stringify({ job_uuid: uuid, queue_uuid: TARGET_QUEUE_UUID, expiry_timestamp: new Date(Date.now() + 24 _ 3600 _ 1000).toISOString(), }), { headers: { Authorization: Bearer ${globalStore.access_token}, Accept: 'application/json', 'Content-Type': 'application/x-www-form-urlencoded', }, } );

Could you please confirm if there’s an existing endpoint or API method we can use to automate moving a Job to a Queue Folder?

Thank you,