All URIs are relative to https://api.insightly.com/v3.0
Method | HTTP request | Description |
---|---|---|
addEntity | POST /Events | Adds an Event |
addLink | POST /v3.0/Events/{id}/Links | Adds a Link |
deleteEntity | DELETE /Events/{id} | Deletes an Event |
deleteLink | DELETE /Events/{id}/Links/{linkId} | Deletes a Link |
getEntities | GET /Events | Gets a list of Events |
getEntitiesBySearch | GET /Events/Search | Gets a filtered list of Events |
getEntity | GET /Events/{id} | Gets an Event |
getLinks | GET /v3.0/Events/{id}/Links | Gets an Event's Links |
updateEntity | PUT /Events | Updates an Event |
\Swagger\Client\Model\Event addEntity($authorization, $field_values)
Adds an Event
If you have trouble with creating an Event, try creating Events via the web interface, and then access those Events via the API. This way you can see examples of the fields and sub-elements attached to the Event. A common source of problems during write/update request is caused when users omit required fields, or insert invalid data in a field (e.g. reference a CATEGORY_ID that does not exist in the user's Insightly instance.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new Swagger\Client\Api\EventsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$authorization = "{{Authorization}}"; // string | Authorization
$field_values = new \Swagger\Client\Model\Event2(); // \Swagger\Client\Model\Event2 | The record to add (just include the JSON object as the request body)
try {
$result = $apiInstance->addEntity($authorization, $field_values);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling EventsApi->addEntity: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
authorization | string | Authorization | [default to {{Authorization}}] |
field_values | \Swagger\Client\Model\Event2 | The record to add (just include the JSON object as the request body) |
No authorization required
- Content-Type: application/json
- Accept: application/json, text/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\Swagger\Client\Model\APILinkDto addLink($id, $authorization, $api_link)
Adds a Link
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new Swagger\Client\Api\EventsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$id = 789; // int | A Record's ID (RECORD_ID)
$authorization = "{{Authorization}}"; // string | Authorization
$api_link = new \Swagger\Client\Model\APILinkDto(); // \Swagger\Client\Model\APILinkDto | The Link to add (just include JSON object as request body)
try {
$result = $apiInstance->addLink($id, $authorization, $api_link);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling EventsApi->addLink: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
id | int | A Record's ID (RECORD_ID) | |
authorization | string | Authorization | [default to {{Authorization}}] |
api_link | \Swagger\Client\Model\APILinkDto | The Link to add (just include JSON object as request body) |
\Swagger\Client\Model\APILinkDto
No authorization required
- Content-Type: application/json
- Accept: application/json, text/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deleteEntity($id, $authorization)
Deletes an Event
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new Swagger\Client\Api\EventsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$id = 789; // int | Entity's ID
$authorization = "{{Authorization}}"; // string | Authorization
try {
$apiInstance->deleteEntity($id, $authorization);
} catch (Exception $e) {
echo 'Exception when calling EventsApi->deleteEntity: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
id | int | Entity's ID | |
authorization | string | Authorization | [default to {{Authorization}}] |
void (empty response body)
No authorization required
- Content-Type: application/json
- Accept: application/json, text/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deleteLink($id, $link_id, $authorization)
Deletes a Link
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new Swagger\Client\Api\EventsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$id = 789; // int | A Record's ID (RECORD_ID)
$link_id = 789; // int | A Link's ID (LINK_ID)
$authorization = "{{Authorization}}"; // string | Authorization
try {
$apiInstance->deleteLink($id, $link_id, $authorization);
} catch (Exception $e) {
echo 'Exception when calling EventsApi->deleteLink: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
id | int | A Record's ID (RECORD_ID) | |
link_id | int | A Link's ID (LINK_ID) | |
authorization | string | Authorization | [default to {{Authorization}}] |
void (empty response body)
No authorization required
- Content-Type: application/json
- Accept: application/json, text/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
object[] getEntities($authorization, $brief, $skip, $top, $count_total)
Gets a list of Events
Simple object graphs (excluding LINKS, etc.) are returned if "brief=true" is used in the query string.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new Swagger\Client\Api\EventsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$authorization = "{{Authorization}}"; // string | Authorization
$brief = false; // bool | Optional, true if response should only contain top level properties of the record.
$skip = 56; // int | Optional, number of records to skip.
$top = 56; // int | Optional, maximum number of records to return in the response.
$count_total = false; // bool | Optional,true if total number of records should be returned in the response headers.
try {
$result = $apiInstance->getEntities($authorization, $brief, $skip, $top, $count_total);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling EventsApi->getEntities: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
authorization | string | Authorization | [default to {{Authorization}}] |
brief | bool | Optional, true if response should only contain top level properties of the record. | [optional] [default to false] |
skip | int | Optional, number of records to skip. | [optional] |
top | int | Optional, maximum number of records to return in the response. | [optional] |
count_total | bool | Optional,true if total number of records should be returned in the response headers. | [optional] [default to false] |
object[]
No authorization required
- Content-Type: application/json
- Accept: application/octet-stream, application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
object[] getEntitiesBySearch($authorization, $field_name, $field_value, $brief, $skip, $top, $count_total)
Gets a filtered list of Events
To filter with a field name and value, both field_name and field_value parameters must be provided.
Simple object graphs (excluding TAGS, CUSTOMFIELDS, etc.) are returned if "brief=true" is used in the query string.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new Swagger\Client\Api\EventsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$authorization = "{{Authorization}}"; // string | Authorization
$field_name = "field_name_example"; // string | Optional, field name for object
$field_value = "field_value_example"; // string | Optional, field value of the record
$brief = false; // bool | Optional, true if response should only contain top level properties of the record.
$skip = 56; // int | Optional, number of records to skip.
$top = 56; // int | Optional, maximum number of records to return in the response.
$count_total = false; // bool | Optional, true if total number of records should be returned in the response headers.
try {
$result = $apiInstance->getEntitiesBySearch($authorization, $field_name, $field_value, $brief, $skip, $top, $count_total);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling EventsApi->getEntitiesBySearch: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
authorization | string | Authorization | [default to {{Authorization}}] |
field_name | string | Optional, field name for object | [optional] |
field_value | string | Optional, field value of the record | [optional] |
brief | bool | Optional, true if response should only contain top level properties of the record. | [optional] [default to false] |
skip | int | Optional, number of records to skip. | [optional] |
top | int | Optional, maximum number of records to return in the response. | [optional] |
count_total | bool | Optional, true if total number of records should be returned in the response headers. | [optional] [default to false] |
object[]
No authorization required
- Content-Type: application/json
- Accept: application/octet-stream, application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\Swagger\Client\Model\Event getEntity($id, $authorization)
Gets an Event
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new Swagger\Client\Api\EventsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$id = 789; // int | The record's ID
$authorization = "{{Authorization}}"; // string | Authorization
try {
$result = $apiInstance->getEntity($id, $authorization);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling EventsApi->getEntity: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
id | int | The record's ID | |
authorization | string | Authorization | [default to {{Authorization}}] |
No authorization required
- Content-Type: application/json
- Accept: application/octet-stream, application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\Swagger\Client\Model\APILinkDto[] getLinks($id, $authorization)
Gets an Event's Links
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new Swagger\Client\Api\EventsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$id = 789; // int | A Record's ID
$authorization = "{{Authorization}}"; // string | Authorization
try {
$result = $apiInstance->getLinks($id, $authorization);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling EventsApi->getLinks: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
id | int | A Record's ID | |
authorization | string | Authorization | [default to {{Authorization}}] |
\Swagger\Client\Model\APILinkDto[]
No authorization required
- Content-Type: application/json
- Accept: application/octet-stream, application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\Swagger\Client\Model\Event updateEntity($authorization, $field_values)
Updates an Event
If you have trouble updating an Event, try accessing the Event via the GET request to inspect its fields and sub-elements. A common source of problems with write/update requests occurs when users either omit required fields, or insert invalid data into a field (for example, by referring a CATEGORY_ID or LINK_ID which does not exist.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new Swagger\Client\Api\EventsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$authorization = "{{Authorization}}"; // string | Authorization
$field_values = new \Swagger\Client\Model\Event1(); // \Swagger\Client\Model\Event1 | The record to update (just include the JSON object as the request body)
try {
$result = $apiInstance->updateEntity($authorization, $field_values);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling EventsApi->updateEntity: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
authorization | string | Authorization | [default to {{Authorization}}] |
field_values | \Swagger\Client\Model\Event1 | The record to update (just include the JSON object as the request body) |
No authorization required
- Content-Type: application/json
- Accept: application/json, text/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]