To enable integration with other products and services, Geenio supports webhooks.

To create a webhook, log in to Geenio, open your site, click Settings, go to the API tab, and click Create Webhook. Define the name of the webhook and configure the URL for the webhook.

To test your webhook, select any event from the Test URL with event list and click Test URL. If the test is passed successfully (HTTP code 200), the "Web-hook test passed" message will be displayed. Otherwise, you will see "Web-hook test failed". In this case, make sure that the provided URL is correct.

Once you are done, click Create.

At the present moment, webhooks in Geenio support the following events:

  • Course started
  • Course progress
  • Course finished
  • User created

Whenever any of these events occur on your Geenio instance, for every created webhook, a packet containing the corresponding data is sent to the webhook's URL.

Example of Web Hook Calls

In this section you will find examples of JSON data pushed by Geenio to the web hook URL in case an event happens.

You can test the web hook work for your instance using this tiny web service, that acts as the sample web hook stub.

Course started

{
  "occurredAt": 1452710459,
  "type": "course.started",
  "body": {
    "user": {
      "id": 3,
      "name": "user name",
      "occupation": "",
      "location": "",
      "timezone": null,
      "email": "un@tl.dr",
      "isBanned": false,
      "role": {
        "alias": "learner"
      },
      "image": null
    },
    "course": {
      "id": 2,
      "name": "Introducing Geenio",
      "annotation": "This course will help you to start using Geenio as course author and site administrator.",
      "isDraft": false,
      "createdAt": 1449688532,
      "updatedAt": 1449688532,
      "publishedAt": 1452710017,
      "image": {
        "id": 54,
        "mini": "http://static.example.geen.io/112/36x36/d2/fd/d2fdcs6wekatpm8gj7yrqk3ruofxesjs.jpg",
        "small": "http://static.example.geen.io/112/250x140/d2/fd/d2fdcs6wekatpm8gj7yrqk3ruofxesjs.jpg"
      }
    }
  }
}

 

Course progress

{
  "occurredAt": 1452710463,
  "type": "course.progress",
  "body": {
    "user": {
      "id": 3,
      "name": "user name",
      "occupation": "",
      "location": "",
      "timezone": null,
      "email": "un@tl.dr",
      "isBanned": false,
      "role": {
        "alias": "learner"
      },
      "image": null
    },
    "course": {
      "id": 2,
      "name": "Introducing Geenio",
      "annotation": "This course will help you to start using Geenio as course author and site administrator.",
      "isDraft": false,
      "createdAt": 1449688532,
      "updatedAt": 1449688532,
      "publishedAt": 1452710017,
      "image": {
        "id": 54,
        "mini": "http://static.example.geen.io/112/36x36/d2/fd/d2fdcs6wekatpm8gj7yrqk3ruofxesjs.jpg",
        "small": "http://static.example.geen.io/112/250x140/d2/fd/d2fdcs6wekatpm8gj7yrqk3ruofxesjs.jpg"
      }
    },
    "assignedAt": 1452710291,
    "startedAt": 1452710459,
    "finishedAt": 0,
    "deadlineAt": 0,
    "progressValue": 2,
    "courseElement": {
      "id": 38,
      "name": "Would like to see video?",
      "type": "question"
    }
  }
} 

 

Course finished

{
  "occurredAt": 1452711041,
  "type": "course.finished",
  "body": {
    "user": {
      "id": 3,
      "name": "user name",
      "occupation": "",
      "location": "",
      "timezone": null,
      "email": "un@tl.dr",
      "isBanned": false,
      "role": {
        "alias": "learner"
      },
      "image": null
    },
    "course": {
      "id": 16,
      "name": "video",
      "annotation": "",
      "isDraft": false,
      "createdAt": 1452710880,
      "updatedAt": 1452710884,
      "publishedAt": 1452710910,
      "image": null
    },
    "assignedAt": 1452710921,
    "startedAt": 1452710937,
    "finishedAt": 1452711041,
    "deadlineAt": 0,
    "resultValue": 100
  }
}

 

User created

{
  "occurredAt": 1454520457,
  "type": "user.created",
  "body": {
    "user": {
      "id": 5,
      "name": "New User",
      "occupation": "",
      "location": "",
      "timezone": null,
      "email": "newuserg@mailinator.net",
      "isBanned": false,
      "role": {
        "alias": "learner"
      },
      "image": null
    }
  }
}

We recommend to read next articles