# APIs and developer resources

### APIs and developer resources

**Shedmate Webhook documentation**

Webhooks provide a way for Shedmate to integrate and notify your company of important events that happen in the system. The mechanism Shedmate uses for its Webhooks is based on HTTP requests and the body (payload) is sent in JSON format.

*More about JSON format:* [*https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/JSON*](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/JSON)

You can use the data that comes with the Webhook for a lot of different things, you can send push notifications to your phone, send emails, send SMS, and automate workflows for marketing or CRM intelligence. The possibilities are endless.

If you are an administrator on your company account, you can follow the steps below if you are not, please ask your administrator to do so.

Also, you will need a subscriber for the data you are going to receive. This subscriber will provide an URL that we can “hook” into Shedmate. Shedmate will then call this URL to notify the subscriber when important events happen.

<br>

**OPTIONAL STEP**

*As an example, we are going to use an account in* [*Make*](https://www.make.com/en)*, previously known as Integromat. Chances are you already have a system, server, or another automation platform as the subscriber, but if you like to follow along, go ahead and create an account in Make, then create a scenario with a Webhook to get the URL. If you are unsure how to do that, please use their help system to do so, then continue on with this documentation.*

*Create an account in Make:* [*https://www.make.com/en/register*](https://www.make.com/en/register)

<figure><img src="https://1247870272-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSXoRgDyJukQzyOctBwWG%2Fuploads%2FwqlxOYuuXKj48FzIwwfZ%2Fimage.png?alt=media&#x26;token=ac34c092-aedc-4e3c-b7ac-1edc67395a52" alt=""><figcaption></figcaption></figure>

**Setting up your webhook:**

Log on to the portal and click on the company button on the left side menu.

<figure><img src="https://1247870272-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSXoRgDyJukQzyOctBwWG%2Fuploads%2FLGT1u717iuAATbtYNGmT%2Fimage.png?alt=media&#x26;token=cf7f7f07-734e-49bd-9693-c67787e02a5c" alt=""><figcaption></figcaption></figure>

Scroll down to the bottom of the page and page the URL in the WebhookUrl field of the company profile page. Done, now you can start receiving notifications from Shedmate in your system.

<figure><img src="https://1247870272-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSXoRgDyJukQzyOctBwWG%2Fuploads%2F0ZsVPkbYS2BKVeiqX03X%2Fimage.png?alt=media&#x26;token=b2e66c25-6c3b-4b3f-8373-578720c8cef2" alt=""><figcaption></figcaption></figure>

**Shedmate Webhook Reference:**

In this section, we will describe the data that comes with webhook notifications. Notice that more details on each “Type of Data” with descriptions and tables are provided at the end of this document.

Each Shedmate notification will come with a standard payload, containing metadata about the notification, some of your company details, and the details about that particular notification, as follows:

**Payload Details:**

| **Key** | **Type of Data**       | **Description**                                                                                                                  |
| ------- | ---------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| data    | *Varies*               | Varies depending on the type of notification, please check each notification in the next section to see details of each of them. |
| type    | NotificationTypeString | The identification for the notification.                                                                                         |
| company | CompanyInfo            | The information about the client that owns that job.                                                                             |
| sentAt  | ISO Date String (UTC)  | The ISO date format for when the notification was sent.                                                                          |

Currently, Shedmate provides notifications for the following events:

<br>

**When a new Job is created:**

**Description:** This happens when a new job is created in Shedmate or a draft is promoted to a job.

**Details:**

<table data-header-hidden><thead><tr><th width="222">Key</th><th width="169">Type of Data</th><th>Description</th></tr></thead><tbody><tr><td>createdAt</td><td>ISO Date String (UTC)</td><td>The ISO date format for when the Job was created</td></tr><tr><td>createdBy</td><td>IssuerInfo</td><td>The information about who created the job.</td></tr><tr><td>clientSnapShot</td><td>IssuerInfo</td><td>The information about the client that owns that job.</td></tr><tr><td>companyContactSnapShot</td><td>IssuerInfo</td><td>If this job is for a company or organization this will contain the company information.</td></tr><tr><td>responsibl</td><td>IssuerInfo</td><td>The information about who was assigned as the responsible for this job.</td></tr><tr><td>isThirdPartyBuilder</td><td>Boolean</td><td>Informs if this job is going to be built by your company or it is a supply only job.</td></tr><tr><td>clientIsTheBuilder</td><td>Boolean</td><td>Informs if this job is going to be built by the client or another company or individual builder.</td></tr><tr><td>thirdPartyBuilderSnapShot</td><td>IssuerInfo</td><td>If this has a third-party builder, this will inform the details of the builder.</td></tr><tr><td>jobType</td><td>ShedTypeString</td><td>“C Shed” representing cold rolled or “Solid Shed” representing hot formed steel shed.</td></tr><tr><td>usage</td><td>ShedUsageString</td><td>The usage of the shed, like “Rural”, “Carport”, “Domestic”, etc.</td></tr><tr><td>jobCount</td><td>Integer</td><td>The number portion of the job number. The first job of the company will be 1 and it will increase per job. It never resets, and it doesn’t come down even when you archive a job. It is unique per job, per company.</td></tr><tr><td>jobNumber</td><td>String</td><td>The complete “name” of the job, contains the client name, job count, type of shed, date, and even additional information when needed. It uniquely identifies a job and helps on ordering, bookkeeping, and so on.</td></tr><tr><td>jobNumberAddition</td><td>String</td><td>The Additional (optional) information of the job number</td></tr><tr><td>companyId</td><td>String</td><td>The unique identifier of your company inside of Shedmate System.</td></tr><tr><td>useClientAddress</td><td>Boolean</td><td>If the job site address is the same as the client’s postal address.</td></tr><tr><td>address</td><td>AddressInfo</td><td>The details of the job site.</td></tr><tr><td>enquiryComments</td><td>String</td><td>Optional comments that come from the Draft if it was created by a client on the Enquiry System. This will not be sent for jobs created as draft directly.</td></tr><tr><td>enquiryHeardAboutUs</td><td>String</td><td>This will contain the platform name that the client heard about the company when using the enquiry system. This will not be sent for jobs created as draft directly.</td></tr></tbody></table>

**When a new Client is created:**

<br>

**Description:** This happens when a new client is created in Shedmate. This can happen when creating a new job and the client was created on the fly or the client was created directly.

**Payload Details:**

| **Key**                              | **Type of Data**                         | **Description**                                                         |
| ------------------------------------ | ---------------------------------------- | ----------------------------------------------------------------------- |
| createdAt                            | ISO Date String (UTC)                    | The ISO date format for when the Job was created                        |
| createdBy                            | IssuerInfo                               | The information about who created the job.                              |
| companyId                            | String                                   | The unique identifier of your company inside of Shedmate System.        |
| isOrganization                       | Boolean                                  | Identifies if this client is a company or a person.                     |
| organizationName                     | String                                   | If this client is a company, this will have its name.                   |
| firstName                            | String                                   | If this client is a person, this will contain their name.               |
| lastName                             | String                                   | If this client is a person, this will contain their last name.          |
| email                                | String                                   | The email address for the client.                                       |
| phone1                               | String                                   | The client’s phone number.                                              |
| <p><br></p><p>phone2</p><p><br></p>  | <p><br></p><p>String</p><p><br></p>      | <p><br></p><p>The client’s optional second phone number.</p><p><br></p> |
| <p><br></p><p>Address</p><p><br></p> | <p><br></p><p>AddressInfo</p><p><br></p> | <p><br></p><p>The client’s address details.</p><p><br></p>              |

**When a new Draft is created:**

**Description:** This happens when a new draft is created in Shedmate.

**Details:** *Same as Job payload. Notice that since it is a draft, less information about the job is sent.*

<br>

**When a new Enquiry is created:**

**Description:** This happens when a new enquiry is sent from the enquiry system into Shedmate and becomes a draft in the company.

**Details:** *Same as Job payload. Notice that since it is a draft, less information about the job is sent.*

<br>

**Data Types and Details:**

String:

| **Type of Dat**                     | **Example**                               | **Description**                                           |
| ----------------------------------- | ----------------------------------------- | --------------------------------------------------------- |
| <p><br></p><p>String</p><p><br></p> | <p><br></p><p>Hello there!</p><p><br></p> | <p><br></p><p>A text, array of characters.</p><p><br></p> |

Boolean:

<br>

<br>

<br>

<br>

| <p><br></p><p><strong>Type of Data</strong></p><p><br></p> | <p><br></p><p><strong>Example</strong></p><p><br></p> | <p><br></p><p><strong>Description</strong></p><p><br></p> |
| ---------------------------------------------------------- | ----------------------------------------------------- | --------------------------------------------------------- |
| <p><br></p><p>Boolean</p><p><br></p>                       | <p><br></p><p>true</p><p><br></p>                     | <p><br></p><p>true or false.</p><p><br></p>               |

<br>

<br>

<br>

<br>

<br>

Integer:

<br>

<br>

| <p><br></p><p><strong>Type of Data</strong></p><p><br></p> | <p><br></p><p><strong>Example</strong></p><p><br></p> | <p><br></p><p><strong>Description</strong></p><p><br></p>     |
| ---------------------------------------------------------- | ----------------------------------------------------- | ------------------------------------------------------------- |
| <p><br></p><p>Integer</p><p><br></p>                       | <p><br></p><p>1</p><p><br></p>                        | <p><br></p><p>A number with no decimal places.</p><p><br></p> |

<br>

<br>

<br>

<br>

<br>

NotificationTypeString:

<br>

<br>

| <p><br></p><p><strong>Type of Data</strong></p><p><br></p> | <p><br></p><p><strong>Example</strong></p><p><br></p> | <p><br></p><p><strong>Description</strong></p><p><br></p>                                          |
| ---------------------------------------------------------- | ----------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
| <p><br></p><p>NotificationTypeString</p><p><br></p>        | <p><br></p><p>new\_enquiry</p><p><br></p>             | <p><br></p><p>Can be one of the following: new\_enquiry, new\_client, or new\_draft</p><p><br></p> |

<br>

<br>

<br>

<br>

<br>

ShedTypeString:

<br>

<br>

| <p><br></p><p><strong>Type of Data</strong></p><p><br></p> | <p><br></p><p><strong>Example</strong></p><p><br></p> | <p><br></p><p><strong>Description</strong></p><p><br></p>                                                         |
| ---------------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| <p><br></p><p>ShedTypeString</p><p><br></p>                | <p><br></p><p>C Shed</p><p><br></p>                   | <p><br></p><p>Can be either a “C Shed” (Cold rolled) or “Solid Shed” (Hot formed) steel shed type.</p><p><br></p> |

ShedUsageString:

<br>

<br>

| <p><br></p><p><strong>Type of Data</strong></p><p><br></p> | <p><br></p><p><strong>Example</strong></p><p><br></p> | <p><br></p><p><strong>Description</strong></p><p><br></p>                                              |
| ---------------------------------------------------------- | ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------ |
| <p><br></p><p>ShedUsageString</p><p><br></p>               | <p><br></p><p>Domestic</p><p><br></p>                 | <p><br></p><p>Can be either “Rural”, “Carport”, “Domestic”, “Commercial” or “Extension”</p><p><br></p> |

<br>

<br>

&#x20;

<br>

<br>

ISO Date String:

<br>

<br>

| <p><br></p><p><strong>Type of Data</strong></p><p><br></p> | <p><br></p><p><strong>Example</strong></p><p><br></p>          | <p><br></p><p><strong>Description</strong></p><p><br></p>                                           |
| ---------------------------------------------------------- | -------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
| <p><br></p><p>ISO Date String (UTC)</p><p><br></p>         | <p><br></p><p>2022-11-20T21:27:16.1798424+00:00</p><p><br></p> | <p><br></p><p>Contains year, month, day, hour, minutes, and seconds relative to UTC.</p><p><br></p> |

<br>

<br>

&#x20;

<br>

<br>

| <p><br></p><p><strong>Type of Data</strong></p><p><br></p> | <p><br></p><p> </p><p><br></p>                                                                      | <p><br></p><p><strong>Description</strong></p><p><br></p>                                              |
| ---------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ |
| <p><br></p><p>IssuerInfo</p><p><br></p>                    | <p><br></p><p><em>It is an object containing the information in the table below</em></p><p><br></p> | <p><br></p><p>Contains name, email, phone number and more information about the issuer.</p><p><br></p> |

Issuer Info details:

<br>

<br>

&#x20;

| <p><br></p><p><strong>Key</strong></p><p><br></p> | <p><br></p><p><strong>Type of Data</strong></p><p><br></p> | <p><br></p><p><strong>Example</strong></p><p><br></p>                                                          | <p><br></p><p><strong>Description</strong></p><p><br></p>                              |
| ------------------------------------------------- | ---------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
| <p><br></p><p>firstName</p><p><br></p>            | <p><br></p><p>String</p><p><br></p>                        | <p><br></p><p><em>John</em></p><p><br></p>                                                                     | <p><br></p><p>If this is a person, it will contain their name.</p><p><br></p>          |
| <p><br></p><p>lastName</p><p><br></p>             | <p><br></p><p>String</p><p><br></p>                        | <p><br></p><p><em>Smith</em></p><p><br></p>                                                                    | <p><br></p><p>If this is a person, it will contain their last name.</p><p><br></p>     |
| <p><br></p><p>organizationName</p><p><br></p>     | <p><br></p><p>String</p><p><br></p>                        | <p><br></p><p><em>Apple</em></p><p><br></p>                                                                    | <p><br></p><p>If this is a company, it will contain their company name.</p><p><br></p> |
| <p><br></p><p>email</p><p><br></p>                | <p><br></p><p>String</p><p><br></p>                        | <p><br></p><p><em>“</em><a href="mailto:john@gmail.com"><em><john@gmail.com></em></a><em>”</em></p><p><br></p> | <p><br></p><p>The person’s or company’s email.</p><p><br></p>                          |
| <p><br></p><p>isOrganization</p><p><br></p>       | <p><br></p><p>Boolean</p><p><br></p>                       | <p><br></p><p>false</p><p><br></p>                                                                             | <p><br></p><p>Identifies whether this issuer is a company or person.</p><p><br></p>    |
| <p><br></p><p>phone1</p><p><br></p>               | <p><br></p><p>String</p><p><br></p>                        | <p><br></p><p>“489 265 658”</p><p><br></p>                                                                     | <p><br></p><p>The issuer’s main phone number.</p><p><br></p>                           |
| <p><br></p><p>phone2</p><p><br></p>               | <p><br></p><p>String</p><p><br></p>                        | <p><br></p><p>“499 265 658”</p><p><br></p>                                                                     | <p><br></p><p>The issuer’s optional phone number.</p><p><br></p>                       |
| <p><br></p><p>address</p><p><br></p>              | <p><br></p><p>AdressInfo</p><p><br></p>                    | <p><br></p><p><em>It is an object containing the information in the AddressInfo table.</em></p><p><br></p>     | <p><br></p><p>The issuer’s address details.</p><p><br></p>                             |

<br>

<br>

<br>

<br>

&#x20;

<br>

<br>

<br>

<br>

&#x20;

**AddressInfo details:**

Company Info details:

<br>

<br>

<br>

<br>

<br>

<br>

Issuer Info:

| **Key**     | **Type of Data** | **Example**         | **Description**                                                 |
| ----------- | ---------------- | ------------------- | --------------------------------------------------------------- |
| number      | String           | *1/2A*              | The number of the house or block.                               |
| name        | String           | *Main Street*       | Name of the street, road, etc.                                  |
| city        | String           | *Melbourne*         | City, Town, Suburb, etc.                                        |
| country     | String           | *Australia*         | Country                                                         |
| state       | String           | *Victoria*          | The State, Territory, or Province.                              |
| postal      | String           | *5020*              | Postal code.                                                    |
| council     | String           | *Greater Geelong*   | The council or county or city hall that regulates this address. |
| coordinates | String           | *-37.8473, 140.778* | The GPS coordinates of the address.                             |

<br>

| <p><br></p><p><strong>Key</strong></p><p><br></p> | <p><br></p><p><strong>Type of Data</strong></p><p><br></p> | <p><br></p><p><strong>Example</strong></p><p><br></p> | <p><br></p><p><strong>Description</strong></p><p><br></p>                                    |
| ------------------------------------------------- | ---------------------------------------------------------- | ----------------------------------------------------- | -------------------------------------------------------------------------------------------- |
| <p><br></p><p>name</p><p><br></p>                 | <p><br></p><p>String</p><p><br></p>                        | <p><br></p><p>Blue Aussie Sheds LTDA</p><p><br></p>   | <p><br></p><p>Your company name.</p><p><br></p>                                              |
| <p><br></p><p>phone1</p><p><br></p>               | <p><br></p><p>String</p><p><br></p>                        | <p><br></p><p>“489 265 658”</p><p><br></p>            | <p><br></p><p>Your company number.</p><p><br></p>                                            |
| <p><br></p><p>phone2</p><p><br></p>               | <p><br></p><p>String</p><p><br></p>                        | <p><br></p><p>“499 265 658”</p><p><br></p>            | <p><br></p><p>Your company optional second number.</p><p><br></p>                            |
| <p><br></p><p>streetNumber</p><p><br></p>         | <p><br></p><p>String</p><p><br></p>                        | <p><br></p><p>1/2A</p><p><br></p>                     | <p><br></p><p>The number of the house or block.</p><p><br></p>                               |
| <p><br></p><p>streetName</p><p><br></p>           | <p><br></p><p>String</p><p><br></p>                        | <p><br></p><p>Main Street West</p><p><br></p>         | <p><br></p><p>Name of the street, road, etc.</p><p><br></p>                                  |
| <p><br></p><p>city</p><p><br></p>                 | <p><br></p><p>String</p><p><br></p>                        | <p><br></p><p><em>Melbourne</em></p><p><br></p>       | <p><br></p><p>City, Town, Suburb, etc.</p><p><br></p>                                        |
| <p><br></p><p>state</p><p><br></p>                | <p><br></p><p>String</p><p><br></p>                        | <p><br></p><p><em>Australia</em></p><p><br></p>       | <p><br></p><p>The State, Territory, or Province.</p><p><br></p>                              |
| <p><br></p><p>country</p><p><br></p>              | <p><br></p><p>String</p><p><br></p>                        | <p><br></p><p><em>Australia</em></p><p><br></p>       | <p><br></p><p>Country</p><p><br></p>                                                         |
| <p><br></p><p>postalCode</p><p><br></p>           | <p><br></p><p>String</p><p><br></p>                        | <p><br></p><p><em>5020</em></p><p><br></p>            | <p><br></p><p>Postal code.</p><p><br></p>                                                    |
| <p><br></p><p>council</p><p><br></p>              | <p><br></p><p>String</p><p><br></p>                        | <p><br></p><p><em>Greater Geelong</em></p><p><br></p> | <p><br></p><p>The council or county or city hall that regulates this address.</p><p><br></p> |
| <p>coordinates</p><p><br></p>                     | <p>String</p><p><br></p>                                   | <p><em>-37.8473, 140.778</em></p><p><br></p>          | The GPS coordinates of the address.                                                          |
