Event Personnel

Event Personnel represent instructors, administrators and partners of events.

Fields

  • first_name
  • last_name
  • event_id
  • contact_id
  • role_id
  • tutor_event_bio
  • contact
  • role
  • type
  • id

Getting Event Personnel

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

  • statuscode 200

    no error

  • statuscode 404

    does not exist

Using Curl:

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

Using PHP:

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

print response.json

Example response:

{
    "first_name": "John",
    "last_name": "Smith",
    "event_id": 1,
    "contact_id": 1,
    "role_id": null,
    "tutor_event_bio": "Friendly admin",
    "contact": {
        "membership_number": null,
        "last_name": "Smith",
        "tel": null,
        "address_unit": null,
        "contract_notes": null,
        "created_on": "2016-11-29T13:39: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
    },
    "role": null,
    "type": "administrator",
    "id": 4
}

Getting more than one Event Personnel

GET (/api/v2/event/personnel()

  • statuscode 200

    no error

  • statuscode 404

    does not exist

Using Curl:

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

Using PHP:

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

print response.json

Example response:

[
    {
        "first_name": "John",
        "last_name": "Smith",
        "event_id": 1,
        "contact_id": 1,
        "role_id": null,
        "role": null,
        "type": "administrator",
        "id": 2
    },
    {
        "first_name": "John",
        "last_name": "Smith",
        "event_id": 1,
        "contact_id": 2,
        "role_id": null,
        "role": null,
        "type": "instructor",
        "id": 3
    }
]

Filtering

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

Creating Event Personnel

POST (/api/v2/event/personnel()

Required fields:

  • event_id
  • type
  • contact_id
  • statuscode 200

    no error

  • statuscode 404

    could not create

Using Curl:

curl https://YOUR-SUBDOMAIN.administrateapp.com/api/v2/event/personnel     -H "Content-Type: application/json"     -k -u (login):(password)     -X POST     -d '{"event_id": 1, "tutor_event_bio": "Friendly admin", "type": "administrator", "contact_id": 1}'

Using PHP:

<?php
$credentials = '(username):(password)';
$url = 'https://YOUR-SUBDOMAIN.administrateapp.com/api/v2/event/personnel';
$data = array("event_id" => 1, "tutor_event_bio" => u'Friendly admin', "type" => u'administrator', "contact_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'event_id': 1, u'tutor_event_bio': u'Friendly admin', u'type': u'administrator', u'contact_id': 1}

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

print response.json

Example response:

{
    "first_name": "John",
    "last_name": "Smith",
    "event_id": 1,
    "contact_id": 1,
    "role_id": null,
    "tutor_event_bio": "Friendly admin",
    "contact": {
        "membership_number": null,
        "last_name": "Smith",
        "tel": null,
        "address_unit": null,
        "contract_notes": null,
        "created_on": "2016-11-29T13:39: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
    },
    "role": null,
    "type": "administrator",
    "id": 4
}

Updating Event Personnel

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

  • statuscode 200

    no error

  • statuscode 404

    does not exist

Using Curl:

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

Using PHP:

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

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

print response.json

Example response:

{
    "first_name": "John",
    "last_name": "Smith",
    "event_id": 1,
    "contact_id": 1,
    "role_id": null,
    "tutor_event_bio": "My new value for tutor_event_bio",
    "contact": {
        "membership_number": null,
        "last_name": "Smith",
        "tel": null,
        "address_unit": null,
        "contract_notes": null,
        "created_on": "2016-11-29T13:39: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
    },
    "role": null,
    "type": "administrator",
    "id": 6
}

Deleting Event Personnel

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

  • statuscode 200

    deleted entity successfully

  • statuscode 404

    entity not found

Using Curl:

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

Using PHP:

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

print response.json

Example response:

{
    "first_name": "John",
    "last_name": "Smith",
    "event_id": 1,
    "contact_id": 1,
    "role_id": null,
    "tutor_event_bio": "Friendly admin",
    "contact": {
        "membership_number": null,
        "last_name": "Smith",
        "tel": null,
        "address_unit": null,
        "contract_notes": null,
        "created_on": "2016-11-29T13:39: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
    },
    "role": null,
    "type": "administrator",
    "id": 1
}