0

I just wanna ask How to sync the data of Contact Details to Jobs. I have tried them under the same UUID's but the Job is getting the Company Name(Client) only so basically my Job Record has name in Company column only, there is no Contact First and Contact Last which is the Company Contact.

Thanks! Kudos to all the guys here.

1 Answers1

0
  1. Create the Company (i.e. client/customer) record, fetch its UUID via the x-record-uuid HTTP header.
  2. Create the Job record, set the company_uuid field to the UUID of the Company. Fetch the UUID of the Job via the x-record-uuid header.
  3. Create JobContact record(s), setting the job_uuid field to the UUID of the job you just created. You also need to set the type field to JOB or BILLING (case sensitive)

Note that you can also create CompanyContact records but these are only used for future jobs created for that company via the ServiceM8 UI. They don't affect jobs directly, and they aren't automatically used if you create jobs via the API.

telomere
  • 338
  • 3
  • 10
  • Hello I have a question. Where can I find the App ID and App Secret. Because we cannot find it on the settings view. We don't have that developer view though. Thanks in Advance telomere – Brian Dela Cruz Aug 21 '18 at 14:40
  • Create your Store Item first (Partner menu > Store Connect), or the "Developer" menu if you have ticked the "Developer" option in your partner preferences. Then set its type to "Addon". Then when you click the edit button for that Store Item, you will see the app id and app secret. https://developer.servicem8.com/docs/your-first-add-on – telomere Aug 22 '18 at 02:18
  • Should I have a plan first before having the ones that you said? I already watched the video and all still I can't find the Developer menu. Only settings and the addon. But for the addon. Example, when I go to services there is a settings button only inside. – Brian Dela Cruz Aug 22 '18 at 15:24
  • It doesn't require a paid plan. Go to the Partner menu (phone icon in the top right). then click "Store Connect". If you don't have that the phone icon then you haven't a got a Partner account (Developer account is a specific type of partner account) and you need to sign up for one using the process shown in the video from the previous link. – telomere Aug 22 '18 at 23:24
  • Found it. But still we're finding the app id and app secret for the OAuth2.0? Can I have your email address? or you will be answering questions here? – Brian Dela Cruz Aug 23 '18 at 14:35
  • I mean not the add-on but the ServiceM8's app id and app secret – Brian Dela Cruz Aug 23 '18 at 16:12
  • Please read the guide here on OAuth2 - your app's Addon ID and Secret are all that you need https://developer.servicem8.com/docs/authentication – telomere Aug 25 '18 at 00:13
  • Hi Telomere. Here's the case, we're subscribing webhooks to our application. But there is a OAuth required. Now, App ID and App secrets are only available on the add ons. Is there any App ID secret that is unique or for that specific account? or It's just naturally giving so many App ID and secret when creating many add ons, If so, which of those should I use? Should I use it all? P.S. We need webhooks for the Job History and Clients page for the Job cards, etc. – Brian Dela Cruz Aug 30 '18 at 14:17
  • The App ID and App Secret identifies your app to ServiceM8. You use that information during the OAuth connect process to generate Access Tokens, which allow you to access account data. You only need a single App ID and App Secret, and you use that to generate many different Access Tokens (one per account that you want to connect to). The whole process is described here: https://developer.servicem8.com/docs/authentication and there is heaps of documentation around the web if you want more details on how OAuth2 works. – telomere Aug 31 '18 at 02:15
  • Hi Telomere, We're using Postman to test some things in webhooks. Were getting this message Success: False Message: "Please specify an object for Subscription". – Brian Dela Cruz Sep 04 '18 at 10:29
  • "Note that the data POSTed to your callback URL does not contain the object itself — only the UUID and a list of fields that changed. You can request the URL specified by resource_url to obtain the object itself. The timestamp provided will be in UTC." Does the Webhook only gives the fields that are changed and its UUID? Then the POST method will be on our end? – Brian Dela Cruz Sep 04 '18 at 11:32