Skip to content

Instantly share code, notes, and snippets.

@philiplambok
Last active March 26, 2019 09:56
Show Gist options
  • Save philiplambok/d3d4ca62a5226adca9ec93aaa36a23e8 to your computer and use it in GitHub Desktop.
Save philiplambok/d3d4ca62a5226adca9ec93aaa36a23e8 to your computer and use it in GitHub Desktop.
Events API

All Events.

# /api/v1/events 
{
  "status": true,
  "length": 5,
  "data": [
    {
      "id": "1543",
      "type": "Moodle::Event",
      "attributes": {
        "name": "Rust Meetup",
        "description": "Ini deskripsi dari meetup Rust",
        "course_name": "All courses",
        "created_by": "Matz",
        "event_type": "site",
        "date_start": "27 March 2019",
        "clock_start": "14:24",
        "date_end": "27 March 2019",
        "clock_end": "15:24",
        "link": "https://dev-moodle.harukaeduapps.com/calendar/view.php?view=day&time=1553671446"
      }
    },
    {
      "id": "1542",
      "type": "Moodle::Event",
      "attributes": {
        "name": "Ruby Meetup",
        "description": "Ini deskripsi dari meetup Ruby",
        "course_name": "All courses",
        "created_by": "Matz",
        "event_type": "site",
        "date_start": "28 March 2019",
        "clock_start": "14:24",
        "date_end": "29 March 2019",
        "clock_end": "14:24",
        "link": "https://dev-moodle.harukaeduapps.com/calendar/view.php?view=day&time=1553757846"
      }
    },
    {
      "id": "1544",
      "type": "Moodle::Event",
      "attributes": {
        "name": "Elixir Meetup",
        "description": "Ini deskripsi dari meetup Elixir",
        "course_name": "All courses",
        "created_by": "Matz",
        "event_type": "site",
        "date_start": "30 March 2019",
        "clock_start": "14:24",
        "date_end": "30 March 2019",
        "clock_end": "16:24",
        "link": "https://dev-moodle.harukaeduapps.com/calendar/view.php?view=day&time=1553930646"
      }
    },
    {
      "id": "1545",
      "type": "Moodle::Event",
      "attributes": {
        "name": "Phonix Meetup",
        "description": "Ini deskripsi dari meetup Phonix",
        "course_name": "All courses",
        "created_by": "Matz",
        "event_type": "site",
        "date_start": "05 April 2019",
        "clock_start": "14:24",
        "date_end": "05 April 2019",
        "clock_end": "15:24",
        "link": "https://dev-moodle.harukaeduapps.com/calendar/view.php?view=day&time=1554449046"
      }
    },
    {
      "id": "1546",
      "type": "Moodle::Event",
      "attributes": {
        "name": "JS Meetup",
        "description": "Ini deskripsi dari meetup Phonix",
        "course_name": "All courses",
        "created_by": "employee_7",
        "event_type": "site",
        "date_start": "05 April 2019",
        "clock_start": "17:24",
        "date_end": "05 April 2019",
        "clock_end": "22:24",
        "link": "https://dev-moodle.harukaeduapps.com/calendar/view.php?view=day&time=1554459846"
      }
    }
  ]
}

Events filter by created_by

# api/v1/events?created_by=employee_8
{
  "status": true,
  "length": 1,
  "data": [
    {
      "id": "1551",
      "type": "Moodle::Event",
      "attributes": {
        "name": "JS Meetup",
        "description": "Ini deskripsi dari meetup Phonix",
        "course_name": "All courses",
        "created_by": "employee_8",
        "event_type": "site",
        "date_start": "05 April 2019",
        "clock_start": "17:24",
        "date_end": "05 April 2019",
        "clock_end": "22:24",
        "link": "https://dev-moodle.harukaeduapps.com/calendar/view.php?view=day&time=1554459846"
      }
    }
  ]
}

Events filter by date_start

# api/v1/events?date_start=05-April-2019
{
  "status": true,
  "length": 2,
  "data": [
    {
      "id": "1560",
      "type": "Moodle::Event",
      "attributes": {
        "name": "Phonix Meetup",
        "description": "Ini deskripsi dari meetup Phonix",
        "course_name": "All courses",
        "created_by": "Matz",
        "event_type": "site",
        "date_start": "05 April 2019",
        "clock_start": "14:24",
        "date_end": "05 April 2019",
        "clock_end": "15:24",
        "link": "https://dev-moodle.harukaeduapps.com/calendar/view.php?view=day&time=1554449046"
      }
    },
    {
      "id": "1561",
      "type": "Moodle::Event",
      "attributes": {
        "name": "JS Meetup",
        "description": "Ini deskripsi dari meetup Phonix",
        "course_name": "All courses",
        "created_by": "employee_10",
        "event_type": "site",
        "date_start": "05 April 2019",
        "clock_start": "17:24",
        "date_end": "05 April 2019",
        "clock_end": "22:24",
        "link": "https://dev-moodle.harukaeduapps.com/calendar/view.php?view=day&time=1554459846"
      }
    }
  ]
}

Events upcomings

# api/v1/events?upcoming=2
{
  "status": true,
  "length": 2,
  "data": [
    {
      "id": "1553",
      "type": "Moodle::Event",
      "attributes": {
        "name": "Rust Meetup",
        "description": "Ini deskripsi dari meetup Rust",
        "course_name": "All courses",
        "created_by": "Matz",
        "event_type": "site",
        "date_start": "27 March 2019",
        "clock_start": "14:24",
        "date_end": "27 March 2019",
        "clock_end": "15:24",
        "link": "https://dev-moodle.harukaeduapps.com/calendar/view.php?view=day&time=1553671446"
      }
    },
    {
      "id": "1552",
      "type": "Moodle::Event",
      "attributes": {
        "name": "Ruby Meetup",
        "description": "Ini deskripsi dari meetup Ruby",
        "course_name": "All courses",
        "created_by": "Matz",
        "event_type": "site",
        "date_start": "28 March 2019",
        "clock_start": "14:24",
        "date_end": "29 March 2019",
        "clock_end": "14:24",
        "link": "https://dev-moodle.harukaeduapps.com/calendar/view.php?view=day&time=1553757846"
      }
    }
  ]
}

Events Pagination

# api/v1/events?page=1
{
  "status": true,
  "length": 2,
  "data": [
    {
      "id": "1553",
      "type": "Moodle::Event",
      "attributes": {
        "name": "Rust Meetup",
        "description": "Ini deskripsi dari meetup Rust",
        "course_name": "All courses",
        "created_by": "Matz",
        "event_type": "site",
        "date_start": "27 March 2019",
        "clock_start": "14:24",
        "date_end": "27 March 2019",
        "clock_end": "15:24",
        "link": "https://dev-moodle.harukaeduapps.com/calendar/view.php?view=day&time=1553671446"
      }
    },
    {
      "id": "1552",
      "type": "Moodle::Event",
      "attributes": {
        "name": "Ruby Meetup",
        "description": "Ini deskripsi dari meetup Ruby",
        "course_name": "All courses",
        "created_by": "Matz",
        "event_type": "site",
        "date_start": "28 March 2019",
        "clock_start": "14:24",
        "date_end": "29 March 2019",
        "clock_end": "14:24",
        "link": "https://dev-moodle.harukaeduapps.com/calendar/view.php?view=day&time=1553757846"
      }
    }
  ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment