By continuing to use this site, you agree to the storing of first- and third-party cookies on your device to enhance site navigation; analyze site, product, and service usage; and assist in our marketing and promotional efforts. Cookie Policy

 
Skip to Content

Web Hooks

Format of Web Hooks MessageLink to this section

When enabled in Account Settings and configured on a file or folder, Web Hooks sends two JSON messages during a publish action.

  1. The first message is a notification that a publish was initiated.
  2. The second message returns the final status of that publish action.

The two messages are associated by a uuid set in the JSON object associated with that publish action.

The names defined below will appear in all types of web hook messages generated by OU Campus.

JSON nameData TypeDescription
accountstringOU Campus account where publish action was initiated
sitestringOU Campus site where publish action was initiated
userstringOU Campus user who initiated the publish action
typestring

Type of publish action intitated

Possible values:

  • page publish
  • multi page publish
  • asset publish
  • multi asset publish
  • directory publish
  • multi directory publish
  • site publish
  • template publish
  • rename republish
  • move republish
  • out-of-syn page republish
  • scheduled page publish
  • scheduled asset publish
  • scheduled page recycle
  • file deletion
  • file recycle
successobject containing arrays of Site objects

Each successfully published item will be listed here. The success object is split up by OU Campus site. Each Site object will contain an array of Page objects with the root relative staging path and live URL for each published item.

failedobject containing arrays of Site objects

Each failed published item will be listed here. The failed object is split up by OU Campus site. Each Site object will contain an array of Page objects with the root relative staging path and reason for failure.

errorsobject containing arrays of Site objectsEach error encountered during the publish action will be listed here. The error object is split up by OU Campus site. Each Site object will contain an array of strings detailing the reason(s) for the error.
success_countnumberCount of the number of published items.
failed_countnumberCount of the number of failed items.
uuidstringUnique identifier for this publish action. The uuid will match on the notification web hook message and the final status web hook message.
beganstringTime the publish action began according to the staging server.
completedstringTime the publish action completed according to the staging server.
originarray of strings

 File(s) specifically chosen by the user which initiated the publish action. 

For example, if an asset was published, that asset's name would appear here and all of the pages which republished as a result would appear in the success object under its corresponding site.

total_time numberTime duration for publish action to complete. Measured in seconds.
msg stringDescription of whether the publish action is beginning, ending, or has failed.

Example web hook messageLink to this section

{
	"account": "account name",
	"site": "site name",
	"user": "username",
	"type": "type of publish",
	"success": {
		"site name": [{
			"path": "/folder/index.pcf",
			"url": "https://www.domain.edu/index.html"
		}]
	},
	"failed": {
		"site name": [{
			"/folder/file.pcf": "Reasons for file that failed to publish"
		}]
	},
	"errors": {
		"site name": ["Errors relating to database connectivity and RSS feeds "]
	},
	"success_count": 1,
	"failed_count": 1,
	"uuid": "A unique identifier for the action",
	"began": "2019-06-13T17:49:37Z",
	"completed": "2019-06-13T17:49:37Z",
	"origin": ["/folder/index.pcf",	"/folder/file.pcf"],
	"total_time": 1,
	"msg":"[type of publish] has begun|completed|failed"
}

 Listening URL ScriptLink to this section

The script you place at the Web Hooks URL can be configured to take any actions you see fit based upon the data provided by the Web Hook message. The exact language and server side code required at the Web Hooks URL is dependent upon the language your server is running as well as the resulting actions you'd like to occur.

For example, you could configure your script to create a friendly display as a reporting view for individuals who are not OU Campus users (zip file with example PHP script). Or you could hit an API endpoint as a reaction to the publication of specific sections or pages (e.g. causing your faculty listing page to republish whenever a profile page in that section is published).