Discussions

Ask a Question

New Client - x-record-uuid

We are trying to use the API to assist our business workflow. We have been doing some test for creating a new client and part of the API reference states : If no UUID is supplied, a UUID will be automatically generated for the new record and returned in the response header as x-record-uuid. However, when we submit a new client via the api the only response headers that can be accessed are. cache-control: max-age=0 content-length: 183 content-type: text/html;charset=UTF-8 expires: Thu, 06 May 2021 09:23:53 GMT This is because the access control for the headers does not allow the x-record-uuid to be exposed. Only content-range and content-length. access-control-expose-headers: Content-Range, Content-Length This means that we are unable to to use the newly created uuid. Is it possible to have the x-record-uuid exposed in the access-control-expose-headers list so it can be used. Thanks

API 400 error

I'm trying to integrate servicem8 using oauth so my clients can use it, currently my scope is read_customer_contacts, read_customers and manage_customers and i have a developer account and i'm trying to manage another trial account everything in the oauth part is working correctly, (authorizing the add on, generating refresh token and access token) but i'm unable to retrieve or post any data.. the error is: 400 error, The request could not be satisfied. this is the request i'm sending (exported from postman) curl --location --request POST 'https://api.servicem8.com/api_1.0/company.json' \ --header 'Accept: application/json' \ --header 'Authorization: Bearer {access_token}' \ --header 'Content-Type: application/json' \ --data-raw '{"name": "test company"}'

Problem with uploading a new Attachment to job via API

Hi, here is my code to upload attachment to my job. But this doesn't do anything. What is from in my request? const options = { method: 'POST', headers: { Accept: 'application/json', 'Content-Type': 'application/json', Authorization: 'Basic bWFyY2VsLmdvbG9iQHRlcm1vc2hvcC5zaTpQdXA4NjYxMQ==' }, body: JSON.stringify({ uuid: 'eae79142-af52-446c-b315-1e8eba13846b', related_object: 'job', related_object_uuid: 'eae79142-af52-446c-b315-1e8eba13846b', active: 1, attachment_name: 'nalog3.pdf', file_type: '.pdf', timestamp: '2022-06-07 00:00:00', attachment_source: 'nalog3.pdf' }) }; fetch('https://api.servicem8.com/api_1.0/attachment.json', options) .then(response => response.json()) .then(response => console.log(response)) .catch(err => console.error(err));
ANSWERED

Custom field deletion

I'm trying to delete a custom field via the API but it keeps returning an "Invalid UUID" message. I see the custom field when I do a GET request, then I copy/paste the UUID into the delete request. I have tried the following commands: `curl --request DELETE --url https://api.servicem8.com/custom_fields_1.0 --data UUID="xxx"` and `curl --request DELETE --url https://api.servicem8.com/custom_fields_1.0 --data '{"uuid":"xxx"}'` Both return the error `{"errorCode":100,"message":"Invalid UUID"}` even though I am copying/pasting the UUID directly from the GET response. Is this a bug or am I doing something wrong? Cheers

Private Add-on install URLs broken?

Hi there, Since late last week I've been unable to install my add-ons using the private install URLs provided in the developer section, when I navigate to the URL it just redirects back to the dashboard and never shows me the OAuth screen. This is happening with multiple addons, all of which I've installed with the same URL previously. I'm currently working around by going directly to the activation URL for my addons but obviously that's not ideal. Hope this is an easy fix! Thanks Joe
ANSWERED

QR codes for asset labels

Am wanting to create a customised label including the QR code for assets. For my printer I need to supply the embedded code that points to ServiceM8. Can you please cupply these codes.
ANSWERED

Integration with Google Drive

Hi there, I've created an integration for a client that automatically uploads files to Google Drive when they're taken on the job. Most of the photos come over but a few do not. When I click on the empty files, I see this error message: <?xml version="1.0" encoding="UTF-8"?> <Error><Code>NoSuchKey</Code><Message>The specified key does not exist.</Message><Key>attachments/servicem8_d30260/dbo_29170.jpg</Key><RequestId>949DE3DCB509CC32</RequestId><HostId>+9w5RcLs/wBehDyu2+2OjjQ1XI+G4WN2gRHCzrQfZtH03VOUFlPBVdKJTVRfSLkEsDPL5SBGbIs=</HostId></Error> Any ideas? Thank you.
ANSWERED

UUID - Unique to ServiceM8 or Instance of ServiceM8?

Hi there, We are going to be pulling about 4 instances of data to one table in our database to report on, we just want to make sure that the UUID fields are unique to ServiceM8 and not just the instance so we don't overlap. Job numbers themselves will have a different suffix to differentiate Thanks, Patrick

Duplicate job response.

Hi, I have set up webhook to get the JOb data. whenever I create a job in my serviceM8 account. It will give me the job data and then I use it further to add in some other platform. But I am facing some issue. when I create a new job I got a duplicate response. For the same job I have got two responses : Here is an example:- {"object":"JOB","entry":[{"uuid":"97c332a1-b904-473f-9cbf-dfb7c8cd201b","changed_fields":["active","billing_address","job_address","purchase_order_number","category_uuid","edit_date","company_uuid"],"time":"2020-02-04 01:59:03"}],"resource_url":"https:\/\/api.servicem8.com\/api_1.0\/JOB\/97c332a1-b904-473f-9cbf-dfb7c8cd201b.json"} {"object":"JOB","entry":[{"uuid":"97c332a1-b904-473f-9cbf-dfb7c8cd201b","changed_fields":["edit_date","payment_received","payment_received_stamp"],"time":"2020-02-04 01:59:04"}],"resource_url":"https:\/\/api.servicem8.com\/api_1.0\/JOB\/97c332a1-b904-473f-9cbf-dfb7c8cd201b.json"} I have got duplicate entries for the same job. Can anyone help?I can provide you more details. Thanks
ANSWERED

How can I fetch my client's data via REST API using Partner account?

Good day, I have my Partner account and it is connected to my client account. Now, what i need to do is fetch my client's data using REST API. How can I achieve that? *Note that im able to fetch my own data from my account* Thanks