Administrate

Tasks

A task record holds the following information:

  • status
  • account
  • user_id
  • lead_id
  • lead
  • type_id
  • event_id
  • description
  • start_datetime
  • contact_id
  • event
  • created_on
  • contact
  • user
  • end_datetime
  • show_on_calendar
  • subject
  • type
  • id
  • opportunity_id

Getting Tasks

GET /api/v2/crm/tasks/:id
statuscode 200:no error
statuscode 404:does not exist
Using Python:
import json
import requests

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

print response.json
Using Curl:
curl https://YOUR-SUBDOMAIN.administrateapp.com/api/v2/crm/tasks/4     -k -u (login):(password)
Using PHP:
<?php
$credentials = '(username):(password)';
$url = 'https://YOUR-SUBDOMAIN.administrateapp.com/api/v2/crm/tasks/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;
Example response:
{
    "status": "Completed",
    "account": {
        "shipping_address_locality": null,
        "import_id": null,
        "primary_contact_id": null,
        "tel": null,
        "address_unit": null,
        "shipping_address_town": null,
        "default_approver": 0,
        "shipping_address_unit": null,
        "no_publicity": null,
        "shipping_address_street": null,
        "vat_number": null,
        "address_postcode": null,
        "billing_address_country_id": null,
        "address_street": null,
        "id": 1,
        "shipping_address_postcode": null,
        "industries": [],
        "address_country": null,
        "parent_id": null,
        "address_region": null,
        "is_employee": false,
        "default_price_level_id": null,
        "is_individual": false,
        "source": null,
        "source_details": null,
        "is_customer": false,
        "billing_contact_person": null,
        "billing_address_locality": null,
        "is_partner": false,
        "email": null,
        "initial_contact_id": null,
        "shipping_contact_person": null,
        "fax": null,
        "account_type": null,
        "description": null,
        "tags": 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
            },
            "id": 1,
            "currency": {
                "html_code": null,
                "symbol": "\u00a3",
                "code": "GBP",
                "name": "British Pound Sterling",
                "is_base": true
            },
            "bank_details": null,
            "currency_code": "GBP",
            "account_id": null
        },
        "billing_address_unit": null,
        "partner_type": null,
        "address_town": null,
        "billing_address_postcode": null,
        "default_price_level": null,
        "billing_address_street": null,
        "shipping_address_region": null,
        "shipping_address_country_id": null,
        "is_deleted": false,
        "name": "Acme Corporation",
        "customer_since": null,
        "url": null,
        "notes": null,
        "created": "2016-11-08T11:04:41",
        "company_number": null,
        "bank_details": null,
        "mobile": null,
        "address_locality": null,
        "billing_address_region": null,
        "external_id": null,
        "is_supplier": false,
        "billing_address_town": null
    },
    "user_id": 1,
    "lead_id": null,
    "lead": null,
    "type_id": 1,
    "event_id": null,
    "subject": null,
    "start_datetime": null,
    "contact_id": null,
    "id": 4,
    "created_on": "2013-09-17T00:00:00",
    "contact": null,
    "user": {
        "first_name": "John",
        "last_name": "Smith",
        "name": "John Smith",
        "roles": [
            {
                "system_name": null,
                "company_id": null,
                "description": null,
                "name": null,
                "id": 1
            }
        ],
        "locale": null,
        "company_id": 1,
        "contact_id": null,
        "id": 1,
        "signature": null,
        "email": "[email protected]",
        "initials": null
    },
    "end_datetime": null,
    "opportunity_id": null,
    "show_on_calendar": true,
    "type": {
        "id": 1,
        "name": "My task type"
    },
    "event": null,
    "description": null
}

Getting more than one Task

GET /api/v2/crm/tasks
statuscode 200:no error
statuscode 404:does not exist
Using Python:
import json
import requests

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

print response.json
Using Curl:
curl https://YOUR-SUBDOMAIN.administrateapp.com/api/v2/crm/tasks     -k -u (login):(password)
Using PHP:
<?php
$credentials = '(username):(password)';
$url = 'https://YOUR-SUBDOMAIN.administrateapp.com/api/v2/crm/tasks';
$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;
Example response:
[
    {
        "type_id": 1,
        "contact_id": null,
        "created_on": "2013-09-17T00:00:00",
        "id": 2,
        "description": null,
        "user_id": 1,
        "lead": null,
        "event_id": null,
        "event": null,
        "subject": null,
        "type": {
            "id": 1,
            "name": "My task type"
        },
        "status": "Completed",
        "start_datetime": null,
        "account_id": 1,
        "user": {
            "first_name": "John",
            "last_name": "Smith",
            "name": "John Smith",
            "roles": [
                {
                    "system_name": null,
                    "company_id": null,
                    "description": null,
                    "name": null,
                    "id": 1
                }
            ],
            "locale": null,
            "company_id": 1,
            "contact_id": null,
            "id": 1,
            "signature": null,
            "email": "[email protected]",
            "initials": null
        },
        "opportunity": null,
        "opportunity_id": null,
        "account": {
            "shipping_address_locality": null,
            "import_id": null,
            "primary_contact_id": null,
            "tel": null,
            "address_unit": null,
            "shipping_address_town": null,
            "default_approver": 0,
            "shipping_address_unit": null,
            "no_publicity": null,
            "shipping_address_street": null,
            "vat_number": null,
            "address_postcode": null,
            "billing_address_country_id": null,
            "address_street": null,
            "id": 1,
            "shipping_address_postcode": null,
            "industries": [],
            "address_country": null,
            "parent_id": null,
            "address_region": null,
            "is_employee": false,
            "default_price_level_id": null,
            "is_individual": false,
            "source": null,
            "source_details": null,
            "is_customer": false,
            "billing_contact_person": null,
            "billing_address_locality": null,
            "is_partner": false,
            "email": null,
            "initial_contact_id": null,
            "shipping_contact_person": null,
            "fax": null,
            "account_type": null,
            "description": null,
            "tags": 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
                },
                "id": 1,
                "currency": {
                    "html_code": null,
                    "symbol": "\u00a3",
                    "code": "GBP",
                    "name": "British Pound Sterling",
                    "is_base": true
                },
                "bank_details": null,
                "currency_code": "GBP",
                "account_id": null
            },
            "billing_address_unit": null,
            "partner_type": null,
            "address_town": null,
            "billing_address_postcode": null,
            "default_price_level": null,
            "billing_address_street": null,
            "shipping_address_region": null,
            "shipping_address_country_id": null,
            "is_deleted": false,
            "name": "Acme Corporation",
            "customer_since": null,
            "url": null,
            "notes": null,
            "created": "2016-11-08T11:04:41",
            "company_number": null,
            "bank_details": null,
            "mobile": null,
            "address_locality": null,
            "billing_address_region": null,
            "external_id": null,
            "is_supplier": false,
            "billing_address_town": null
        },
        "lead_id": null,
        "show_on_calendar": true,
        "contact": null,
        "end_datetime": null
    },
    {
        "type_id": 1,
        "contact_id": null,
        "created_on": "2013-07-20T00:00:00",
        "id": 3,
        "description": null,
        "user_id": 1,
        "lead": null,
        "event_id": null,
        "event": null,
        "subject": null,
        "type": {
            "id": 1,
            "name": "My task type"
        },
        "status": "Not Started",
        "start_datetime": null,
        "account_id": 1,
        "user": {
            "first_name": "John",
            "last_name": "Smith",
            "name": "John Smith",
            "roles": [
                {
                    "system_name": null,
                    "company_id": null,
                    "description": null,
                    "name": null,
                    "id": 1
                }
            ],
            "locale": null,
            "company_id": 1,
            "contact_id": null,
            "id": 1,
            "signature": null,
            "email": "[email protected]",
            "initials": null
        },
        "opportunity": null,
        "opportunity_id": null,
        "account": {
            "shipping_address_locality": null,
            "import_id": null,
            "primary_contact_id": null,
            "tel": null,
            "address_unit": null,
            "shipping_address_town": null,
            "default_approver": 0,
            "shipping_address_unit": null,
            "no_publicity": null,
            "shipping_address_street": null,
            "vat_number": null,
            "address_postcode": null,
            "billing_address_country_id": null,
            "address_street": null,
            "id": 1,
            "shipping_address_postcode": null,
            "industries": [],
            "address_country": null,
            "parent_id": null,
            "address_region": null,
            "is_employee": false,
            "default_price_level_id": null,
            "is_individual": false,
            "source": null,
            "source_details": null,
            "is_customer": false,
            "billing_contact_person": null,
            "billing_address_locality": null,
            "is_partner": false,
            "email": null,
            "initial_contact_id": null,
            "shipping_contact_person": null,
            "fax": null,
            "account_type": null,
            "description": null,
            "tags": 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
                },
                "id": 1,
                "currency": {
                    "html_code": null,
                    "symbol": "\u00a3",
                    "code": "GBP",
                    "name": "British Pound Sterling",
                    "is_base": true
                },
                "bank_details": null,
                "currency_code": "GBP",
                "account_id": null
            },
            "billing_address_unit": null,
            "partner_type": null,
            "address_town": null,
            "billing_address_postcode": null,
            "default_price_level": null,
            "billing_address_street": null,
            "shipping_address_region": null,
            "shipping_address_country_id": null,
            "is_deleted": false,
            "name": "Acme Corporation",
            "customer_since": null,
            "url": null,
            "notes": null,
            "created": "2016-11-08T11:04:41",
            "company_number": null,
            "bank_details": null,
            "mobile": null,
            "address_locality": null,
            "billing_address_region": null,
            "external_id": null,
            "is_supplier": false,
            "billing_address_town": null
        },
        "lead_id": null,
        "show_on_calendar": true,
        "contact": null,
        "end_datetime": null
    }
]

Filtering

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

Creating Tasks

POST /api/v2/crm/tasks
Required fields:
  • status
  • user_id
  • account_id
  • type_id
statuscode 200:no error
statuscode 404:could not create
Using Python:
import json
import requests

data = {u'status': u'Completed', u'created_on': u'2013-09-17', u'user_id': 1, u'account_id': 1, u'type_id': 1}

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

print response.json
Using Curl:
curl https://YOUR-SUBDOMAIN.administrateapp.com/api/v2/crm/tasks     -H "Content-Type: application/json"     -k -u (login):(password)     -X POST     -d '{"status": "Completed", "created_on": "2013-09-17", "user_id": 1, "account_id": 1, "type_id": 1}'
Using PHP:
<?php
$credentials = '(username):(password)';
$url = 'https://YOUR-SUBDOMAIN.administrateapp.com/api/v2/crm/tasks';
$data = array("status" => u'Completed', "created_on" => u'2013-09-17', "user_id" => 1, "account_id" => 1, "type_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;
Example response:
{
    "status": "Completed",
    "account": {
        "shipping_address_locality": null,
        "import_id": null,
        "primary_contact_id": null,
        "tel": null,
        "address_unit": null,
        "shipping_address_town": null,
        "default_approver": 0,
        "shipping_address_unit": null,
        "no_publicity": null,
        "shipping_address_street": null,
        "vat_number": null,
        "address_postcode": null,
        "billing_address_country_id": null,
        "address_street": null,
        "id": 1,
        "shipping_address_postcode": null,
        "industries": [],
        "address_country": null,
        "parent_id": null,
        "address_region": null,
        "is_employee": false,
        "default_price_level_id": null,
        "is_individual": false,
        "source": null,
        "source_details": null,
        "is_customer": false,
        "billing_contact_person": null,
        "billing_address_locality": null,
        "is_partner": false,
        "email": null,
        "initial_contact_id": null,
        "shipping_contact_person": null,
        "fax": null,
        "account_type": null,
        "description": null,
        "tags": 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
            },
            "id": 1,
            "currency": {
                "html_code": null,
                "symbol": "\u00a3",
                "code": "GBP",
                "name": "British Pound Sterling",
                "is_base": true
            },
            "bank_details": null,
            "currency_code": "GBP",
            "account_id": null
        },
        "billing_address_unit": null,
        "partner_type": null,
        "address_town": null,
        "billing_address_postcode": null,
        "default_price_level": null,
        "billing_address_street": null,
        "shipping_address_region": null,
        "shipping_address_country_id": null,
        "is_deleted": false,
        "name": "Acme Corporation",
        "customer_since": null,
        "url": null,
        "notes": null,
        "created": "2016-11-08T11:04:41",
        "company_number": null,
        "bank_details": null,
        "mobile": null,
        "address_locality": null,
        "billing_address_region": null,
        "external_id": null,
        "is_supplier": false,
        "billing_address_town": null
    },
    "user_id": 1,
    "lead_id": null,
    "lead": null,
    "type_id": 1,
    "event_id": null,
    "subject": null,
    "start_datetime": null,
    "contact_id": null,
    "id": 4,
    "created_on": "2013-09-17T00:00:00",
    "contact": null,
    "user": {
        "first_name": "John",
        "last_name": "Smith",
        "name": "John Smith",
        "roles": [
            {
                "system_name": null,
                "company_id": null,
                "description": null,
                "name": null,
                "id": 1
            }
        ],
        "locale": null,
        "company_id": 1,
        "contact_id": null,
        "id": 1,
        "signature": null,
        "email": "[email protected]",
        "initials": null
    },
    "end_datetime": null,
    "opportunity_id": null,
    "show_on_calendar": true,
    "type": {
        "id": 1,
        "name": "My task type"
    },
    "event": null,
    "description": null
}

Updating Tasks

PUT /api/v2/crm/tasks/(int: id)
statuscode 200:no error
statuscode 404:does not exist
Using Python:
import json
import requests

data = {u'created_on': u'2009-01-25 14:15:16'}

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

print response.json
Using Curl:
curl https://YOUR-SUBDOMAIN.administrateapp.com/api/v2/crm/tasks/6     -H "Content-Type: application/json"     -k -u (login):(password)     -X PUT     -d '{"created_on": "2009-01-25 14:15:16"}'
Using PHP:
<?php
$credentials = '(username):(password)';
$url = 'https://YOUR-SUBDOMAIN.administrateapp.com/api/v2/crm/tasks/6';
$data = array("created_on" => u'2009-01-25 14:15:16');
$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;
Example response:
{
    "status": "Completed",
    "account": {
        "shipping_address_locality": null,
        "import_id": null,
        "primary_contact_id": null,
        "tel": null,
        "address_unit": null,
        "shipping_address_town": null,
        "default_approver": 0,
        "shipping_address_unit": null,
        "no_publicity": null,
        "shipping_address_street": null,
        "vat_number": null,
        "address_postcode": null,
        "billing_address_country_id": null,
        "address_street": null,
        "id": 1,
        "shipping_address_postcode": null,
        "industries": [],
        "address_country": null,
        "parent_id": null,
        "address_region": null,
        "is_employee": false,
        "default_price_level_id": null,
        "is_individual": false,
        "source": null,
        "source_details": null,
        "is_customer": false,
        "billing_contact_person": null,
        "billing_address_locality": null,
        "is_partner": false,
        "email": null,
        "initial_contact_id": null,
        "shipping_contact_person": null,
        "fax": null,
        "account_type": null,
        "description": null,
        "tags": 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
            },
            "id": 1,
            "currency": {
                "html_code": null,
                "symbol": "\u00a3",
                "code": "GBP",
                "name": "British Pound Sterling",
                "is_base": true
            },
            "bank_details": null,
            "currency_code": "GBP",
            "account_id": null
        },
        "billing_address_unit": null,
        "partner_type": null,
        "address_town": null,
        "billing_address_postcode": null,
        "default_price_level": null,
        "billing_address_street": null,
        "shipping_address_region": null,
        "shipping_address_country_id": null,
        "is_deleted": false,
        "name": "Acme Corporation",
        "customer_since": null,
        "url": null,
        "notes": null,
        "created": "2016-11-08T11:04:41",
        "company_number": null,
        "bank_details": null,
        "mobile": null,
        "address_locality": null,
        "billing_address_region": null,
        "external_id": null,
        "is_supplier": false,
        "billing_address_town": null
    },
    "user_id": 1,
    "lead_id": null,
    "lead": null,
    "type_id": 1,
    "event_id": null,
    "subject": null,
    "start_datetime": null,
    "contact_id": null,
    "id": 6,
    "created_on": "2009-01-25T14:15:16",
    "contact": null,
    "user": {
        "first_name": "John",
        "last_name": "Smith",
        "name": "John Smith",
        "roles": [
            {
                "system_name": null,
                "company_id": null,
                "description": null,
                "name": null,
                "id": 1
            }
        ],
        "locale": null,
        "company_id": 1,
        "contact_id": null,
        "id": 1,
        "signature": null,
        "email": "[email protected]",
        "initials": null
    },
    "end_datetime": null,
    "opportunity_id": null,
    "show_on_calendar": true,
    "type": {
        "id": 1,
        "name": "My task type"
    },
    "event": null,
    "description": null
}

Deleting Tasks

DELETE /api/v2/crm/tasks/(int: id)
statuscode 200:deleted entity successfully
statuscode 404:entity not found
Using Python:
import json
import requests

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

print response.json
Using Curl:
curl https://YOUR-SUBDOMAIN.administrateapp.com/api/v2/crm/tasks/1     -X DELETE -k -u (login):(password)
Using PHP:
<?php
$credentials = '(username):(password)';
$url = 'https://YOUR-SUBDOMAIN.administrateapp.com/api/v2/crm/tasks/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;
Example response:
{
    "status": "Completed",
    "account": {
        "shipping_address_locality": null,
        "import_id": null,
        "primary_contact_id": null,
        "tel": null,
        "address_unit": null,
        "shipping_address_town": null,
        "default_approver": 0,
        "shipping_address_unit": null,
        "no_publicity": null,
        "shipping_address_street": null,
        "vat_number": null,
        "address_postcode": null,
        "billing_address_country_id": null,
        "address_street": null,
        "id": 1,
        "shipping_address_postcode": null,
        "industries": [],
        "address_country": null,
        "parent_id": null,
        "address_region": null,
        "is_employee": false,
        "default_price_level_id": null,
        "is_individual": false,
        "source": null,
        "source_details": null,
        "is_customer": false,
        "billing_contact_person": null,
        "billing_address_locality": null,
        "is_partner": false,
        "email": null,
        "initial_contact_id": null,
        "shipping_contact_person": null,
        "fax": null,
        "account_type": null,
        "description": null,
        "tags": 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
            },
            "id": 1,
            "currency": {
                "html_code": null,
                "symbol": "\u00a3",
                "code": "GBP",
                "name": "British Pound Sterling",
                "is_base": true
            },
            "bank_details": null,
            "currency_code": "GBP",
            "account_id": null
        },
        "billing_address_unit": null,
        "partner_type": null,
        "address_town": null,
        "billing_address_postcode": null,
        "default_price_level": null,
        "billing_address_street": null,
        "shipping_address_region": null,
        "shipping_address_country_id": null,
        "is_deleted": false,
        "name": "Acme Corporation",
        "customer_since": null,
        "url": null,
        "notes": null,
        "created": "2016-11-08T11:04:41",
        "company_number": null,
        "bank_details": null,
        "mobile": null,
        "address_locality": null,
        "billing_address_region": null,
        "external_id": null,
        "is_supplier": false,
        "billing_address_town": null
    },
    "user_id": 1,
    "lead_id": null,
    "lead": null,
    "type_id": 1,
    "event_id": null,
    "subject": null,
    "start_datetime": null,
    "contact_id": null,
    "id": 1,
    "created_on": "2013-09-17T00:00:00",
    "contact": null,
    "user": {
        "first_name": "John",
        "last_name": "Smith",
        "name": "John Smith",
        "roles": [
            {
                "system_name": null,
                "company_id": null,
                "description": null,
                "name": null,
                "id": 1
            }
        ],
        "locale": null,
        "company_id": 1,
        "contact_id": null,
        "id": 1,
        "signature": null,
        "email": "[email protected]",
        "initials": null
    },
    "end_datetime": null,
    "opportunity_id": null,
    "show_on_calendar": true,
    "type": {
        "id": 1,
        "name": "My task type"
    },
    "event": null,
    "description": null
}