Locations

Locations represent event locations.

A location is part of the events module and provides the following information:

  • is_enabled
  • is_deleted
  • region_id
  • default_tax
  • country
  • region
  • country_id
  • company_id
  • name
  • default_tax_id
  • id
  • description

Getting Locations

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

  • statuscode 200

    no error

  • statuscode 404

    does not exist

Using Curl:

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

Using PHP:

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

print response.json

Example response:

{
    "is_enabled": true,
    "is_deleted": false,
    "region_id": "TEST",
    "default_tax": {
        "rate": 20.0,
        "hidden": false,
        "credit_account_id": null,
        "id": 1,
        "name": "UK Vat"
    },
    "country": {
        "region_code": null,
        "id": "UK",
        "name": "United Kingdom"
    },
    "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": {
                "html_code": null,
                "symbol": "\u00a3",
                "code": "GBP",
                "name": "British Pound Sterling",
                "is_base": true
            },
            "id": 1,
            "currency_code": "GBP",
            "account_id": null
        },
        "company_id": 1,
        "mapped_countries": [],
        "is_hidden": false,
        "id": "TEST"
    },
    "country_id": "UK",
    "company_id": 1,
    "name": "Techcube",
    "default_tax_id": 1,
    "id": 4,
    "description": null
}

Getting more than one Location

GET (/api/v2/event/venues()

  • statuscode 200

    no error

  • statuscode 404

    does not exist

Using Curl:

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

Using PHP:

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

print response.json

Example response:

[
    {
        "is_enabled": true,
        "is_deleted": false,
        "region_id": "TEST",
        "default_tax": {
            "rate": 20.0,
            "hidden": false,
            "credit_account_id": null,
            "id": 1,
            "name": "UK Vat"
        },
        "country": {
            "region_code": null,
            "id": "UK",
            "name": "United Kingdom"
        },
        "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": {
                    "html_code": null,
                    "symbol": "\u00a3",
                    "code": "GBP",
                    "name": "British Pound Sterling",
                    "is_base": true
                },
                "id": 1,
                "currency_code": "GBP",
                "account_id": null
            },
            "company_id": 1,
            "mapped_countries": [],
            "is_hidden": false,
            "id": "TEST"
        },
        "country_id": "UK",
        "company_id": 1,
        "name": "Techcube",
        "default_tax_id": 1,
        "id": 2,
        "description": null
    },
    {
        "is_enabled": true,
        "is_deleted": false,
        "region_id": "TEST",
        "default_tax": {
            "rate": 20.0,
            "hidden": false,
            "credit_account_id": null,
            "id": 1,
            "name": "UK Vat"
        },
        "country": {
            "region_code": null,
            "id": "UK",
            "name": "United Kingdom"
        },
        "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": {
                    "html_code": null,
                    "symbol": "\u00a3",
                    "code": "GBP",
                    "name": "British Pound Sterling",
                    "is_base": true
                },
                "id": 1,
                "currency_code": "GBP",
                "account_id": null
            },
            "company_id": 1,
            "mapped_countries": [],
            "is_hidden": false,
            "id": "TEST"
        },
        "country_id": "UK",
        "company_id": 1,
        "name": "Subway cowgate",
        "default_tax_id": 1,
        "id": 3,
        "description": null
    }
]

Filtering

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

Creating Locations

POST (/api/v2/event/venues()

Required fields:

  • default_tax_id
  • country_id
  • name
  • region_id
  • statuscode 200

    no error

  • statuscode 404

    could not create

Using Curl:

curl https://YOUR-SUBDOMAIN.administrateapp.com/api/v2/event/venues     -H "Content-Type: application/json"     -k -u (login):(password)     -X POST     -d '{"default_tax_id": 1, "country_id": "UK", "name": "Techcube", "region_id": "TEST"}'

Using PHP:

<?php
$credentials = '(username):(password)';
$url = 'https://YOUR-SUBDOMAIN.administrateapp.com/api/v2/event/venues';
$data = array("default_tax_id" => 1, "country_id" => u'UK', "name" => u'Techcube', "region_id" => u'TEST');
$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'default_tax_id': 1, u'country_id': u'UK', u'name': u'Techcube', u'region_id': u'TEST'}

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

print response.json

Example response:

{
    "is_enabled": true,
    "is_deleted": false,
    "region_id": "TEST",
    "default_tax": {
        "rate": 20.0,
        "hidden": false,
        "credit_account_id": null,
        "id": 1,
        "name": "UK Vat"
    },
    "country": {
        "region_code": null,
        "id": "UK",
        "name": "United Kingdom"
    },
    "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": {
                "html_code": null,
                "symbol": "\u00a3",
                "code": "GBP",
                "name": "British Pound Sterling",
                "is_base": true
            },
            "id": 1,
            "currency_code": "GBP",
            "account_id": null
        },
        "company_id": 1,
        "mapped_countries": [],
        "is_hidden": false,
        "id": "TEST"
    },
    "country_id": "UK",
    "company_id": 1,
    "name": "Techcube",
    "default_tax_id": 1,
    "id": 4,
    "description": null
}

Updating Locations

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

  • statuscode 200

    no error

  • statuscode 404

    does not exist

Using Curl:

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

Using PHP:

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

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

print response.json

Example response:

{
    "is_enabled": true,
    "is_deleted": false,
    "region_id": "TEST",
    "default_tax": {
        "rate": 20.0,
        "hidden": false,
        "credit_account_id": null,
        "id": 1,
        "name": "UK Vat"
    },
    "country": {
        "region_code": null,
        "id": "UK",
        "name": "United Kingdom"
    },
    "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": {
                "html_code": null,
                "symbol": "\u00a3",
                "code": "GBP",
                "name": "British Pound Sterling",
                "is_base": true
            },
            "id": 1,
            "currency_code": "GBP",
            "account_id": null
        },
        "company_id": 1,
        "mapped_countries": [],
        "is_hidden": false,
        "id": "TEST"
    },
    "country_id": "UK",
    "company_id": 1,
    "name": "My new value for name",
    "default_tax_id": 1,
    "id": 6,
    "description": null
}

Deleting Locations

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

  • statuscode 200

    deleted entity successfully

  • statuscode 404

    entity not found

Using Curl:

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

Using PHP:

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

print response.json

Example response:

{
    "is_enabled": true,
    "is_deleted": true,
    "region_id": "TEST",
    "default_tax": {
        "rate": 20.0,
        "hidden": false,
        "credit_account_id": null,
        "id": 1,
        "name": "UK Vat"
    },
    "country": {
        "region_code": null,
        "id": "UK",
        "name": "United Kingdom"
    },
    "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": {
                "html_code": null,
                "symbol": "\u00a3",
                "code": "GBP",
                "name": "British Pound Sterling",
                "is_base": true
            },
            "id": 1,
            "currency_code": "GBP",
            "account_id": null
        },
        "company_id": 1,
        "mapped_countries": [],
        "is_hidden": false,
        "id": "TEST"
    },
    "country_id": "UK",
    "company_id": 1,
    "name": "Techcube",
    "default_tax_id": 1,
    "id": 1,
    "description": null
}