Courses

Courses represent the products that you offer. These are not to be confused with Events.

A Course becomes an Event once a date, location and instructor have been assigned.

Fields

  • days_text
  • import_id
  • code
  • related_courses
  • topics
  • days
  • price
  • course_text_9
  • course_text_8
  • mapped_items
  • language_code
  • pricing_band
  • location_id
  • lms_summary
  • uk_vat_rate
  • title
  • introduction
  • course_text_7
  • level_id
  • company_id
  • id
  • top_seller
  • course_text_13
  • course_text_12
  • course_text_11
  • course_text_10
  • method
  • course_text_14
  • company
  • registration_deadline_offset
  • disposition
  • prices
  • pre_requisites
  • categories
  • allowable_tutors
  • benefits
  • _lms_links
  • level
  • short_code
  • sales_tax_rate
  • pricing_band_id
  • cpe
  • summary
  • default_start_time
  • level_on_pdf
  • is_archived
  • default_end_time
  • tax_type

Getting Courses

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

  • statuscode 200

    no error

  • statuscode 404

    does not exist

Using Curl:

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

Using PHP:

<?php
$credentials = '(username):(password)';
$url = 'https://YOUR-SUBDOMAIN.administrateapp.com/api/v2/event/courses/4';
$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/courses/4',
                         auth=('<username>', '<password>'))

print response.json

Example response:

{
    "days_text": null,
    "import_id": null,
    "code": "TST_1",
    "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": "Test Course 1",
    "introduction": null,
    "course_text_7": null,
    "level_id": null,
    "company_id": null,
    "id": 4,
    "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": "normal",
    "prices": [],
    "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
}

Getting more than one Course

GET (/api/v2/event/courses()

  • statuscode 200

    no error

  • statuscode 404

    does not exist

Using Curl:

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

Using PHP:

<?php
$credentials = '(username):(password)';
$url = 'https://YOUR-SUBDOMAIN.administrateapp.com/api/v2/event/courses';
$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/courses',
                         auth=('<username>', '<password>'))

print response.json

Example response:

[
    {
        "days_text": null,
        "import_id": null,
        "code": "TST_1",
        "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": "Test Course 1",
        "introduction": null,
        "course_text_7": null,
        "level_id": null,
        "company_id": null,
        "id": 2,
        "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": "normal",
        "prices": [],
        "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
    },
    {
        "days_text": null,
        "import_id": null,
        "code": "TST_2",
        "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": "Test Course 2",
        "introduction": null,
        "course_text_7": null,
        "level_id": null,
        "company_id": null,
        "id": 3,
        "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": "multisession",
        "prices": [],
        "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
    }
]

Filtering

The results for a list of contacts can be filtered. See Filtering, Courses also support filtering on custom fields. Simply prefix the custom field with custom_fields. and use the standard filtering syntax.

Example:

GET (/api/v2/event/courses?custom_fields.field_319__eq=10()

Creating Courses

POST (/api/v2/event/courses()

Required fields:

  • code
  • disposition
  • title
  • statuscode 200

    no error

  • statuscode 404

    could not create

Using Curl:

curl https://YOUR-SUBDOMAIN.administrateapp.com/api/v2/event/courses     -H "Content-Type: application/json"     -k -u (login):(password)     -X POST     -d '{"code": "TST_1", "disposition": "normal", "title": "Test Course 1"}'

Using PHP:

<?php
$credentials = '(username):(password)';
$url = 'https://YOUR-SUBDOMAIN.administrateapp.com/api/v2/event/courses';
$data = array("code" => u'TST_1', "disposition" => u'normal', "title" => u'Test Course 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'code': u'TST_1', u'disposition': u'normal', u'title': u'Test Course 1'}

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

print response.json

Example response:

{
    "days_text": null,
    "import_id": null,
    "code": "TST_1",
    "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": "Test Course 1",
    "introduction": null,
    "course_text_7": null,
    "level_id": null,
    "company_id": null,
    "id": 4,
    "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": "normal",
    "prices": [],
    "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
}

Updating Courses

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

  • statuscode 200

    no error

  • statuscode 404

    does not exist

Using Curl:

curl https://YOUR-SUBDOMAIN.administrateapp.com/api/v2/event/courses/6     -H "Content-Type: application/json"     -k -u (login):(password)     -X PUT     -d '{"code": "My new value for code"}'

Using PHP:

<?php
$credentials = '(username):(password)';
$url = 'https://YOUR-SUBDOMAIN.administrateapp.com/api/v2/event/courses/6';
$data = array("code" => u'My new value for code');
$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'code': u'My new value for code'}

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

print response.json

Example response:

{
    "days_text": null,
    "import_id": null,
    "code": "My new value for code",
    "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": "Test Course 1",
    "introduction": null,
    "course_text_7": null,
    "level_id": null,
    "company_id": null,
    "id": 6,
    "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": "normal",
    "prices": [],
    "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
}

Deleting Courses

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

  • statuscode 200

    deleted entity successfully

  • statuscode 404

    entity not found

Using Curl:

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

Using PHP:

<?php
$credentials = '(username):(password)';
$url = 'https://YOUR-SUBDOMAIN.administrateapp.com/api/v2/event/courses/1';
$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/courses/1',
                         auth=('<username>', '<password>'))

print response.json

Example response:

{
    "days_text": null,
    "import_id": null,
    "code": "TST_1",
    "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": "Test Course 1",
    "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": "normal",
    "prices": [],
    "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
}