API Reference: Webhook Management

Preamble

The Solve External API is implemented over HTTP and is RESTful. Every item has its own URI and is manipulated in isolation.

You will normally send your Request data in XML format, but we understand JSON and form encoded data just as well. If you want to use a non-XML request format simply set the HTTP Content-type header to either application/json or application/x-www-form-urlencoded. conversely, we will normally send response data in XML form unless you set the HTTP Accepts header to application/json.

Remember, access to features and data is limited to the actual user account being used to access the API.

Create

POST https://secure.solve360.com/hooks/

Creates a webhook

Request

curl -u '{userEmail}:{userApiToken}' -X POST -H 'Content-Type: application/xml' -d '<request><type>web</type><title>A New Webhook</title><active>0</active><event>items.categorize</event><constrainttype>contact</constrainttype><url>http://yourdomain.com/app/endpoint.php</url><contenttype>xml</contenttype><secret>somethinghere</secret></request>' https://secure.solve360.com/hooks/

Response

<response>
  <active>0</active>
  <type>web</type>
  <event>items.categorize</event>
  <title>A New Webhook</title>
  <url>http://yourdomain.com/app/endpoint.php</url>
  <contenttype>xml</contenttype>
  <secret>somethinghere</secret>
  <constrainttype>contact</constrainttype>
  <id>72587181</id>
  <status>success</status>
</response>

Parameters

type
One class supported
  • (text, [web])
title
Text that helps understand the purpose of the webhook
  • (text)
active
Enables or disables the webhook
  • (integer, [0, 1])
event
The type of the event that will trigger the webhook
  • (text, [items.categorize, items.uncategorize, items.update, items.create, items.delete, items.restore, activities.update, activities.create, activities.delete, activities.restore])
constrainttype
An constraint for the hook that narrows the event type of items/activities you’re interested in
  • default value = all (text [all], if event = items.* [contact, projectblog, company] if event = activities.* [call, comment, file, googledoc, linkedemails, note, photo, photolist, task, tasklist, website, event, separator, opportunity, timerecord, scheduledemail, attachmentfile, freshbookswidget, zendeskwidget, xerowidget, constantcontactwidget, mailchimpwidget, followup])
url
A publicly available resource/script/application that will handle the callback from the webhook
  • (text, {any valid url})
contenttype
The format for the data we’ll send to you in.
  • (text, [xml, json, form])
secret
This is an optional security measure. The value you set will be used as KEY to create a sha256 hash for the full request body. It will be then sent as the “X-Solve360-Hmac-Sha256” header.
  • (text)

Required field

Update

PUT https://secure.solve360.com/hooks/{hookId}

Updates a existing webook

Request (e.g. enable a webhook)

curl -u '{userEmail}:{userApiToken}' -X PUT -H 'Content-Type: application/xml' -d '<request><active>1</active></request>' https://secure.solve360.com/hooks/65355739/

Response

<response>
  <status>success</status>
</response>

List

GET https://secure.solve360.com/hooks/

Returns a list of all registered webbooks

Response

<response>
  <hooks>
    <hook>
      <id>65355441</id>
      <type>web</type>
      <title>1. Add Lead category tag</title>
      <event>items.update</event>
      <active>0</active>
      <url>http://yourdomain.com/app/endpoint.php</url>
      <contenttype>xml</contenttype>
      <secret>yoursecret</secret>
      <constrainttype>contact</constrainttype>
    </hook>
    <hook>
      <id>65355687</id>
      <active>0</active>
      <url>http://yourdomain.com/app/endpoint.php</url>
      <contenttype>xml</contenttype>
      <secret>yoursecret</secret>
      <title>2. Add Client category tag</title>
      <event>items.categorize</event>
      <type>web</type>
      <constrainttype>contact</constrainttype>
    </hook>
    <hook>
      <id>65355739</id>
      <title>3. Complete "Receive contract" task</title>
      <type>web</type>
      <active>0</active>
      <url>http://yourdomain.com/app/endpoint.php</url>
      <contenttype>xml</contenttype>
      <secret>yoursecret</secret>
      <event>activities.update</event>
      <constrainttype>task</constrainttype>
    </hook>
  </hooks>
  <status>success</status>
</response>

Destroy

DELETE https://secure.solve360.com/hooks/{hookId}/

Deletes an existing webhook.

Request

curl -u '{userEmail}:{userApiToken}' -X DELETE https://secure.solve360.com/hooks/65355739/

Response

<response>
  <status>success</status>
</response>