Webhooks

List Webhooks

Parameters

Param Default Description
_order name Options are: name, description, lastExecutionDate, isEnabled, created, modified
_page 0 Current page
_count 20 Options: 20, 25, 50 and 100
event - See Supported Event Types below
name - Search by name

Supported Event Types

The following event types can be used to list, create and update webhooks.

Param Description
postSent Triggers when a post is sent to social media
newAssignment Triggers when a new social conversation is assigned to an Oktopost user
newAssignmentNote Triggers when a new note is added to an existing assignment
assignmentStatusChange Triggers when an assignment status changes
newBoardMessage Triggers when a new message is added to the board
newConversion Triggers when a new conversion is captured

Example Request

curl -i https://api.oktopost.com/v2/webhook

Example Result

{
	"Result": true,
	"Items": [
		{
			"Id": "0WA000000000001",
			"Name": "My Webhook",
			"Description": "Send new assignment to Slack",
			"Event": "newAssignment",
			"Url": "https://slack.com/",
			"LastExecutionDate": "-",
			"IsEnabled": 1,
			"Created": "2017-05-23 14:07:18",
			"Modified": "2017-05-23 14:07:18"
		}
	],
	"Total": 1
}

Get Webhook

Example Request

curl -i https://api.oktopost.com/v2/webhook/0WA000000000001

Example Result

{
	"Result": true,
	"Webhook": {
		"Id": "0WA000000000001",
		"Name": "My Webhook",
		"Description": "Send new assignment to Slack",
		"Event": "newAssignment",
		"Url": "https://slack.com/",
		"LastExecutionDate": "-",
		"IsEnabled": 1,
		"Created": "2017-05-23 14:07:18",
		"Modified": "2017-05-23 14:07:18"
	}
}

Add Webhook

Example Request

curl -i https://api.oktopost.com/v2/webhook -X POST \
-d event="newAssignment" \
-d name="My Test" \
-d description="Send assignment to custom URL" \
-d url="http://example.com" \
-d isEnabled=1

Example Result

{
	"Result": true,
	"Webhook": {
		"Id": "0WA000000000001",
		"Name": "My Test",
		"Description": "Send assignment to custom URL",
		"Event": "newAssignment",
		"Url": "https://example.com/",
		"LastExecutionDate": "-",
		"IsEnabled": 1,
		"Secret": "...",
		"Created": "2017-05-23 14:07:18",
		"Modified": "2017-05-23 14:07:18"
	}
}

Update Webhook

Example Request

curl -i https://api.oktopost.com/v2/webhook/0WA000000000001 -X POST \
-d event="newAssignment" \
-d name="My Test" \
-d description="Send new assignment to custom URL" \
-d url="http://example.com" \
-d isEnabled=1

Example Result

{
	"Result": true,
	"Webhook": {
		"Id": "0WA000000000001",
		"Name": "My Test",
		"Description": "Send new assignment to custom URL",
		"Event": "newAssignment",
		"Url": "https://example.com/",
		"LastExecutionDate": "-",
		"IsEnabled": 1,
		"Created": "2017-05-23 14:07:18",
		"Modified": "2017-05-23 14:07:18"
	}
}

Delete Webhook

Example Request

curl -i https://api.oktopost.com/v2/webhook/0WA000000000001 -X DELETE

Feedback and Knowledge Base