Skip to main content

Steps to receive Webhooks

You can start receiving event notifications in your app using the steps in this section:

  1. Identify the notification events you want to listen to and the event payloads to parse.

    • Forum
      • New Forum Post
      • Forum Post Comment
      • Forum Post Like
      • Forum Post Reply
      • Forum Post Report
    • New Resource Post
    • New Calendar Event
    • New User Onboarded
  2. Create a HTTP POST endpoint on your server that will receive webhook events.

    Eg: POST https://{your-server}/webhook

  3. Make sure the endpoint returns 200 response HTTP code as soon as the webhook event is succesfully received.

  4. Deploy your webhook endpoint so it’s a publicly accessible HTTPS URL.

  5. Register your publicly accessible HTTPS URL in the Community Settings.

    s1.png

  6. (Optional) Use secret_key to verify incoming HTTP Post request is from Graphy Community Platform. secret_key is generated at the time of registering the webhook URL.

Note:

  • actor_id_ext and affected_ids_ext will be external user IDs shared if the community has enabled SSO
  • Max length of affected IDs is 1000.

Webhook Payloads

New Forum Post
{
"secret_key": "<webhook-secret>",
"payload": {
"event_type": "forum_post_new",
"event_id": 123,
"actor_id": 1,
"actor_id_ext": "a1",
"affected_id": [2, 3, 4],
"affected_ids_ext": ["a2", "a3", "a4"],
"meta_data": {
"channel_id": 1,
"truncated_text": "<Forum post content>",
"url": "<Web URL to the forum post page>"
}
}
}
Forum Post Comment
{
"secret_key": "<webhook-secret>",
"payload": {
"event_id": 123,
"event_type": "forum_post_comment",
"actor_id": 1,
"actor_id_ext": "a1",
"affected_id": [2, 3],
"affected_ids_ext": ["a2", "a3"],
"meta_data": {
"channel_id": 1,
"truncated_text": "<Forum post comment>",
"forum_post_id": 1,
"url": "<Web URL to the forum post page>"
}
}
}
Forum Post Like
{
"secret_key": "<webhook-secret>",
"payload": {
"event_id": 123,
"event_type": "forum_post_like",
"actor_id": 1,
"actor_id_ext": "a1",
"affected_id": [2, 3],
"affected_ids_ext": ["a2, a3"],
"meta_data": {
"channel_id": 1,
"truncated_text": "<Forum post content>",
"forum_post_id": 1,
"url": "<Web URL to the forum post page>"
}
}
}
Forum Post Reply
{
"secret_key": "<webhook-secret>",
"payload": {
"event_id": 123,
"event_type": "forum_post_reply",
"actor_id": 1,
"actor_id_ext": "a1",
"affected_id": [2],
"affected_ids_ext": ["a2"],
"meta_data": {
"channel_id": 1,
"truncated_text": "<Forum Reply Content>",
"forum_post_id": 1,
"forum_comment_id": 1,
"url": "<Web URL to the forum post page>"
}
}
}
Forum Post Report
{
"secret_key": "<webhook-secret>",
"payload": {
"event_id": 123,
"event_type": "forum_post_report",
"actor_id": 1,
"actor_id_ext": "a1",
"affected_id": [2],
"affected_ids_ext": ["a2"],
"meta_data": {
"channel_id": 1,
"truncated_text": "<Forum Post Content>",
"forum_post_id": 1,
"url": "<Web URL to the forum post page>"
}
}
}
New Resource Post
{
"secret_key": "<webhook-secret>",
"payload": {
"event_type": "resource_post_new",
"event_id": 123,
"actor_id": 1,
"actor_id_ext": "a1",
"affected_id": [2, 3, 4],
"affected_ids_ext": ["a2", "a3", "a4"],
"meta_data": {
"channel_id": 1,
"truncated_text": "<Resource post content>",
"url": "<Web URL to the resource post page>"
}
}
}
New Calendar Event
{
"secret_key": "<webhook-secret>",
"payload": {
"event_type": "calendar_event_new",
"event_id": 123,
"actor_id": 1,
"actor_id_ext": "a1",
"affected_id": [2, 3, 4],
"affected_ids_ext": ["a2", "a3", "a4"],
"meta_data": {
"channel_id": 1,
"name": "<Calendar Event name>",
"truncated_text": "<Calendar Event description>",
"url": "<Web URL to the calendar event page>",
"start_time": "<start-time>",
"end_time": "<end-time>",
}
}
}
New Onboarded User
{
"secret_key": "<webhook-secret>",
"payload": {
"event_type": "community_user_onboarded",
"event_id": 123,
"actor_id": 1,
"actor_id_ext": "a1",
"affected_id": [2, 3, 4],
"affected_ids_ext": ["a2", "a3", "a4"],
"meta_data": {
"email": "<Email of user>",
"phone_number": "<Ph. No of User>",
"phone_country_code": "<Phone country code of User>",
"name": "<Name of user>",
"username": "<Username of user>",
"created_at": "<onboarding-time>",
"onboarding_responses": [..]
}
}
}