Viafoura

The Viafoura Documentation Hub

Welcome to Viafoura’s documentation hub, our comprehensive library of guides and documentation to help you start working with our world leading engagement tools.

Get Started    API Reference

Webhook Service

Viafoura allows for third party services to receive engagement events in near real time.

📘

Note

You will need to:

  • Configure an endpoint and provide the API path
  • Come up with an Authentication header we can pass to your API to let you know its coming from us

Please provide those to your client success representative to set this up for you.

Security

Note that:
The service will be available over SSL (https) using a valid certificate
Viafoura application will use the certificate for both Authentication and Authorization

Conversation Pattern

The conversation between client and server will be Fire and Forget.

RESTful Service Specification

Request
Scheme: https
URL: will be provided by you to your CS representative
*HTTP Method: POST

Request Headers

Header name

Description

x-request-id

Random request ID provided by viafoura on each HTTP request, the value is the same as “request_uuid” in the request body

authorization

At least 64 bytes, hexadecimal. Please provide this to your CS representative

content-type

application/json; charset=utf-8

accept

application/json

Request Body
The request body is a JSON encoded string which follows the schema below:

Field

Type

Description

request_uuid

number

Same as “X-Request-ID” in header

time

number

The time in milliseconds

version

number

The current value is 1

events

array

Array of Event object

Response

HTTP Status
A 200, 201 or 202 response code is expected in the HTTP response code. However third-party service can return other status codes to let our customer success team help with diagnosing possible issues in the integration.

Error Code

Description

404

Not Found

500

Any internal error

400

Data is not valid

200-201

Request accepted

403

Authorization failed

Response Body from Third Party Service
The expected response from the third party service will only be parsed if the following schema is used.

Field

Type

Description

request_uuid

string

request_id of corresponding request

results

array

Array of Result objects

Result object

Field

Type

Description

event_uuid

string

Event ID

type

string

Either “success” or “failure”

error_type

string

Arbitrary value

error_description

string

Arbitrary value

JSON Object Definitions

Event
The event objects will describe all information related to any state change in the Viafoura system. Depending on the message_tye and action additional set of fields will be included for each event.

Event triggers

Message Type

Action

Trigger

livecomment_post

created

new comment created

livecomment_post

visible

comment enabled after moderation

livecomment_post

disabled

comment disabled by moderation or if the flag threshold has been reached

livecomment_post

updated

comment modified

livecomment_post

liked

comment liked by a user

livecomment_post

disliked

comment disliked by a user

livecomment_post

unliked

comment like reverted by a user

livecomment_post

undisliked

comment dislike reverted by a user

livecomment_post

flagged

comment is flagged

livecomment_post

spammed

comment was marked as spam by moderation

chat_message

created

chat message is created

chat_message

visible

chat message is enabled after moderation

liveblog_post

created

liveblog post is created

Event fields

Field

Type

Description

event_uuid

string

Event ID

time

number

The time in millisecond

message_type

string

livecomment_post
liveblog_post
chat_message

action

created
visible
disabled
updated
liked
disliked
unliked
undisliked
flagged
spammed

content_uuid

string

id of the content item that was interacted on

actor_uuid

string

id of the user or actor who caused the interaction (this could be internal ids in the case of moderation events)

content_container_uuid

string

id of the content container that was interacted on

section_uuid

string

id of the viafoura section where the action occurred

Example

Request

{ request_uuid: 'abcc2254-b0a4-492c-a8f2-ae7820f4968a',
 time: 1593205167183,
 version: 1,
 events:
  [ { event_uuid: '99d2a532-e1a1-4455-834a-775148570e9d',
      time: 1593205166938,
      section_uuid: '00000000-0000-4000-8000-337a437adec1',
      content_container_uuid: '0dc371b9-cecd-4dc3-954b-e5255794e2e7',
      content_uuid: 'bf890170-4828-4d1d-a1b0-a0072a6117d3',
      actor_uuid: '00000000-0000-4000-8000-017ea245f200',
      message_type: 'livecomment_post',
      action: 'created' } ] }

Response

{
    "request_uuid": "c71b5cb1-ce44-4239-8b6e-87b99cf2b1f0",
    "results": [
        {
            "event_uuid":"c71b5cb1-ce44-4239-8b6e-87b99cf2b1a0",
            "type": "failure",
            "error_type": "unknown",
            "error_description": "unable to store"
        },
        {
            "event_uuid":"dd519c8a-3619-4cb0-b31b-0ffd14d24aab",
            "type": "success"
        },
        {
            "event_uuid":"d8a6a231-0cef-4385-83d8-66b6160811a5",
            "type": "success"
        },
        {
            "event_uuid":"5c0c5ab3-f3be-4194-bfc5-2000f94665ad",
            "type": "success"
        }
    ]
}

Updated about 9 hours ago



Webhook Service


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.