Privileged API Keys Only
Special permission is required to access this service. Please contact api-support@sparkplatform.com or your API key provider to request access to this data.
Developers: News Feed Webhooks
When creating news feeds, developers can register webhooks to receive POST requests for event notifications in place of the typical e-mail or device push notification.
Supported Roles
Role | Reads | Writes | Notes |
---|---|---|---|
IDX | Yes | Yes | |
Public | Yes | No | |
VOW | Yes | Yes | |
Portal | Yes | Yes | |
Private | Yes | Yes |
More information about roles may be found here.
Available Services
All News Feed Webhooks
/<API Version>/developers/newsfeeds/webhooks
HTTP Method | Description | Conditional | Notes |
---|---|---|---|
GET | Retrieves all webhooks registered for the active API key. | No | |
POST | Creates a new webhook for the active API key. | No | |
PUT | Returns HTTP 405 (Method Not Allowed) | No | Not implemented |
DELETE | Returns HTTP 405 (Method Not Allowed) | No | Not implemented |
GET Request
Parameters:
- None
GET Response
{
"D": {
"Success": true,
"Results": [
{
"Id": "20180417093347849253000007",
"ResourceUri": "/v1/developers/webhooks/20180417093347849253000007",
"Uri": "https://www.flexmls.com/listings/event",
"Active": true,
"ModificationTimestamp": "2018-04-17T14:33:47Z"
}
]
}
}
POST Request
Request body:
{
"D": {
"Uri": "https://www.flexmls.com/listings/event",
"Active": true
}
}
POST Response
The standard success/fail response is returned.
Individual News Feed Webhook
/<API Version>/developers/newsfeeds/webhooks/<Webhook.Id>
HTTP Method | Description | Conditional | Notes |
---|---|---|---|
GET | Returns a single webhook record. | No | |
POST | Returns HTTP 405 (Method Not Allowed) | No | Not implemented |
PUT | Updates a webhook record. | No | |
DELETE | Deletes a webhook. | No |
GET Request
Parameters:
- None
GET Response
See the GET request section for for the webhooks service.
PUT Request
Request body:
{
"D": {
"Active": false
}
}
PUT Response
The standard success/fail response is returned.
DELETE Request
Parameters:
- None
DELETE Response
The standard success/fail response is returned.
Requests to Webhooks
Below is an example of the JSON payload that will be POSTed to to the
Uri
specified in your webhook. There is a 1 second connection
timeout and a 5 second connection timeout. If this time limit
is exceeded, or the response to this post is anything but a status code in
the 200-299
range, the request will be retried.
{
"Listing": {
"Id": "20100000000000000000000000"
},
"Subscriber": {
"Id": "20140815000000000001000000",
"Type": "Member",
"OwnerId": "20140815000000000001000000"
},
"NewsFeed": {
"Id": "20180411141756698053000006"
"Event": "New",
"EventTimestamp": "2018-04-18T11:12:56Z",
"Type": "SavedSearch",
"Subscription": {
"Id": "20180113050000000001000000"
}
}
}
Attribute | Description |
---|---|
Listing.Id |
The listing the news feed event is for. |
Subscriber.Id |
The ID of the subscriber account for the news feed. |
Subscriber.Type |
The type of subscriber. If Contact , the Subscriber.Id will
reference a contact record. Otherwise, Subscriber.Id
will reference an account. |
Subscriber.OwnerId |
If Subscriber.Type is Contact , this will be the
Account.Id for the user that owns the contact record. |
NewsFeed.Id |
The news feed the event is for. |
NewsFeed.Event |
The type of event. |
NewsFeed.EventTimestamp |
The timestamp the event occurred. |
NewsFeed.Type |
The type of news feed, such as SavedSearch . |
Newsfeed.Subscription.Id |
The Id of the resource the news feed is subscribed to, such as the
SavedSearch.Id . |
Developers: News Feed Webhooks Description
Attribute | Data Type | Writeable | Required | Description |
---|---|---|---|---|
Id |
Integer | No | No | The unique id for the webhook. |
ResourceUri |
Character | No | No | The URI to the individual webhook record. |
Uri |
Character | Yes | Yes | The URI listing notifications will be POSTed to. This must be unique per developer. |
Active |
Boolean | Yes | No | (Default: false ). If true , listings can be posted to this webhook. |
ModificationTimestamp |
Timestamp | No | No | The time the webhook was last updated. |
Expansions
None.