In this article, I'm going to show how to use Arena Webhooks in your events, passing by the whole flow.
When to use Arena Webhooks?
You can use Arena Webhooks when you need to get the JSON of each new, updated, or deleted post in your event. It might be useful to get the post separately in some way or if you are using the SSR approach to know when changes happen and update the event page.
How to start using it?
To start using webhooks you have to set them into the dashboard. It is important to bring up that the webhook can be set either in general settings or in event settings. Thus, the first step is to define if you are going to use the same webhook for all of your events or if you are going to treat them separately for each post.
Set the webhook URL in general settings:
The webhook set in this way will be used for all your events, except the ones that have their specific webhook in event settings.
To set this, go to Profile -> Settings -> EventDefaults, then fill the field "webhook URL" with your input and click in "Save". This flow can be seen in the image below.
Set the webhook URL in event settings:
The webhook set in this way will be used specifically for the event defined.
In your dashboard go to Liveblog, click in the option "create new event" or "edit event", then fill the field "webhook URL" with your input and click in "Create" or "Save". This flow can be seen in the image below.
Now you can start posting and receive the JSON of each new, updated, or deleted post through the webhook defined by you.
How is the post data sent?
After making the setting in the dashboard, when you make a new post, or update/delete one in your event, the Arena system will send a POST request for the webhook defined by you passing the JSON you need to identify that post.
The data are sent in the following format:
{
"event": {...},
"status",
"publisher": {...},
"post": {...}
}
You can see the description of each attribute in the table below:
Attribute | Description |
event | Event data, you can see it detailed in the response example below. |
status | The reason why webhook was called. It can be "added", "removed" or "modified". |
publisher | Publisher data, you can see detailed in the response example below. |
post | Post data, you can see it detailed in the response example below. |
Response Example
{
"event": {
"_id": "5d9f320ee3ebbb0008dcdf11",
"onPostAddedWebhooks": [],
"adsIsEnabled": false,
"autoPlayByPlay": false,
"chatPosition": "bottom",
"chatRoom": true,
"chatType": "event",
"commentIsEnabled": true,
"description": "",
"infoTab": true,
"liveblogLayout": "timeline",
"location": "",
"name": "teste",
"pagination": 20,
"pbpSort": "newest",
"profanityFilterType": "block",
"reactionType": "thumbs-up-down",
"scoreBar": true,
"share": true,
"siteId": "OSRA5O0YmdfjWIt9l7QSWspONoz2",
"soundAlert": true,
"sportId": "others",
"startDate": 1570713995664,
"status": "live",
"statusBar": true,
"timeFormat": "mm/dd/yyyy",
"timeTitleColor": "#2ccce4",
"voting": true,
"createdBy": "OSRA5O0YmdfjWIt9l7QSWspONoz2",
"slug": "kq18",
"presenceId": "-LqpqsNiVGTadhMuFJWz",
"isFirestore": true,
"lang": "pt-br",
"chatId": "5d9f320ee3ebbb0008dcdf12",
"createdAt": 1570714127639,
"__v": 0,
"modifiedAt": 1581962676377,
"updatedBy": "OSRA5O0YmdfjWIt9l7QSWspONoz2",
"streams": [],
"language": "pt-br",
"id": "5d9f320ee3ebbb0008dcdf11",
"sport": {
"category": "general",
"icon": "https://firebasestorage.googleapis.com/v0/b/arena-prd.appspot.com/o/images%2Fd3cd48b4edb3b1c0ed3d7298cb6b3ba2.jpg?alt=media&token=15f189e5-048f-4aa1-bf8f-10b29c99d833",
"id": "others",
"name": "Others",
"scoreType": "none",
"key": "others",
"periods": {
"total": "0"
},
"positions": {},
"actions": {
"important": {
"count": 277,
"i18n": {
"en-us": "Important",
"pt-br": "Importante"
},
"icon": "https://stationfy.imgix.net/pbpicons/important.png",
"key": "important",
"label": "Important",
"value": "Important"
},
"normal": {
"count": 3353,
"i18n": {
"en-us": "Normal",
"pt-br": "Normal"
},
"icon": "https://stationfy.imgix.net/pbpicons/normal.png",
"key": "normal",
"label": "Normal",
"value": "Normal"
}
}
},
"firebase": false
},
"status": "added",
"publisher": {
"_id": "OSRA5O0YmdfjWIt9l7QSWspONoz2",
"__v": 0,
"config": {
"language": "pt-br",
"profanityFilterType": "block",
"selectedTheme": null,
"migratedGraphQL": true,
"enforceDomainSecurity": true,
"migratedChatRoom": true,
"adsIsEnabled": null,
"chatId": "event",
"chatPosition": "bottom",
"chatRoom": true,
"commentIsEnabled": true,
"editorSwitch": false,
"infoTab": true,
"monetizationFrequency": null,
"monetizationPositionBottom": null,
"monetizationPositionBottomUnit": null,
"monetizationPositionInContent": null,
"monetizationPositionInContentUnit": null,
"monetizationPositionTop": null,
"monetizationPositionTopUnit": null,
"pagination": 20,
"reactionType": "thumbs-up-down",
"scoreBar": true,
"share": true,
"soundAlert": true,
"statusBar": true,
"timeTitleColor": "#2ccce4",
"voting": true,
"periodTimeFormat": "split",
"dateFormat": "mm/dd/yyyy",
"hourFormat": "12h",
"summaryWord": "REsumo",
"enrichProfile": true,
"showEventTitle": false,
"webhookUrl": "https://event-webhook-arena-test.herokuapp.com/webhook"
},
"deleted": false,
"blocked": false,
"slug": "qa-publisher",
"image": "https://firebasestorage.googleapis.com/v0/b/arenadev-f9045.appspot.com/o/images%2Fdbf742bf5ec3f95b07ec2fab3f07911e.jpg?alt=media&token=5bb5a272-124b-45bf-a034-2f6682bf7178",
"name": "QA Publisher",
"organization": "OSRA5O0YmdfjWIt9l7QSWspONoz2",
"account": "5c4af8d161fb4909d41bc86f",
"websiteUrl": "qapublisher.arena.im",
"whiteListDomains": [
"int-www.sportsnet.ca",
"sso-test-environment.vercel.app"
],
"customTheme": {
"bgColor": "#ff8a65",
"buttonsColor": "#454C5F",
"chatColor": "#5021A6",
"hoverColor": "#3C3B6E",
"iconColor": "#454C5F",
"linkColor": "#A57CEF",
"textColor": "#454C5F",
"timelineColor": "#D8DCE9",
"titleColor": "#454C5F",
"cardBgColor": "transparent"
},
"createdAt": 1524353234000,
"billing": {
"autoUpgrade": false,
"productId": "BUSINESS",
"canChangePlan": true,
"limits": {
"pageViews": {
"total": 100000,
"used": 51947,
"overageFee": 0.005
},
"videoUpload": {
"total": 10737418240
}
},
"planId": "business-monthly-$",
"externalSubscriptionId": "169mBSSdHaZeY3PHp"
},
"pushConfig": {
"acceptButton": "ALLOW",
"denyButton": "NO THANKS",
"enabled": true,
"promptMessage": "We’d like to show you notifications for the latest news and updates."
},
"blockedReason": [],
"customerPaymentSettings": {
"paypal": {
"clientId": "AdoepCToN-4yy1qAzPD0PJcUS0bsZEvW9Ke6wZmqmhqZo4qyXP_rSHWt2Cd2gr-9eI5UtAYwn2OGgMwE",
"currency": "USD",
"enabled": true,
"name": "testdonation",
"type": "DONATION"
}
},
"monetizationData": {
"adSenseConnected": null,
"adunits": null,
"authorizationCode": null,
"clientId": "1067019288890-gfbhq0nhg6nrgorbubpdfjet646kmmg6.apps.googleusercontent.com",
"clientSecret": "vCE4CzlZhoM6iLXBIlAKylEg",
"connected": null
},
"writeKey": "T1NSQTVPMFltZGZqV0l0OWw3UVNXc3BPTm96MjpqczpkZWZhdWx0"
},
"post": {
"action": {},
"arenaPost": true,
"assetIds": [],
"backgroundColor": "transparent",
"device": "desktop",
"editorName": false,
"event": "5d9f320ee3ebbb0008dcdf11",
"message": {
"text": "<p>test</p>",
"title": "webhook test",
"media": {
"images": {}
}
},
"pendingAssets": false,
"postToSocialAccounts": {
"facebookIds": []
},
"priority": 1,
"sender": {
"displayName": "QA Publisher",
"photoURL": "https://firebasestorage.googleapis.com/v0/b/arena-dev-f9045.appspot.com/o/images%2F46660cba61e559e2d1e49870e5c80ac8.jpg?alt=media&token=92431ce6-0e17-41f5-ad56-d343f73f52d6",
"uid": "OSRA5O0YmdfjWIt9l7QSWspONoz2"
},
"owner": "OSRA5O0YmdfjWIt9l7QSWspONoz2",
"publisherId": "OSRA5O0YmdfjWIt9l7QSWspONoz2",
"key": "EjGHhOHV3doINfDcYaF2",
"createdAt": 1634303878573
}
}
Reach out to our support team if you have questions.
Happy to assist you!