Discussions

Ask a Question

Implementing Webhooks in Ruby application

Good day/evening to all. Is there any proper guides in what to do after getting the authorization token with the Webhooks implementation? I'm currently working on adding real-time job status updates to my app, but it seems like nothing different happens when I authorized my servicem8 add-on to my application. All it does is redirect me back to the URL I passed the Authorization request I made after allowing the application. It does return the temporary API Key tho, which is good, but I need to find a clear guide that allows me to actually let my application subscribe to said webhook. There aren't much any clear details as to what you should do about this and the only "good" lead I have was a taken down/non existent article in the guides section. As if the moment, I'm only using get all jobs API in order to update my application's database manually, which I find as a bad practice because its adding unnecessary processing time to my application and is bad for performance when deployed to a server, I just want to get the changes to reflect in real time that are made in servicem8 to reflect to my application.

Error Packaging Simple App

I'm getting an error for Simple Function. It says error packaging app. Here is a screenshot - https://www.dropbox.com/s/dlt6t7acvw4mv0o/Screen%20Shot%202022-09-06%20at%209.58.47%20AM.png?dl=0

Getting Multiple Attachments For Same Edited Attachment.

Hello Team, Hope you are doing great! Problem1 : We are having some trouble with the Servicem8 API endpoint result we received in Attachment. We are getting multiple entries for the attachment for the Job UUID : d6023442-9e7e-4438-aae6-1ee1d115e4bb Job #23422 This attachment has been updated 2-3 times but ultimately we should receive only one attachment in result json at the moment. But currently its giving each edited Attachments. Can you please look into this? END POINT : https://api.servicem8.com/api_1.0/attachment.json?%24filter=related_object_uuid%20eq%20%27d6023442-9e7e-4438-aae6-1ee1d115e4bb ******************************************************************************************** Problem2 : Some time we are getting this error ( [errorCode] => 429 [message] => Number of allowed API requests per minute exceeded ) Query : Can you please tell us how many API request we can have per minute? And if we want to increase it then how can we do that? Please answer on this as well.

Get Assigned Staff for a Job via the API

Hi Is there a way to get the assigned staff for a job via the API? I've tried Job Activities and Job Allocations endpoints to no avail. the Job endpoint itself does not return the staff assigned to the job either. Thanks in advance

Redirect uri

Hi all, I am new to developer mode, and am stuck. For https://go.servicem8.com/oauth/authorize?response_type=code&client_id=99999&scope=manage_customers manage_jobs manage_job_queues manage_badges&redirect_uri=https%3A%2F%2Fmyapp.example.com%2FHandleOAuth Where do I find myapp.example.com ? Thanks in advance

Webhook Listener and Zapier

We built an app following the webhook instructions and were able to add it as an add on to our servicem8 account. We created the webhook using Postman and the callback URL would be something that Zapier specified. The use case is that any changes to certain field in the job would send notification to the URL that is from Zapier and will then trigger the zap actions. This already works but after some time, it stops working. When I check the webhook via postman, i have to again reauthorize the app. Is there a way around this or what could be the cause for this?

Handling Webhook and Handling the Verification Requests

I am trying to create a integromat webhook scenario to watch for any changes to the job card. From what I gather, once setup, integromat will listen for any data that serviceM8 sends. If I was to change the job description in the job card and click save, serviceM8 would send the data in the change fields array, and the webhook would then pick it up and trigger a scenario. From what I gather, I need to create a webhook for this. I am trying to follow the instructions here: https://developer.servicem8.com/docs/webhooks-overview The first step is to create a web hook subscription, which I can do in integromat using the make API call module. I then need to setup a callback URL, which I believe I can create a new webhook module in integromat and copy and paste the URL into the webhook subscription. I think the part I am struggling with, is handling the verification requests. I believe my webhook module will pickup the data from ServiceM8, but I am unsure how to render a response to the request that includes only the challenge value. The example on how to implement the verification step is: <?php if ($_REQUEST['mode'] == 'subscribe' && $_REQUEST['challenge']) { echo $_REQUEST['challenge']; } // else: handle webhook POST data I don't fully understand the above, and not sure how to implement this using integromat. Any help would be really appreciated as I have been trying to figure this out for a long time now and really want to figure this out. Many thanks in advance!

Job Diary E-mail Type Through API

Hey, Currently trying to integrate into ServiceM8 through a separate software. Does anyone know if there's a way to view and also POST a job diary entry in the form of an e-mail communication. How it currently displays when a user sends/receives an e-mail through ServiceM8, in the job diary. I can't find a corresponding endpoint in the API. Any help would be appreciated!

Webhook notifications for badges being applied

My client would like to create an integration based on the application of badges. These badges may be applied to a job at any point and it would trigger a series of events. Is there a way to subscribe to a webhook when a badge is applied?

Job Endpoint Create/Update [Missing Data]

I don't know if I'm missing something - which is entirely possible! But when i update or create a new job using the REST API, if the customer is an existing customer and I use their uuid the job and billing contact fields are set to blank as is the job address and billing address. These are all the possible fields according to your documentation. ``` { "uuid": "123e4567-4145-4359-b6df-1de6b1bfb89b", "active": 1, "created_by_staff_uuid": "123e4567-371d-4b06-b546-1de6ba4aa4bb", "date": "YYYY-MM-DD", "company_uuid": "123e4567-9ad3-47e9-9e56-1de6b90af1eb", "job_address": "string", "billing_address": "string", "status": "string", "job_description": "string", "work_done_description": "string", "lng": 0, "lat": 0, "generated_job_id": "string", "payment_date": "YYYY-MM-DD HH:MM:SS", "payment_actioned_by_uuid": "123e4567-392d-4544-bca2-1de6bfb6f51b", "payment_method": "string", "payment_amount": "string", "total_invoice_amount": "string", "category_uuid": "123e4567-c842-427e-8b0b-1de6bcf3ea4b", "payment_note": "string", "geo_is_valid": "string", "purchase_order_number": "string", "invoice_sent": "string", "invoice_sent_stamp": "YYYY-MM-DD HH:MM:SS", "ready_to_invoice": "string", "ready_to_invoice_stamp": "YYYY-MM-DD HH:MM:SS", "payment_processed": "string", "payment_processed_stamp": "YYYY-MM-DD HH:MM:SS", "geo_country": "string", "geo_postcode": "string", "geo_state": "string", "geo_city": "string", "geo_street": "string", "geo_number": "string", "queue_uuid": "123e4567-789b-471a-9ff5-1de6b653357b", "queue_expiry_date": "YYYY-MM-DD HH:MM:SS", "queue_assigned_staff_uuid": "123e4567-5f23-44f8-afc8-1de6b6c57edb", "payment_received": "string", "payment_received_stamp": "YYYY-MM-DD HH:MM:SS", "badges": "string", "quote_date": "YYYY-MM-DD HH:MM:SS", "quote_sent": "string", "quote_sent_stamp": "YYYY-MM-DD HH:MM:SS", "work_order_date": "YYYY-MM-DD HH:MM:SS", "completion_date": "YYYY-MM-DD HH:MM:SS", "completion_actioned_by_uuid": "123e4567-461e-4e11-aa2c-1de6b7059dfb", "unsuccessful_date": "YYYY-MM-DD HH:MM:SS", "job_is_scheduled_until_stamp": "YYYY-MM-DD HH:MM:SS", "active_network_request_uuid": "123e4567-eff2-4b6a-b80e-1de6b2fc1e3b", "related_knowledge_articles": [ { "knowledge_article_uuid": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "relevance": 0 } ] } ```