Skip to content

Hooks

Create hook

The web hooks will allow third party application to get notified from several events (lead creation, lead update, lead deletion, property creation, etc) that could occur in the PF Expert platform. The web hooks will allow client to get notified in real time instead of always keep pulling data from the platform.

  • Endpoint:
POST /hooks
  • Allowed for:

In order to register a web hook, you need a client level token.

For security purposes, and given the level of access that are given to the client level tokens, this type of token can be obtained by sending a request to our customer care representatives.

Clients can subscribe only one endpoint per event.

  • Parameters:
Name Type Comment
target string Endpoint URI
event string Name of the event

Available events:

Event Name
lead.new
lead.assigned
lead.status
lead.updated
lead.deleted
landlord.new
landlord.assigned
landlord.updated
landlord.deleted
property.new
property.deleted
property.assigned
property.status
property.state
user.new
user.updated
user.deleted
transaction.new
transaction.won
transaction.lost
transaction.updated
transaction.deleted
  • JSON request example:
{
  "hook": {
    "event": "lead.new",
    "target": "http://custom-platform.com/create-lead.php"
  }
}
  • JSON response:

This endpoint will return a Hook object.

{
  "hook": {
      "id": 223443,
      "event:": "lead.new",
      "target": "http://custom-platform.com/create-lead.php",
      "client": {
        "id": 434
      }
  }
}

Delete hook

  • Endpoint:
DELETE /hooks/{id}

Listen to hook events from client system

Once a client registered to a hook, the data get automatically sent to the url provided by the client with the registered events from the client.

POST {urlFromClient}

In the body of the response you will find a serialized version of a Version (internal resource) of the object.

  • JSON request data:
Name Type Read-only Comment
event string yes event triggered by the system
client integer yes client id
concept object yes Concept object

Concept object:

Name Type Read-only Comment
id integer yes Resource id
namespace string yes type of resource
sub_namespace string yes type of resource (not always mentioned)
  • JSON request example:
{
  "property": {
      {"event":"property.updated","client":9999,"concept":{"id":888999,"namespace":"property","sub_namespace":null}}
  },
}