Public Events

Public Events represent scheduled training events in the system.

An event record is part of the events module and provides the following information:

  • prices
  • personnel_administrator
  • personnel_tutor
  • code
  • personnel_administrator_id
  • region_id
  • price
  • course
  • tag
  • course_id
  • id
  • delegates_max
  • venue_id
  • title
  • personnel
  • tax_type
  • company_id
  • delegates_reserved
  • location
  • is_sold_out
  • notes2
  • event_template_id
  • delegates_booked
  • account_id
  • registration_deadline
  • tag_id
  • disposition
  • is_online
  • is_cancelled
  • delegates_actual
  • account
  • is_provisional
  • non_working_days
  • region
  • is_lms
  • venue
  • overall_attendance
  • account_venue
  • personnel_tutor_id
  • tax_type_id
  • notes
  • currency_code
  • type
  • time_zone
  • start_date
  • start_time
  • end_date
  • end_time
  • start_tz
  • end_tz
  • classroom_start
  • classroom_end
  • classroom_start_tz
  • classroom_end_tz

Getting Public Events

GET (/api/v2/event/public_events/:id()

  • statuscode 200

    no error

  • statuscode 404

    does not exist

Using Curl:

curl https://YOUR-SUBDOMAIN.administrateapp.com/api/v2/event/public_events/6     -k -u (login):(password)

Using PHP:

<?php
$credentials = '(username):(password)';
$url = 'https://YOUR-SUBDOMAIN.administrateapp.com/api/v2/event/public_events/6';
$options = array(
  'http' => array(
    'method'  => 'GET',
    'header'=>  "Accept: application/json\r\n" .
                "Authorization: Basic " . base64_encode($credentials)
    )
);
$context  = stream_context_create($options);
$result = file_get_contents($url, false, $context);
echo $result;

Using Python:

import json
import requests

response = requests.get('http://YOUR-SUBDOMAIN.administrateapp.com/api/v2/event/public_events/6',
                         auth=('<username>', '<password>'))

print response.json

Example response:

{
    "prices": [
        {
            "price_level": {
                "expiry_offset": 10,
                "description": "Description",
                "is_deleted": false,
                "id": 1,
                "name": "Normal"
            },
            "event_id": 6,
            "region": {
                "name": "Test Region",
                "default_tax": null,
                "countries": [],
                "invoice_numbering": "company",
                "default_tax_id": null,
                "company": {
                    "registration_numbers": null,
                    "code": "ACM",
                    "name": "Acme Corporation",
                    "settings": {
                        "time_format": "H:i",
                        "date_format": "Y-m-d",
                        "locale": "en_GB",
                        "week_starts": null,
                        "non_working_days": null
                    },
                    "bank_details": null,
                    "currency": {
                        "code": "GBP",
                        "name": "British Pound Sterling",
                        "symbol": "\u00a3",
                        "html_code": null,
                        "id": 1,
                        "is_base": true
                    },
                    "id": 1,
                    "currency_code": "GBP",
                    "account_id": null
                },
                "company_id": 1,
                "mapped_countries": [],
                "is_hidden": false,
                "id": "TEST"
            },
            "id": 1,
            "currency": {
                "code": "GBP",
                "name": "British Pound Sterling",
                "symbol": "\u00a3",
                "html_code": null,
                "id": 1,
                "is_base": true
            },
            "price": 100.0
        }
    ],
    "personnel_administrator": null,
    "personnel_tutor": {
        "membership_number": null,
        "last_name": "Smith",
        "tel": null,
        "address_unit": null,
        "contract_notes": null,
        "created_on": "2017-02-21T14:33:07",
        "inactive": false,
        "salutation": null,
        "address_postcode": null,
        "address_street": null,
        "id": 1,
        "first_name": "John",
        "middle_name": null,
        "import_ref": null,
        "address_region": null,
        "organisation": null,
        "company_id": 1,
        "department": null,
        "address_locality": null,
        "email": null,
        "job_title": null,
        "dont_mail": false,
        "fax": null,
        "account_id": 1,
        "marketing_activity_id": null,
        "lms_bio": null,
        "address_town": null,
        "source2": null,
        "source1": null,
        "is_admin": 0,
        "is_tutor": false,
        "tutor_bio": null,
        "dormant": null,
        "is_deleted": false,
        "address_country_id": null,
        "mobile": null,
        "notes": null,
        "is_staff": false,
        "no_third_party": null,
        "created_by_id": null,
        "external_id": null
    },
    "code": null,
    "personnel_administrator_id": null,
    "region_id": null,
    "price": 100.0,
    "course": {
        "days_text": null,
        "import_id": null,
        "code": null,
        "related_courses": null,
        "topics": null,
        "days": null,
        "price": null,
        "course_text_9": null,
        "course_text_8": null,
        "mapped_items": [],
        "language_code": null,
        "pricing_band": null,
        "location_id": 0,
        "lms_summary": null,
        "uk_vat_rate": null,
        "title": null,
        "introduction": null,
        "course_text_7": null,
        "level_id": null,
        "company_id": null,
        "id": 1,
        "top_seller": null,
        "course_text_13": null,
        "course_text_12": null,
        "course_text_11": null,
        "course_text_10": null,
        "method": null,
        "course_text_14": null,
        "company": null,
        "registration_deadline_offset": null,
        "disposition": null,
        "prices": [
            {
                "region_id": "TEST",
                "price_level": "Normal",
                "price": 100.0,
                "course_id": 1,
                "id": 1,
                "currency_code": "GBP"
            }
        ],
        "pre_requisites": null,
        "categories": [],
        "allowable_tutors": [],
        "benefits": null,
        "_lms_links": null,
        "level": null,
        "short_code": null,
        "sales_tax_rate": null,
        "pricing_band_id": null,
        "cpe": null,
        "summary": null,
        "default_start_time": null,
        "level_on_pdf": 0,
        "is_archived": false,
        "default_end_time": null,
        "tax_type": null
    },
    "tag": null,
    "course_id": 1,
    "id": 6,
    "end_time": "12:00:00",
    "delegates_max": 10,
    "venue_id": 1,
    "title": null,
    "personnel": [],
    "tax_type": null,
    "company_id": null,
    "delegates_reserved": 0.0,
    "location": null,
    "classroom_end": "2013-02-03T12:00:00",
    "is_sold_out": false,
    "notes2": null,
    "event_template_id": null,
    "type": "public",
    "start_date": "2013-01-02T00:00:00",
    "delegates_booked": 0.0,
    "account_id": null,
    "end_date": "2013-02-03",
    "start_time": "09:00:00",
    "registration_deadline": null,
    "tag_id": null,
    "classroom_start": "2013-01-02T09:00:00",
    "disposition": "normal",
    "is_online": false,
    "is_cancelled": false,
    "delegates_actual": null,
    "account": null,
    "is_provisional": false,
    "non_working_days": [],
    "region": null,
    "is_lms": false,
    "venue": {
        "is_enabled": true,
        "is_deleted": false,
        "region_id": null,
        "default_tax": null,
        "country": null,
        "region": null,
        "country_id": null,
        "company_id": null,
        "name": "Test EventVenue",
        "default_tax_id": null,
        "id": 1,
        "description": null
    },
    "overall_attendance": null,
    "account_venue": null,
    "personnel_tutor_id": 1,
    "tax_type_id": null,
    "notes": null,
    "currency_code": "GBP",
    "time_zone": "Europe/Paris",
    "start_tz": "2013-01-02T09:00:00+01:00",
    "end_tz": "2013-02-03T12:00:00+01:00",
    "classroom_start_tz": "2013-01-02T09:00:00+01:00",
    "classroom_end_tz": "2013-02-03T12:00:00+01:00"
}

Getting more than one Public Event

GET (/api/v2/event/public_events()

  • statuscode 200

    no error

  • statuscode 404

    does not exist

Using Curl:

curl https://YOUR-SUBDOMAIN.administrateapp.com/api/v2/event/public_events     -k -u (login):(password)

Using PHP:

<?php
$credentials = '(username):(password)';
$url = 'https://YOUR-SUBDOMAIN.administrateapp.com/api/v2/event/public_events';
$options = array(
  'http' => array(
    'method'  => 'GET',
    'header'=>  "Accept: application/json\r\n" .
                "Authorization: Basic " . base64_encode($credentials)
    )
);
$context  = stream_context_create($options);
$result = file_get_contents($url, false, $context);
echo $result;

Using Python:

import json
import requests

response = requests.get('http://YOUR-SUBDOMAIN.administrateapp.com/api/v2/event/public_events',
                         auth=('<username>', '<password>'))

print response.json

Example response:

[
    {
        "prices": [],
        "personnel_administrator": null,
        "personnel_tutor": {
            "membership_number": null,
            "last_name": "Smith",
            "tel": null,
            "address_unit": null,
            "contract_notes": null,
            "created_on": "2017-02-21T14:33:07",
            "inactive": false,
            "salutation": null,
            "address_postcode": null,
            "address_street": null,
            "id": 1,
            "first_name": "John",
            "middle_name": null,
            "import_ref": null,
            "address_region": null,
            "organisation": null,
            "company_id": 1,
            "department": null,
            "address_locality": null,
            "email": null,
            "job_title": null,
            "dont_mail": false,
            "fax": null,
            "account_id": 1,
            "marketing_activity_id": null,
            "lms_bio": null,
            "address_town": null,
            "source2": null,
            "source1": null,
            "is_admin": 0,
            "is_tutor": false,
            "tutor_bio": null,
            "dormant": null,
            "is_deleted": false,
            "address_country_id": null,
            "mobile": null,
            "notes": null,
            "is_staff": false,
            "no_third_party": null,
            "created_by_id": null,
            "external_id": null
        },
        "code": null,
        "personnel_administrator_id": null,
        "region_id": null,
        "price": null,
        "course": {
            "days_text": null,
            "import_id": null,
            "code": null,
            "related_courses": null,
            "topics": null,
            "days": null,
            "price": null,
            "course_text_9": null,
            "course_text_8": null,
            "mapped_items": [],
            "language_code": null,
            "pricing_band": null,
            "location_id": 0,
            "lms_summary": null,
            "uk_vat_rate": null,
            "title": null,
            "introduction": null,
            "course_text_7": null,
            "level_id": null,
            "company_id": null,
            "id": 1,
            "top_seller": null,
            "course_text_13": null,
            "course_text_12": null,
            "course_text_11": null,
            "course_text_10": null,
            "method": null,
            "course_text_14": null,
            "company": null,
            "registration_deadline_offset": null,
            "disposition": null,
            "prices": [
                {
                    "region_id": "TEST",
                    "price_level": "Normal",
                    "price": 100.0,
                    "course_id": 1,
                    "id": 1,
                    "currency_code": "GBP"
                }
            ],
            "pre_requisites": null,
            "categories": [],
            "allowable_tutors": [],
            "benefits": null,
            "_lms_links": null,
            "level": null,
            "short_code": null,
            "sales_tax_rate": null,
            "pricing_band_id": null,
            "cpe": null,
            "summary": null,
            "default_start_time": null,
            "level_on_pdf": 0,
            "is_archived": false,
            "default_end_time": null,
            "tax_type": null
        },
        "tag": null,
        "course_id": 1,
        "id": 4,
        "end_time": "12:00:00",
        "delegates_max": 10,
        "venue_id": 1,
        "title": null,
        "personnel": [],
        "tax_type": null,
        "company_id": null,
        "delegates_reserved": 0.0,
        "location": null,
        "classroom_end": "2013-01-02T09:00:00",
        "is_sold_out": false,
        "notes2": null,
        "event_template_id": null,
        "type": "public",
        "start_date": "2013-01-02T00:00:00",
        "delegates_booked": 0.0,
        "account_id": null,
        "end_date": "2013-02-03",
        "start_time": "09:00:00",
        "registration_deadline": null,
        "tag_id": null,
        "classroom_start": "2013-01-02T09:00:00",
        "disposition": "normal",
        "is_online": false,
        "is_cancelled": false,
        "delegates_actual": null,
        "account": null,
        "is_provisional": false,
        "non_working_days": [],
        "region": null,
        "is_lms": false,
        "venue": {
            "is_enabled": true,
            "is_deleted": false,
            "region_id": null,
            "default_tax": null,
            "country": null,
            "region": null,
            "country_id": null,
            "company_id": null,
            "name": "Test EventVenue",
            "default_tax_id": null,
            "id": 1,
            "description": null
        },
        "overall_attendance": null,
        "account_venue": null,
        "personnel_tutor_id": 1,
        "tax_type_id": null,
        "notes": null,
        "currency_code": "GBP"
    },
    {
        "prices": [],
        "personnel_administrator": null,
        "personnel_tutor": {
            "membership_number": null,
            "last_name": "Smith",
            "tel": null,
            "address_unit": null,
            "contract_notes": null,
            "created_on": "2017-02-21T14:33:07",
            "inactive": false,
            "salutation": null,
            "address_postcode": null,
            "address_street": null,
            "id": 1,
            "first_name": "John",
            "middle_name": null,
            "import_ref": null,
            "address_region": null,
            "organisation": null,
            "company_id": 1,
            "department": null,
            "address_locality": null,
            "email": null,
            "job_title": null,
            "dont_mail": false,
            "fax": null,
            "account_id": 1,
            "marketing_activity_id": null,
            "lms_bio": null,
            "address_town": null,
            "source2": null,
            "source1": null,
            "is_admin": 0,
            "is_tutor": false,
            "tutor_bio": null,
            "dormant": null,
            "is_deleted": false,
            "address_country_id": null,
            "mobile": null,
            "notes": null,
            "is_staff": false,
            "no_third_party": null,
            "created_by_id": null,
            "external_id": null
        },
        "code": null,
        "personnel_administrator_id": null,
        "region_id": null,
        "price": null,
        "course": {
            "days_text": null,
            "import_id": null,
            "code": null,
            "related_courses": null,
            "topics": null,
            "days": null,
            "price": null,
            "course_text_9": null,
            "course_text_8": null,
            "mapped_items": [],
            "language_code": null,
            "pricing_band": null,
            "location_id": 0,
            "lms_summary": null,
            "uk_vat_rate": null,
            "title": null,
            "introduction": null,
            "course_text_7": null,
            "level_id": null,
            "company_id": null,
            "id": 1,
            "top_seller": null,
            "course_text_13": null,
            "course_text_12": null,
            "course_text_11": null,
            "course_text_10": null,
            "method": null,
            "course_text_14": null,
            "company": null,
            "registration_deadline_offset": null,
            "disposition": null,
            "prices": [
                {
                    "region_id": "TEST",
                    "price_level": "Normal",
                    "price": 100.0,
                    "course_id": 1,
                    "id": 1,
                    "currency_code": "GBP"
                }
            ],
            "pre_requisites": null,
            "categories": [],
            "allowable_tutors": [],
            "benefits": null,
            "_lms_links": null,
            "level": null,
            "short_code": null,
            "sales_tax_rate": null,
            "pricing_band_id": null,
            "cpe": null,
            "summary": null,
            "default_start_time": null,
            "level_on_pdf": 0,
            "is_archived": false,
            "default_end_time": null,
            "tax_type": null
        },
        "tag": null,
        "course_id": 1,
        "id": 5,
        "end_time": "12:00:42",
        "delegates_max": 80,
        "venue_id": 1,
        "title": null,
        "personnel": [],
        "tax_type": null,
        "company_id": null,
        "delegates_reserved": 0.0,
        "location": null,
        "classroom_end": "2013-02-03T10:23:30",
        "is_sold_out": false,
        "notes2": null,
        "event_template_id": null,
        "type": "public",
        "start_date": "2013-02-03T00:00:00",
        "delegates_booked": 0.0,
        "account_id": null,
        "end_date": "2013-04-05",
        "start_time": "10:23:30",
        "registration_deadline": null,
        "tag_id": null,
        "classroom_start": "2013-02-03T10:23:30",
        "disposition": "normal",
        "is_online": false,
        "is_cancelled": false,
        "delegates_actual": null,
        "account": null,
        "is_provisional": true,
        "non_working_days": [],
        "region": null,
        "is_lms": false,
        "venue": {
            "is_enabled": true,
            "is_deleted": false,
            "region_id": null,
            "default_tax": null,
            "country": null,
            "region": null,
            "country_id": null,
            "company_id": null,
            "name": "Test EventVenue",
            "default_tax_id": null,
            "id": 1,
            "description": null
        },
        "overall_attendance": null,
        "account_venue": null,
        "personnel_tutor_id": 1,
        "tax_type_id": null,
        "notes": null,
        "currency_code": "GBP",
        "time_zone": "Europe/Paris",
        "start_tz": "2013-01-02T09:00:00+00:01",
        "end_tz": "2013-02-03T12:00:00+00:01",
        "classroom_start_tz": "2013-01-02T09:00:00+00:01",
        "classroom_end_tz": "2013-02-03T12:00:00+00:01"
    }
]

Filtering

The results for a list of contacts can be filtered. See Filtering

Creating Public Events

POST (/api/v2/event/public_events()

Required fields:

  • venue_id
  • end_date
  • start_time
  • personnel_tutor_id
  • disposition
  • course_id
  • start_date
  • currency_code
  • end_time

For users who are trying our Time Zone feature this additional field is required:

  • time_zone

The time_zone field will only accept valid time zones. See Valid Time Zones

  • statuscode 200

    no error

  • statuscode 404

    could not create

Using Curl:

curl https://YOUR-SUBDOMAIN.administrateapp.com/api/v2/event/public_events     -H "Content-Type: application/json"     -k -u (login):(password)     -X POST     -d '{"end_date": "2013-02-03", "start_time": "09:00", "is_provisional": false, "disposition": "normal", "course_id": 1, "delegates_max": 10, "venue_id": 1, "end_time": "12:00", "start_date": "2013-01-02", "currency_code": "GBP", "personnel_tutor_id": 1}'

Using PHP:

<?php
$credentials = '(username):(password)';
$url = 'https://YOUR-SUBDOMAIN.administrateapp.com/api/v2/event/public_events';
$data = array("delegates_max" => 10, "venue_id" => 1, "end_date" => u'2013-02-03', "start_time" => u'09:00', "is_provisional" => False, "end_time" => u'12:00', "disposition" => u'normal', "course_id" => 1, "start_date" => u'2013-01-02', "currency_code" => u'GBP', "personnel_tutor_id" => 1);
$options = array(
'http' => array(
'method'  => 'POST',
'content' => json_encode($data),
'header'=>  "Content-Type: application/json\r\n" .
            "Accept: application/json\r\n" .
            "Authorization: Basic " . base64_encode($credentials)
)
);
$context  = stream_context_create($options);
$result = file_get_contents($url, false, $context);
echo $result;

Using Python:

import json
import requests

data = {u'delegates_max': 10, u'venue_id': 1, u'end_date': u'2013-02-03', u'start_time': u'09:00', u'is_provisional': False, u'end_time': u'12:00', u'disposition': u'normal', u'course_id': 1, u'start_date': u'2013-01-02', u'currency_code': u'GBP', u'personnel_tutor_id': 1}

response = requests.post('http://YOUR-SUBDOMAIN.administrateapp.com/api/v2/event/public_events',
                        data=json.dumps(data),
                        headers={'content-type': 'application/json'},
                        auth=('<username>', '<password>'))

print response.json

Example response:

{
    "prices": [
        {
            "price_level": {
                "expiry_offset": 10,
                "description": "Description",
                "is_deleted": false,
                "id": 1,
                "name": "Normal"
            },
            "event_id": 6,
            "region": {
                "name": "Test Region",
                "default_tax": null,
                "countries": [],
                "invoice_numbering": "company",
                "default_tax_id": null,
                "company": {
                    "registration_numbers": null,
                    "code": "ACM",
                    "name": "Acme Corporation",
                    "settings": {
                        "time_format": "H:i",
                        "date_format": "Y-m-d",
                        "locale": "en_GB",
                        "week_starts": null,
                        "non_working_days": null
                    },
                    "bank_details": null,
                    "currency": {
                        "code": "GBP",
                        "name": "British Pound Sterling",
                        "symbol": "\u00a3",
                        "html_code": null,
                        "id": 1,
                        "is_base": true
                    },
                    "id": 1,
                    "currency_code": "GBP",
                    "account_id": null
                },
                "company_id": 1,
                "mapped_countries": [],
                "is_hidden": false,
                "id": "TEST"
            },
            "id": 1,
            "currency": {
                "code": "GBP",
                "name": "British Pound Sterling",
                "symbol": "\u00a3",
                "html_code": null,
                "id": 1,
                "is_base": true
            },
            "price": 100.0
        }
    ],
    "personnel_administrator": null,
    "personnel_tutor": {
        "membership_number": null,
        "last_name": "Smith",
        "tel": null,
        "address_unit": null,
        "contract_notes": null,
        "created_on": "2017-02-21T14:33:07",
        "inactive": false,
        "salutation": null,
        "address_postcode": null,
        "address_street": null,
        "id": 1,
        "first_name": "John",
        "middle_name": null,
        "import_ref": null,
        "address_region": null,
        "organisation": null,
        "company_id": 1,
        "department": null,
        "address_locality": null,
        "email": null,
        "job_title": null,
        "dont_mail": false,
        "fax": null,
        "account_id": 1,
        "marketing_activity_id": null,
        "lms_bio": null,
        "address_town": null,
        "source2": null,
        "source1": null,
        "is_admin": 0,
        "is_tutor": false,
        "tutor_bio": null,
        "dormant": null,
        "is_deleted": false,
        "address_country_id": null,
        "mobile": null,
        "notes": null,
        "is_staff": false,
        "no_third_party": null,
        "created_by_id": null,
        "external_id": null
    },
    "code": null,
    "personnel_administrator_id": null,
    "region_id": null,
    "price": 100.0,
    "course": {
        "days_text": null,
        "import_id": null,
        "code": null,
        "related_courses": null,
        "topics": null,
        "days": null,
        "price": null,
        "course_text_9": null,
        "course_text_8": null,
        "mapped_items": [],
        "language_code": null,
        "pricing_band": null,
        "location_id": 0,
        "lms_summary": null,
        "uk_vat_rate": null,
        "title": null,
        "introduction": null,
        "course_text_7": null,
        "level_id": null,
        "company_id": null,
        "id": 1,
        "top_seller": null,
        "course_text_13": null,
        "course_text_12": null,
        "course_text_11": null,
        "course_text_10": null,
        "method": null,
        "course_text_14": null,
        "company": null,
        "registration_deadline_offset": null,
        "disposition": null,
        "prices": [
            {
                "region_id": "TEST",
                "price_level": "Normal",
                "price": 100.0,
                "course_id": 1,
                "id": 1,
                "currency_code": "GBP"
            }
        ],
        "pre_requisites": null,
        "categories": [],
        "allowable_tutors": [],
        "benefits": null,
        "_lms_links": null,
        "level": null,
        "short_code": null,
        "sales_tax_rate": null,
        "pricing_band_id": null,
        "cpe": null,
        "summary": null,
        "default_start_time": null,
        "level_on_pdf": 0,
        "is_archived": false,
        "default_end_time": null,
        "tax_type": null
    },
    "tag": null,
    "course_id": 1,
    "id": 6,
    "end_time": "12:00:00",
    "delegates_max": 10,
    "venue_id": 1,
    "title": null,
    "personnel": [],
    "tax_type": null,
    "company_id": null,
    "delegates_reserved": 0.0,
    "location": null,
    "classroom_end": "2013-02-03T12:00:00",
    "is_sold_out": false,
    "notes2": null,
    "event_template_id": null,
    "type": "public",
    "start_date": "2013-01-02T00:00:00",
    "delegates_booked": 0.0,
    "account_id": null,
    "end_date": "2013-02-03",
    "start_time": "09:00:00",
    "registration_deadline": null,
    "tag_id": null,
    "classroom_start": "2013-01-02T09:00:00",
    "disposition": "normal",
    "is_online": false,
    "is_cancelled": false,
    "delegates_actual": null,
    "account": null,
    "is_provisional": false,
    "non_working_days": [],
    "region": null,
    "is_lms": false,
    "venue": {
        "is_enabled": true,
        "is_deleted": false,
        "region_id": null,
        "default_tax": null,
        "country": null,
        "region": null,
        "country_id": null,
        "company_id": null,
        "name": "Test EventVenue",
        "default_tax_id": null,
        "id": 1,
        "description": null
    },
    "overall_attendance": null,
    "account_venue": null,
    "personnel_tutor_id": 1,
    "tax_type_id": null,
    "notes": null,
    "currency_code": "GBP",
    "time_zone": "Europe/Paris",
    "start_tz": "2013-01-02T09:00:00+01:00",
    "end_tz": "2013-02-03T12:00:00+01:00",
    "classroom_start_tz": "2013-01-02T09:00:00+01:00",
    "classroom_end_tz": "2013-02-03T12:00:00+01:00"
}

Updating Public Events

PUT (/api/v2/event/public_events/(int: id)

  • statuscode 200

    no error

  • statuscode 404

    does not exist

Using Curl:

curl https://YOUR-SUBDOMAIN.administrateapp.com/api/v2/event/public_events/8     -H "Content-Type: application/json"     -k -u (login):(password)     -X PUT     -d '{"start_date": "2009-01-25 14:15:16", "end_date": "2010-01-25"}'

Using PHP:

<?php
$credentials = '(username):(password)';
$url = 'https://YOUR-SUBDOMAIN.administrateapp.com/api/v2/event/public_events/8';
$data = array("start_date" => u'2009-01-25 14:15:16', "end_date" => u'2010-01-25');
$options = array(
'http' => array(
'method'  => 'PUT',
'content' => json_encode($data),
'header'=>  "Content-Type: application/json\r\n" .
            "Accept: application/json\r\n" .
            "Authorization: Basic " . base64_encode($credentials)
)
);
$context  = stream_context_create($options);
$result = file_get_contents($url, false, $context);
echo $result;

Using Python:

import json
import requests

data = {u'start_date': u'2009-01-25 14:15:16', u'end_date': u'2010-01-25'}

response = requests.put('http://YOUR-SUBDOMAIN.administrateapp.com/api/v2/event/public_events/8',
                        data=json.dumps(data),
                        headers={'content-type': 'application/json'},
                        auth=('<username>', '<password>'))

print response.json

Example response:

{
    "prices": [],
    "personnel_administrator": null,
    "personnel_tutor": {
        "membership_number": null,
        "last_name": "Smith",
        "tel": null,
        "address_unit": null,
        "contract_notes": null,
        "created_on": "2017-02-21T14:33:07",
        "inactive": false,
        "salutation": null,
        "address_postcode": null,
        "address_street": null,
        "id": 1,
        "first_name": "John",
        "middle_name": null,
        "import_ref": null,
        "address_region": null,
        "organisation": null,
        "company_id": 1,
        "department": null,
        "address_locality": null,
        "email": null,
        "job_title": null,
        "dont_mail": false,
        "fax": null,
        "account_id": 1,
        "marketing_activity_id": null,
        "lms_bio": null,
        "address_town": null,
        "source2": null,
        "source1": null,
        "is_admin": 0,
        "is_tutor": false,
        "tutor_bio": null,
        "dormant": null,
        "is_deleted": false,
        "address_country_id": null,
        "mobile": null,
        "notes": null,
        "is_staff": false,
        "no_third_party": null,
        "created_by_id": null,
        "external_id": null
    },
    "code": null,
    "personnel_administrator_id": null,
    "region_id": null,
    "price": null,
    "course": {
        "days_text": null,
        "import_id": null,
        "code": null,
        "related_courses": null,
        "topics": null,
        "days": null,
        "price": null,
        "course_text_9": null,
        "course_text_8": null,
        "mapped_items": [],
        "language_code": null,
        "pricing_band": null,
        "location_id": 0,
        "lms_summary": null,
        "uk_vat_rate": null,
        "title": null,
        "introduction": null,
        "course_text_7": null,
        "level_id": null,
        "company_id": null,
        "id": 1,
        "top_seller": null,
        "course_text_13": null,
        "course_text_12": null,
        "course_text_11": null,
        "course_text_10": null,
        "method": null,
        "course_text_14": null,
        "company": null,
        "registration_deadline_offset": null,
        "disposition": null,
        "prices": [
            {
                "region_id": "TEST",
                "price_level": "Normal",
                "price": 100.0,
                "course_id": 1,
                "id": 1,
                "currency_code": "GBP"
            }
        ],
        "pre_requisites": null,
        "categories": [],
        "allowable_tutors": [],
        "benefits": null,
        "_lms_links": null,
        "level": null,
        "short_code": null,
        "sales_tax_rate": null,
        "pricing_band_id": null,
        "cpe": null,
        "summary": null,
        "default_start_time": null,
        "level_on_pdf": 0,
        "is_archived": false,
        "default_end_time": null,
        "tax_type": null
    },
    "tag": null,
    "course_id": 1,
    "id": 8,
    "end_time": "12:00:00",
    "delegates_max": 10,
    "venue_id": 1,
    "title": null,
    "personnel": [],
    "tax_type": null,
    "company_id": null,
    "delegates_reserved": 0.0,
    "location": null,
    "classroom_end": "2013-02-03T12:00:00",
    "is_sold_out": false,
    "notes2": null,
    "event_template_id": null,
    "type": "public",
    "start_date": "2009-01-25T14:15:16",
    "delegates_booked": 0.0,
    "account_id": null,
    "end_date": "2010-01-25",
    "start_time": "09:00:00",
    "registration_deadline": null,
    "tag_id": null,
    "classroom_start": "2013-01-02T09:00:00",
    "disposition": "normal",
    "is_online": false,
    "is_cancelled": false,
    "delegates_actual": null,
    "account": null,
    "is_provisional": false,
    "non_working_days": [],
    "region": null,
    "is_lms": false,
    "venue": {
        "is_enabled": true,
        "is_deleted": false,
        "region_id": null,
        "default_tax": null,
        "country": null,
        "region": null,
        "country_id": null,
        "company_id": null,
        "name": "Test EventVenue",
        "default_tax_id": null,
        "id": 1,
        "description": null
    },
    "overall_attendance": null,
    "account_venue": null,
    "personnel_tutor_id": 1,
    "tax_type_id": null,
    "notes": null,
    "currency_code": "GBP",
    "time_zone": "Europe/Paris",
    "start_tz": "2013-01-02T09:00:00+01:00",
    "end_tz": "2013-02-03T12:00:00+01:00",
    "classroom_start_tz": "2013-01-02T09:00:00+01:00",
    "classroom_end_tz": "2013-02-03T12:00:00+01:00"
}

Deleting Public Events

DELETE (/api/v2/event/public_events/(int: id)

  • statuscode 200

    deleted entity successfully

  • statuscode 404

    entity not found

Using Curl:

curl https://YOUR-SUBDOMAIN.administrateapp.com/api/v2/event/public_events/3     -X DELETE -k -u (login):(password)

Using PHP:

<?php
$credentials = '(username):(password)';
$url = 'https://YOUR-SUBDOMAIN.administrateapp.com/api/v2/event/public_events/3';
$options = array(
  'http' => array(
    'method'  => 'DELETE',
    'header'=>  "Accept: application/json\r\n" .
                "Authorization: Basic " . base64_encode($credentials)
    )
);
$context  = stream_context_create($options);
$result = file_get_contents($url, false, $context);
echo $result;

Using Python:

import json
import requests

response = requests.delete('http://YOUR-SUBDOMAIN.administrateapp.com/api/v2/event/public_events/3',
                         auth=('<username>', '<password>'))

print response.json

Example response:

{
    "prices": [],
    "personnel_administrator": null,
    "personnel_tutor": {
        "membership_number": null,
        "last_name": "Smith",
        "tel": null,
        "address_unit": null,
        "contract_notes": null,
        "created_on": "2017-02-21T14:33:07",
        "inactive": false,
        "salutation": null,
        "address_postcode": null,
        "address_street": null,
        "id": 1,
        "first_name": "John",
        "middle_name": null,
        "import_ref": null,
        "address_region": null,
        "organisation": null,
        "company_id": 1,
        "department": null,
        "address_locality": null,
        "email": null,
        "job_title": null,
        "dont_mail": false,
        "fax": null,
        "account_id": 1,
        "marketing_activity_id": null,
        "lms_bio": null,
        "address_town": null,
        "source2": null,
        "source1": null,
        "is_admin": 0,
        "is_tutor": false,
        "tutor_bio": null,
        "dormant": null,
        "is_deleted": false,
        "address_country_id": null,
        "mobile": null,
        "notes": null,
        "is_staff": false,
        "no_third_party": null,
        "created_by_id": null,
        "external_id": null
    },
    "code": null,
    "personnel_administrator_id": null,
    "region_id": null,
    "price": null,
    "course": {
        "days_text": null,
        "import_id": null,
        "code": null,
        "related_courses": null,
        "topics": null,
        "days": null,
        "price": null,
        "course_text_9": null,
        "course_text_8": null,
        "mapped_items": [],
        "language_code": null,
        "pricing_band": null,
        "location_id": 0,
        "lms_summary": null,
        "uk_vat_rate": null,
        "title": null,
        "introduction": null,
        "course_text_7": null,
        "level_id": null,
        "company_id": null,
        "id": 1,
        "top_seller": null,
        "course_text_13": null,
        "course_text_12": null,
        "course_text_11": null,
        "course_text_10": null,
        "method": null,
        "course_text_14": null,
        "company": null,
        "registration_deadline_offset": null,
        "disposition": null,
        "prices": [
            {
                "region_id": "TEST",
                "price_level": "Normal",
                "price": 100.0,
                "course_id": 1,
                "id": 1,
                "currency_code": "GBP"
            }
        ],
        "pre_requisites": null,
        "categories": [],
        "allowable_tutors": [],
        "benefits": null,
        "_lms_links": null,
        "level": null,
        "short_code": null,
        "sales_tax_rate": null,
        "pricing_band_id": null,
        "cpe": null,
        "summary": null,
        "default_start_time": null,
        "level_on_pdf": 0,
        "is_archived": false,
        "default_end_time": null,
        "tax_type": null
    },
    "tag": null,
    "course_id": 1,
    "id": 3,
    "end_time": "12:00:00",
    "delegates_max": 10,
    "venue_id": 1,
    "title": null,
    "personnel": [],
    "tax_type": null,
    "company_id": null,
    "delegates_reserved": 0.0,
    "location": null,
    "classroom_end": "2013-02-03T12:00:00",
    "is_sold_out": false,
    "notes2": null,
    "event_template_id": null,
    "type": "public",
    "start_date": "2013-01-02T00:00:00",
    "delegates_booked": 0.0,
    "account_id": null,
    "end_date": "2013-02-03",
    "start_time": "09:00:00",
    "registration_deadline": null,
    "tag_id": null,
    "classroom_start": "2013-01-02T09:00:00",
    "disposition": "normal",
    "is_online": false,
    "is_cancelled": false,
    "delegates_actual": null,
    "account": null,
    "is_provisional": false,
    "non_working_days": [],
    "region": null,
    "is_lms": false,
    "venue": {
        "is_enabled": true,
        "is_deleted": false,
        "region_id": null,
        "default_tax": null,
        "country": null,
        "region": null,
        "country_id": null,
        "company_id": null,
        "name": "Test EventVenue",
        "default_tax_id": null,
        "id": 1,
        "description": null
    },
    "overall_attendance": null,
    "account_venue": null,
    "personnel_tutor_id": 1,
    "tax_type_id": null,
    "notes": null,
    "currency_code": "GBP",
    "time_zone": "Europe/Paris",
    "start_tz": "2013-01-02T09:00:00+01:00",
    "end_tz": "2013-02-03T12:00:00+01:00",
    "classroom_start_tz": "2013-01-02T09:00:00+01:00",
    "classroom_end_tz": "2013-02-03T12:00:00+01:00"
}