Discussions

Ask a Question
ANSWERED

Permission Error When Accessing Camera in Servicem8 Add-On Using navigator.mediaDevices.getUserMedia()

I am developing an add-on that requires camera permissions to enable users to add images and scan barcodes. However, I am encountering a permission error when trying to access the camera. This issue only occurs when running the add-on in Servicem8, while it works fine in other environments. The specific line of code causing the issue is: ```javascript navigator.mediaDevices.getUserMedia({ video:true, audio:true }) ``` This line is supposed to prompt the user for camera permissions upon a button click and then activate the camera. The problem persists across both desktop and mobile versions of the Chrome browser. What could be causing this issue? Is it possible that Servicem8 is blocking the camera permissions? Here is the minimal code necessary to reproduce the problem: ```Text html <button onclick="accessCamera()">Access Camera</button> <script> function accessCamera() { navigator.mediaDevices.getUserMedia({ video:true, audio:true }) .then(function(stream) { /* use the stream */ }) .catch(function(err) { /* handle the error */ }); } </script> ```

Intermittent failure to Update Quote Line Items via API

We have noticed an increasing prevalence of Job updates via API not being shown in SM8 jobs. We update Quote Line Items and Work Completed inside SM8 Jobs, as well as sending PDFs to the Job Diary. Work Completed and PDFs always update – but sometimes the Line Items do not appear in the jobs. We do not get an error message because SM8 accepts the data – but sometimes it fails to publish the line items. Since last Tuesday this occurs much more frequently – it used to be once every 500 updates or so – now we have customers where it happens multiple times a week. The Job shows the 'Work Completed', but the line items are empty. If we send another update to the SM8 Job (containing a single line item), it prompts SM8 to show all the line items that have been sent previously. This proves that the data from initial upload is in SM8, but something is stopping the publication of the data to the SM8 Job. The second upload from FlatRateNOW prompts SM8 to show the data. Has anyone else noticed this? Thanks
ANSWERED

Attachments added via API

Following this API guide: <https://developer.servicem8.com/reference/post-attachment-create> I am trying to add an attachment to a job like this payload: { "active": 1, "related_object": "Job", "related_object_uuid": "9adf3227-b675-4a26-90fa-20404e82142b", "file_type": ".png", "attachment_source": "<https://maps.googleapis.com/maps/api/staticmap?center=-42.09278384,171.34470269&markers=-42.09278384,171.34470269&zoom=15&size=500x500&key=AIzaSyD3WoeCO2fiT-AaM8eebNvNBRsO4nGCjDE&maptype=roadmap">, "photo_width": "500", "photo_height": "500", "attachment_name": "Map" } Then when I query the list of attachments is shows** "active": 0:** { "uuid": "f8d61167-1b0d-438a-91da-204042377e3b", "edit_date": "2023-08-10 14:38:19", ** "active": 0,** "attachment_name": "Map", "file_type": ".png", "photo_width": "500", "photo_height": "500", "attachment_source": "https//maps.googleapis.com/maps/api/staticmap?center=-42.09278384,171.34470269&markers=-42.09278384,171.34470269&zoom=15&size=500x500&key=AIzaSyD3WoeCO2fiT-AaM8eebNvNBRsO4nGCjDE&maptype=roadmap", "lng": 0, "lat": 0, "tags": "", "extracted_info": "", "created_by_staff_uuid": "5c2d82fd-e11a-4108-8e91-203dae07cedb", "timestamp": "2023-08-10 14:38:19", "related_object": "job", "related_object_uuid": "9adf3227-b675-4a26-90fa-20404e82142b" } Trying to update the parameter does nothing: curl --request POST --url <https://api.servicem8.com/api_1.0/attachment/f8d61167-1b0d-438a-91da-204042377e3b.json> --header 'accept: application/json' --header 'authorization: Basic ...' --header 'content-type: application/json' --data '{"active":1}'

Geocordinates in new Job via API

I already have coordinates for jobs so when I add via the API, they are overridden by a search on the address. If I make the address invalid eg "job_address": "crap address ", "lng":171.34470269," "lat":-42.09278384, ...it defaults to the head office location "lng": 174.7644881, "lat": -36.8508827, What is the usage of lat+lng paramaters in the job create API? <https://developer.servicem8.com/reference/post-job-create>
ANSWERED

API doesn accept colons (:)

I have raised this issue before but now seeing the extent of how bad this behavior can be. Trying to add info into the Job description with a date-time in usual format e.g. 10 August 2023 12:38:38. The result in the Job window "10 August 2023 123838". Typing : into the job description field and saving the job saves the colon!!! Pleeeease alter your API to accept colons as it really doesnt make sense not to.

Custom fields numeric conversion, delete failure

I have created a numeric custom field and when I set one record to the value of 5555555 then look at the result via api or web interface and the value turns up as 5555560. I query the api for list of existing customfields and get this: [{"uuid":"81c6df78-765e-4bc4-885c-203f5cc5010b","object":"job","display_name":"Property ID","field_name":"prop_id","field_type":"Numeric","is_unique":0,"sort_priority":0,"max_length":0},{"uuid":"96051471-5c35-48ff-b768-203f59a3303b","object":"company","display_name":"Property ID","field_name":"prop_id","field_type":"Numeric","is_unique":1,"sort_priority":0,"max_length":0},{"uuid":"fbbb2eee-3ead-414b-b51d-203f5401ecdb","object":"job","display_name":"Kowhai Lead ID","field_name":"quote_lead_id","field_type":"Numeric","is_unique":0,"sort_priority":0,"max_length":0}] Immediately after I try to delete the fields and get this for each attempt: {"errorCode":100,"message":"Invalid UUID"} The DELETE method is called with payload of e.g. UUID=81c6df78-765e-4bc4-885c-203f5cc5010b as per documentation.

Filtering by Custom Field

Hi. I get correct results when filtering the API on a custom field like this: [company.json?%24filter=customfield_prop_id%20eq%20123](company.json?%24filter=customfield_prop_id%20eq%20x) If I search for something that shouldnt result in a match it always returns the first company/client in the list of clients. eg Changed search value to unused value: [company.json?%24filter=customfield_prop_id%20eq%2012333333](company.json?%24filter=customfield_prop_id%20eq%20x)
ANSWERED

SM8 Webhook performance

Is anyone having problems with the very slow delivery of webhooks from Sm8? Periodically SM8 stop sending webhooks for a while, sometimes 6 minutes, sometimes an hour, and then they send a tital of webhooks built up over that time? This used to be rare but is happening with more frequency. This morning it has been almost 3 hours where we received about 20 webhooks in place of the usual 1000s. We await the tidal wave

Custom Feilds Calculation

Is it possible to run a custom field input through an equation before having the output on say a quote template? Has anyone done this?

Is there a way to create a zap to create a job

hi looking to zap in a job but its needs to be able to use a job template, is this possible?