Sending Universe data to your app using Webhooks
** Advanced Feature: This feature is recommended for advanced users only and requires coding.
What is a webhook?
A webhook is a way for an app to provide other apps with real-time information. A webhook delivers data to other applications as it happens, meaning you get data immediately. This is different from a typical API, where you need to poll for data very frequently in order to get it real-time. This makes webhooks much more efficient, and in most cases, a better option.
When should I use a webhook?
If you want to send data every time a new ticket is purchased on Universe to your server, or another application that isn’t supported through our Zapier integration, then you should use a webhook.
When shouldn't I use a webhook and should use the API instead?
If you only want data to be sent when you initiate the request, and you want to limit to only receiving a smaller subset of the data.
What do I need to use a webhook?
In order to use a webhook, you will need to have something that will be able to consume the webhook. So you will need to be able to write some code, or get help from someone who does.
What do I need to know about a Universe webhook?
Whenever a ticket is purchased, we will send a
POST request to the provided Payload URL with the following headers:
X-Uniiverse-Event – Event type
X-Uniiverse-Signature – HMAC hex digest of the payload, using the hook’s secret as the key (if configured).
The body of the request will be a
JSON-encoded representation of the data.
Step 1: Setup the Webhook
Navigate to Settings in your Universe Dashboard
Step 2: Scroll down to the Webhooks Section
Step 3: Select Add Webhook
Step 4: Configure the Webhook
To configure the Webhook, you will need to populate the following fields:
URL: this will be the URL of your webservice, or whatever you have set up to consume the POST request.
If you just want to test it out, you can use a RequestBin URL (from http://requestb.in/) as a place to temporarily send the Universe data and examine the data format
Secret: a secret is like a password used between Universe and your app, to keep other apps from accessing your data.
Active: You must check this box if you want to activate the webhook. You can enable and disable your webhook at any time.
Step 5: Write code to consume the data
Every time a new ticket is purchased, Universe will send all the data you will need associated with the event and the purchase to populate in your app.
You can see a sample request containing all the data we send here.
You can find an explanation of each object at http://developers.universe.com
Currently there is only one event that triggers a webhook:
ticket_purchase – Any time you purchase a ticket, or a ticket is purchased for one of your listings.