Tasks

A task record holds the following information:

  • status
  • account
  • user_id
  • 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 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;

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

Example response:

{
    "status": "Completed",
    "account": {
        "shipping_address_locality": null,
        "import_id": null,
        "primary_contact_id": null,
        "tel": null,
        "address_unit": null,
        "default_approver": 0,
        "company_number": null,
        "no_publicity": null,
        "url": null,
        "shipping_address_street": null,
        "vat_number": null,
        "address_postcode": null,
        "billing_address_country_id": null,
        "address_country": null,
        "id": 1,
        "shipping_address_postcode": null,
        "industries": [],
        "address_street": null,
        "source": null,
        "address_region": null,
        "is_employee": false,
        "default_price_level_id": null,
        "is_individual": false,
        "is_supplier": false,
        "parent_id": null,
        "source_details": null,
        "notes": null,
        "billing_contact_person": null,
        "billing_address_locality": null,
        "is_partner": false,
        "email": null,
        "billing_address_region": 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
            },
            "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
        },
        "billing_address_unit": null,
        "partner_type": null,
        "default_price_level": null,
        "address_town": null,
        "billing_address_postcode": null,
        "shipping_address_town": null,
        "billing_address_street": null,
        "shipping_address_region": null,
        "shipping_address_country_id": null,
        "is_deleted": false,
        "name": "Acme Corporation",
        "customer_since": null,
        "mobile": null,
        "shipping_contact_person": null,
        "created": "2016-11-08T11:04:41",
        "shipping_address_unit": null,
        "is_customer": false,
        "address_locality": null,
        "initial_contact_id": null,
        "external_id": null,
        "bank_details": null,
        "billing_address_town": null
    },
    "user_id": 1,
    "type_id": 1,
    "event_id": null,
    "description": null,
    "start_datetime": null,
    "contact_id": null,
    "event": null,
    "created_on": "2013-09-17T00:00:00",
    "contact": null,
    "user": {
        "first_name": "John",
        "last_name": "Smith",
        "name": "John Smith",
        "roles": [
            {
                "system_name": null,
                "description": null,
                "id": 1,
                "name": null,
                "company_id": null
            }
        ],
        "locale": null,
        "company_id": 1,
        "contact_id": null,
        "email": "john@example.com",
        "signature": null,
        "id": 1,
        "initials": null
    },
    "end_datetime": null,
    "show_on_calendar": true,
    "subject": null,
    "type": {
        "id": 1,
        "name": "My task type"
    },
    "id": 4,
    "opportunity_id": null
}

Getting more than one Task

GET (/api/v2/crm/tasks()

  • statuscode 200

    no error

  • statuscode 404

    does not exist

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;

Using Python:

import json
import requests

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

print response.json

Example response:

[
    {
        "type_id": 1,
        "contact_id": null,
        "created_on": "2013-09-17T00:00:00",
        "event": null,
        "account_id": 1,
        "user_id": 1,
        "event_id": null,
        "id": 2,
        "subject": null,
        "type": {
            "id": 1,
            "name": "My task type"
        },
        "status": "Completed",
        "start_datetime": null,
        "description": null,
        "user": {
            "first_name": "John",
            "last_name": "Smith",
            "name": "John Smith",
            "roles": [
                {
                    "system_name": null,
                    "description": null,
                    "id": 1,
                    "name": null,
                    "company_id": null
                }
            ],
            "locale": null,
            "company_id": 1,
            "contact_id": null,
            "email": "john@example.com",
            "signature": null,
            "id": 1,
            "initials": null
        },
        "opportunity": null,
        "opportunity_id": null,
        "account": {
            "shipping_address_locality": null,
            "import_id": null,
            "primary_contact_id": null,
            "tel": null,
            "address_unit": null,
            "default_approver": 0,
            "company_number": null,
            "no_publicity": null,
            "url": null,
            "shipping_address_street": null,
            "vat_number": null,
            "address_postcode": null,
            "billing_address_country_id": null,
            "address_country": null,
            "id": 1,
            "shipping_address_postcode": null,
            "industries": [],
            "address_street": null,
            "source": null,
            "address_region": null,
            "is_employee": false,
            "default_price_level_id": null,
            "is_individual": false,
            "is_supplier": false,
            "parent_id": null,
            "source_details": null,
            "notes": null,
            "billing_contact_person": null,
            "billing_address_locality": null,
            "is_partner": false,
            "email": null,
            "billing_address_region": 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
                },
                "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
            },
            "billing_address_unit": null,
            "partner_type": null,
            "default_price_level": null,
            "address_town": null,
            "billing_address_postcode": null,
            "shipping_address_town": null,
            "billing_address_street": null,
            "shipping_address_region": null,
            "shipping_address_country_id": null,
            "is_deleted": false,
            "name": "Acme Corporation",
            "customer_since": null,
            "mobile": null,
            "shipping_contact_person": null,
            "created": "2016-11-08T11:04:41",
            "shipping_address_unit": null,
            "is_customer": false,
            "address_locality": null,
            "initial_contact_id": null,
            "external_id": null,
            "bank_details": null,
            "billing_address_town": null
        },
        "show_on_calendar": true,
        "contact": null,
        "end_datetime": null
    },
    {
        "type_id": 1,
        "contact_id": null,
        "created_on": "2013-07-20T00:00:00",
        "event": null,
        "account_id": 1,
        "user_id": 1,
        "event_id": null,
        "id": 3,
        "subject": null,
        "type": {
            "id": 1,
            "name": "My task type"
        },
        "status": "Not Started",
        "start_datetime": null,
        "description": null,
        "user": {
            "first_name": "John",
            "last_name": "Smith",
            "name": "John Smith",
            "roles": [
                {
                    "system_name": null,
                    "description": null,
                    "id": 1,
                    "name": null,
                    "company_id": null
                }
            ],
            "locale": null,
            "company_id": 1,
            "contact_id": null,
            "email": "john@example.com",
            "signature": null,
            "id": 1,
            "initials": null
        },
        "opportunity": null,
        "opportunity_id": null,
        "account": {
            "shipping_address_locality": null,
            "import_id": null,
            "primary_contact_id": null,
            "tel": null,
            "address_unit": null,
            "default_approver": 0,
            "company_number": null,
            "no_publicity": null,
            "url": null,
            "shipping_address_street": null,
            "vat_number": null,
            "address_postcode": null,
            "billing_address_country_id": null,
            "address_country": null,
            "id": 1,
            "shipping_address_postcode": null,
            "industries": [],
            "address_street": null,
            "source": null,
            "address_region": null,
            "is_employee": false,
            "default_price_level_id": null,
            "is_individual": false,
            "is_supplier": false,
            "parent_id": null,
            "source_details": null,
            "notes": null,
            "billing_contact_person": null,
            "billing_address_locality": null,
            "is_partner": false,
            "email": null,
            "billing_address_region": 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
                },
                "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
            },
            "billing_address_unit": null,
            "partner_type": null,
            "default_price_level": null,
            "address_town": null,
            "billing_address_postcode": null,
            "shipping_address_town": null,
            "billing_address_street": null,
            "shipping_address_region": null,
            "shipping_address_country_id": null,
            "is_deleted": false,
            "name": "Acme Corporation",
            "customer_since": null,
            "mobile": null,
            "shipping_contact_person": null,
            "created": "2016-11-08T11:04:41",
            "shipping_address_unit": null,
            "is_customer": false,
            "address_locality": null,
            "initial_contact_id": null,
            "external_id": null,
            "bank_details": null,
            "billing_address_town": 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 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;

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

Example response:

{
    "status": "Completed",
    "account": {
        "shipping_address_locality": null,
        "import_id": null,
        "primary_contact_id": null,
        "tel": null,
        "address_unit": null,
        "default_approver": 0,
        "company_number": null,
        "no_publicity": null,
        "url": null,
        "shipping_address_street": null,
        "vat_number": null,
        "address_postcode": null,
        "billing_address_country_id": null,
        "address_country": null,
        "id": 1,
        "shipping_address_postcode": null,
        "industries": [],
        "address_street": null,
        "source": null,
        "address_region": null,
        "is_employee": false,
        "default_price_level_id": null,
        "is_individual": false,
        "is_supplier": false,
        "parent_id": null,
        "source_details": null,
        "notes": null,
        "billing_contact_person": null,
        "billing_address_locality": null,
        "is_partner": false,
        "email": null,
        "billing_address_region": 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
            },
            "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
        },
        "billing_address_unit": null,
        "partner_type": null,
        "default_price_level": null,
        "address_town": null,
        "billing_address_postcode": null,
        "shipping_address_town": null,
        "billing_address_street": null,
        "shipping_address_region": null,
        "shipping_address_country_id": null,
        "is_deleted": false,
        "name": "Acme Corporation",
        "customer_since": null,
        "mobile": null,
        "shipping_contact_person": null,
        "created": "2016-11-08T11:04:41",
        "shipping_address_unit": null,
        "is_customer": false,
        "address_locality": null,
        "initial_contact_id": null,
        "external_id": null,
        "bank_details": null,
        "billing_address_town": null
    },
    "user_id": 1,
    "type_id": 1,
    "event_id": null,
    "description": null,
    "start_datetime": null,
    "contact_id": null,
    "event": null,
    "created_on": "2013-09-17T00:00:00",
    "contact": null,
    "user": {
        "first_name": "John",
        "last_name": "Smith",
        "name": "John Smith",
        "roles": [
            {
                "system_name": null,
                "description": null,
                "id": 1,
                "name": null,
                "company_id": null
            }
        ],
        "locale": null,
        "company_id": 1,
        "contact_id": null,
        "email": "john@example.com",
        "signature": null,
        "id": 1,
        "initials": null
    },
    "end_datetime": null,
    "show_on_calendar": true,
    "subject": null,
    "type": {
        "id": 1,
        "name": "My task type"
    },
    "id": 4,
    "opportunity_id": null
}

Updating Tasks

PUT (/api/v2/crm/tasks/(int: id)

  • statuscode 200

    no error

  • statuscode 404

    does not exist

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;

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

Example response:

{
    "status": "Completed",
    "account": {
        "shipping_address_locality": null,
        "import_id": null,
        "primary_contact_id": null,
        "tel": null,
        "address_unit": null,
        "default_approver": 0,
        "company_number": null,
        "no_publicity": null,
        "url": null,
        "shipping_address_street": null,
        "vat_number": null,
        "address_postcode": null,
        "billing_address_country_id": null,
        "address_country": null,
        "id": 1,
        "shipping_address_postcode": null,
        "industries": [],
        "address_street": null,
        "source": null,
        "address_region": null,
        "is_employee": false,
        "default_price_level_id": null,
        "is_individual": false,
        "is_supplier": false,
        "parent_id": null,
        "source_details": null,
        "notes": null,
        "billing_contact_person": null,
        "billing_address_locality": null,
        "is_partner": false,
        "email": null,
        "billing_address_region": 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
            },
            "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
        },
        "billing_address_unit": null,
        "partner_type": null,
        "default_price_level": null,
        "address_town": null,
        "billing_address_postcode": null,
        "shipping_address_town": null,
        "billing_address_street": null,
        "shipping_address_region": null,
        "shipping_address_country_id": null,
        "is_deleted": false,
        "name": "Acme Corporation",
        "customer_since": null,
        "mobile": null,
        "shipping_contact_person": null,
        "created": "2016-11-08T11:04:41",
        "shipping_address_unit": null,
        "is_customer": false,
        "address_locality": null,
        "initial_contact_id": null,
        "external_id": null,
        "bank_details": null,
        "billing_address_town": null
    },
    "user_id": 1,
    "type_id": 1,
    "event_id": null,
    "description": null,
    "start_datetime": null,
    "contact_id": null,
    "event": null,
    "created_on": "2009-01-25T14:15:16",
    "contact": null,
    "user": {
        "first_name": "John",
        "last_name": "Smith",
        "name": "John Smith",
        "roles": [
            {
                "system_name": null,
                "description": null,
                "id": 1,
                "name": null,
                "company_id": null
            }
        ],
        "locale": null,
        "company_id": 1,
        "contact_id": null,
        "email": "john@example.com",
        "signature": null,
        "id": 1,
        "initials": null
    },
    "end_datetime": null,
    "show_on_calendar": true,
    "subject": null,
    "type": {
        "id": 1,
        "name": "My task type"
    },
    "id": 6,
    "opportunity_id": null
}

Deleting Tasks

DELETE (/api/v2/crm/tasks/(int: id)

  • statuscode 200

    deleted entity successfully

  • statuscode 404

    entity not found

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;

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

Example response:

{
    "status": "Completed",
    "account": {
        "shipping_address_locality": null,
        "import_id": null,
        "primary_contact_id": null,
        "tel": null,
        "address_unit": null,
        "default_approver": 0,
        "company_number": null,
        "no_publicity": null,
        "url": null,
        "shipping_address_street": null,
        "vat_number": null,
        "address_postcode": null,
        "billing_address_country_id": null,
        "address_country": null,
        "id": 1,
        "shipping_address_postcode": null,
        "industries": [],
        "address_street": null,
        "source": null,
        "address_region": null,
        "is_employee": false,
        "default_price_level_id": null,
        "is_individual": false,
        "is_supplier": false,
        "parent_id": null,
        "source_details": null,
        "notes": null,
        "billing_contact_person": null,
        "billing_address_locality": null,
        "is_partner": false,
        "email": null,
        "billing_address_region": 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
            },
            "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
        },
        "billing_address_unit": null,
        "partner_type": null,
        "default_price_level": null,
        "address_town": null,
        "billing_address_postcode": null,
        "shipping_address_town": null,
        "billing_address_street": null,
        "shipping_address_region": null,
        "shipping_address_country_id": null,
        "is_deleted": false,
        "name": "Acme Corporation",
        "customer_since": null,
        "mobile": null,
        "shipping_contact_person": null,
        "created": "2016-11-08T11:04:41",
        "shipping_address_unit": null,
        "is_customer": false,
        "address_locality": null,
        "initial_contact_id": null,
        "external_id": null,
        "bank_details": null,
        "billing_address_town": null
    },
    "user_id": 1,
    "type_id": 1,
    "event_id": null,
    "description": null,
    "start_datetime": null,
    "contact_id": null,
    "event": null,
    "created_on": "2013-09-17T00:00:00",
    "contact": null,
    "user": {
        "first_name": "John",
        "last_name": "Smith",
        "name": "John Smith",
        "roles": [
            {
                "system_name": null,
                "description": null,
                "id": 1,
                "name": null,
                "company_id": null
            }
        ],
        "locale": null,
        "company_id": 1,
        "contact_id": null,
        "email": "john@example.com",
        "signature": null,
        "id": 1,
        "initials": null
    },
    "end_datetime": null,
    "show_on_calendar": true,
    "subject": null,
    "type": {
        "id": 1,
        "name": "My task type"
    },
    "id": 1,
    "opportunity_id": null
}