Admin

Webhooks

Permanently deleted user
Permanently deleted user
  • Updated

Topic: Webhooks 

Audience: Sales Admins and technical staff/developers 

Details:  What are webhooks?  Webhooks allow your application to receive notifications when some actions or events occur.  Spotio will make a POST request to your endpoint with event information for example when new lead is added. You can configure what events you would like to get and for what endpoint.

How do I create webhooks? Navigate to the SPOTIO web application and go to Settings → Integrations → Webhooks.  On this page you can see the secret you’ll need to share with the connecting system, as well as the field to input the valid URL.  


Screen_Shot_2020-11-10_at_12.33.39_PM.png

Once you’ve set up the URL, you can then see the selection for which events that occur in SPOTIO will then push data into your connected system. 

Possible event types:

Event type

Description

activity.created

when activity is created

activity.deleted

when activity is deleted

activity.updated

when activity is updated

activity.done

when activity is done, for example lead staged has changed

appointment.created

when appointment is created

appointment.updated

when appointment is update

appointment.deleted

when appointment is deleted

lead.added

when lead is added

lead.deleted

when lead is deleted

lead.updated

when lead is updated

 

How to test Webhooks:

To see what data is sent from Spotio you need to open a page: https://pipedream.com/sources. To this application we will send data from Spotio. To make it possible, you need to integrate webhooks into Spotio. In the Callback URL field enter the address  found in pipedream, select the event, execute this event in Spotio and go to Pipedream. Below the video:

Pipedream test video example

For further information we’ve provided the webhook request schema: 

{

  "payload": [

    {

      "data": {

           ... object format depends on the event ...

        }

      },

      "type": "lead.added",

      "date": "2020-09-03T19:43:23.069437+00:00"

    }

  ]

}

Attribute

Type

Description

payload

array 

An array of event objects

 

The event object:

Attribute

Type

Description

date

datetime offset

Time when the event occurred

type

string 

Event type

data

object

Event data

 

Your webhook endpoint must respond with code 200, otherwise Spotio will retry the request up to 3 times with increasing intervals.Please use asynchronous processing, because each request timeout after 10 seconds.

Requests include an X-Signature header. The header contains a hex-encoded HMAC-SHA256 signature of the request body, using your secret as the signing key. Your app is able to verify that the request came from Spotio.

Example Webhooks for each event:

Leads

{

  "payload": [

    {

      "data": {

        "id": "5f5214ef2050870001dab572",

        "createdAt": "2020-09-04T10:20:31.3778028+00:00",

        "updatedAt": "2020-09-04T10:20:31.3778028+00:00",

        "assignedUserId": 73244,

        "assignedUserName": "Maciej Królicki",

        "assignedUserEmail": "maciej+100@spotio.com",

        "assignedUserPhone": "+48796329885#100",

        "updatedAtUserName": "Maciej Królicki",

        "updatedAtUserEmail": "maciej+100@spotio.com",

        "company": "Ergo Arena",

        "address": {

          "fullAddress": "plac Dwóch Miast 1, 80-344 Gdańsk, Poland",

          "lat": 54.426445545222734,

          "lng": 18.58053313396899,

          "street": "Pomorskie",

          "houseNumber": "1",

          "zip": "80-344",

          "city": "Gdańsk",

          "state": "Pomorskie",

          "country": "PL"

        },

        "fields": [

          {

            "id": 16,

            "values": [

              "10-100"

            ],

            "title": "Number of employees"

          }

        ],

        "contacts": [

          {

            "firstName": "Jan",

            "lastName": "Kowalski",

            "fields": [

              {

                "id": 2,

                "values": [

                  "jan.kowalski@ergoarena.pl"

                ],

                "title": "Email"

              },

              {

                "id": 3,

                "values": [

                  "+48 600500600"

                ],

                "title": "Phone"

              }

            ]

          }

        ],

        "stageId": 1,

        "stageName": "Prospecting",

        "value": 200000.0,

        "lastActivityTime": "2020-09-04T10:20:31.3778028+00:00",

        "visitsCount": 0,

        "dateOfAssignment": "2020-09-04T10:20:31.3778028+00:00",

        "callCount": 0

      },

      "type": "lead.added",

      "date": "2020-09-04T10:20:31.3778028+00:00"

    }

  ]

}

 

The lead object:

Attribute

Type

Description

id

string

An identifier

createdAt

datetime offset

Date of creation

updatedAt

datetime offset

Date of update

updatedAtUserName

int

Updated by user name

updatedAtUserEmail

string

Updated by user email

assignedUserId

int

Assigned to user id

assignedUserName

string

Assigned to user name

assignedUserEmail

string

Assigned to user email

company

string

The company name

address

object

  • fullAddress
  • lat
  • lng
  • street
  • houseNumber
  • zip
  • city
  • state
  • country

fields

array

An array of fields

contacts

array

An array of contacts

stageId

int

Current lead stage id

stageName

string

Current lead stage name

value

decimal

Lead value

lastActivityTime

datetime offset

Last activity date

visitsCount

int

Number of visits

dateOfAssignment

datetime offset

Date of assignment to user

callCount

int

Number of calls

 

Activities

{

  "payload": [

    {

      "data": {

        "id": 536061869,

        "title": "Text title",

        "notes": "note note note note",

        "date": "2020-09-08T11:30:00.974+00:00",

        "duration": 15,

        "type": "Event",

        "done": false,

        "previousStageId": 1,

        "previousStageName": "Prospecting",

        "stageId": 1,

        "stageName": "Prospecting",

        "lead": {

          "id": "5f5214ef2050870001dab572",

          "createdAt": "2020-09-04T10:20:31.3778028+00:00",

          "updatedAt": "2020-09-04T10:29:43.9446509+00:00",

          "assignedUserId": 73244,

          "assignedUserName": "Maciej Królicki",

          "assignedUserEmail": "maciej+100@spotio.com",

          "assignedUserPhone": "+48796329885#100",

          "updatedAtUserName": "Maciej Królicki",

          "updatedAtUserEmail": "maciej+100@spotio.com",

          "company": "Ergo Arena",

          "address": {

            "fullAddress": "plac Dwóch Miast 1, 80-344 Gdańsk, Poland",

            "lat": 54.426445545222734,

            "lng": 18.58053313396899,

            "street": "Pomorskie",

            "houseNumber": "1",

            "zip": "80-344",

            "city": "Gdańsk",

            "state": "Pomorskie",

            "country": "PL"

          },

          "fields": [

            {

              "id": 16,

              "values": [

                "10-100"

              ],

              "title": "Number of employees"

            }

          ],

          "contacts": [

            {

              "firstName": "Jan",

              "lastName": "Kowalski",

              "fields": [

                {

                  "id": 2,

                  "values": [

                    "jan.kowalski@ergoarena.pl"

                  ],

                  "title": "Email"

                },

                {

                  "id": 3,

                  "values": [

                    "+48 600500600"

                  ],

                  "title": "Phone"

                }

              ]

            }

          ],

          "stageId": 1,

          "stageName": "Prospecting",

          "value": 200000.0,

          "lastActivityTime": "2020-09-04T10:29:43.9446509+00:00",

          "visitsCount": 0,

          "dateOfAssignment": "2020-09-04T10:20:31.3778028+00:00",

          "callCount": 0,

          "nextActivityTime": "0001-01-01T00:00:00+00:00"

        }

      },

      "type": "activity.created",

      "date": "2020-09-04T10:31:16.3852738+00:00"

    }

  ]

}

 

The activity object:

Attribute

Type

Description

id

string

An identifier

title

string

Title

notes

string

Notes

date

datetime offset

Date

duration

int

Duration in minutes

type

string / enum

  • note - when note is added to lead
  • event - when event activity is added to lead like text, appointment etc.
  • ownerchanged - when lead owner is changed
  • transition - when lead staged is changed

done

boolean

Is activity done

previousStageId

int

Previous lead stage id

previousStageName

string

Previous lead stage name

stageId

int

Current lead stage id

stageName

string

Current lead stage name

lead

The lead object

 

Appointments

{

  "payload": [

    {

      "data": {

        "id": 300373500,

        "title": "Meet with boss",

        "notes": "Prepare special offers",

        "durationInMinutes": 60,

        "date": "2020-09-06T11:30:00+00:00",

        "completed": false,

        "lead": {

          "id": "5f5214ef2050870001dab572",

          "createdAt": "2020-09-04T10:20:31.3778028+00:00",

          "updatedAt": "2020-09-04T10:20:31.3778028+00:00",

          "assignedUserId": 73244,

          "assignedUserName": "Maciej Królicki",

          "assignedUserEmail": "maciej+100@spotio.com",

          "assignedUserPhone": "+48796329885#100",

          "updatedAtUserName": "Maciej Królicki",

          "updatedAtUserEmail": "maciej+100@spotio.com",

          "company": "Ergo Arena",

          "address": {

            "fullAddress": "plac Dwóch Miast 1, 80-344 Gdańsk, Poland",

            "lat": 54.426445545222734,

            "lng": 18.58053313396899,

            "street": "Pomorskie",

            "houseNumber": "1",

            "zip": "80-344",

            "city": "Gdańsk",

            "state": "Pomorskie",

            "country": "PL"

          },

          "fields": [

            {

              "id": 16,

              "values": [

                "10-100"

              ],

              "title": "Number of employees"

            }

          ],

          "contacts": [

            {

              "firstName": "Jan",

              "lastName": "Kowalski",

              "fields": [

                {

                  "id": 2,

                  "values": [

                    "jan.kowalski@ergoarena.pl"

                  ],

                  "title": "Email"

                },

                {

                  "id": 3,

                  "values": [

                    "+48 600500600"

                  ],

                  "title": "Phone"

                }

              ]

            }

          ],

          "stageId": 1,

          "stageName": "Prospecting",

          "value": 200000.0,

          "lastActivityTime": "2020-09-04T10:20:31.3778028+00:00",

          "visitsCount": 0,

          "dateOfAssignment": "2020-09-04T10:20:31.3778028+00:00",

          "callCount": 0

        }

      },

      "type": "appointment.created",

      "date": "2020-09-04T10:26:07.1127979+00:00"

    }

  ]

}

The appointment object:

Attribute

Type

Description

id

int

An identifier

title

string

Title

notes

string

Notes

durationInMinutes

int

Duration in minutes

date

datetime offset

Date of appointment

completed

boolean

Is appointment completed

lead

The lead object

 




Was this article helpful?

Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.