Discussions

Ask a Question

Custom Fields API Call - 401

I'm trying to do a GET as documented here: https://developer.servicem8.com/reference#custom-fields-1 So far I've been able to do GETs on over a dozen other entities (Jobs, Tasks etc) and they're all ok. But when I try to get the Custom Fields listing, I get this error: 401 Unauthorized : You couldn't be authenticated I've tried both with my Auth Token (as per the other entities), and without. And in Postman and also with your Try It button on that page. Please help.
ANSWERED

Basic API Auth query

Hi, We have been syncing data daily for a number of years with this email for a client using basic Auth (private app), however when trying to Auth for a potential new client (and we can log into ServiceM8 with their credentials) then we get an Auth error. Is there a particular plan or setting that has to be set to enable basic API auth? I don't want to share emails or business names on a public forum, so if someone could email me back, that would be much appreciated

Job Activity Time

Hi there, I'm looking at building an add-on that requires more flexible scheduling that 15 mins. For instance, I tried passing a start and end time that were one minute apart and got this response - "end_date must round to 15 minute period". Can I override this? Thank you.

Programming languages for API?

Hi there, I am wondering what programming languages are required for the ServiceM8 API? I am currently on the look out for a backend web developer but before I search for one I need to know the programming languages to find the right person. ServiceM8's customer service team told me Python for web and Swift for app. Can I confirm this? I am not sure what the difference is here (I know they are both programming languages, but not sure when they'd be used). Thanks! Dmitri.

Invalid grant error

I create script in php so once i allowed the scope i get access token and refresh token. Then whenever i run file of create contact in servicem8 i get new token from refresh token then use that new token of creating contact. But this automatically stop after 2 or 3 days. Please tell me how i can solve this
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}'

Webhooks repeatetly sent

Hi I am in the process of implementing webhooks but find that the same status update is being resent every 5 minutes despite having responded with Status Code 200 (OK) Anything else that the response must contain to make it stop resending the same object change over and over? Also in the documentation it says it would resend the change once per hour in case of failure, but I am getting changes every 5 minutes (not making any changes) but getting the change notification basically again and again over and over for the one change.

Creation of Job Materials via API

Trying to create Job Materials via the API and am met with this error, Provided displayed_amount is incorrect. Expected [13] In the post, if I change the displayed amount to be Quantity * Price (which is the displayed amount anyway). I'm met with a different error being that my inc/ex GST prices aren't a match or something. This is my current post: {"active":1,"quantity":"3","job_uuid":"JOB UUID HERE","price":"13","name":"STD Bin","displayed_amount":"0"} Please note the "JOB UUID HERE" actually contains the JOB UUID and isn't just plain text. Also tried adding 0 & 13 to the displayed amount, none of which worked.

Is_primary key in job_contact

Am I right in saying that the is_primary_key in job_contact either does not exist or is not used?

Viewing the console

If I edit the code for an addon online, within the addon itself and then test it on a job or client card, how can I view the results of console.log?