All URIs are relative to https://api.insightly.com/v3.0
Method | HTTP request | Description |
---|---|---|
addEntity | POST /{objectName} | Adds a record |
deleteEntity | DELETE /{objectName}/{id} | Deletes a Record |
getEntities | GET /{objectName} | Gets a list of records |
getEntitiesBySearch | GET /{objectName}/Search | Gets a filtered list of records |
getEntity | GET /{objectName}/{id} | Gets a record |
updateEntity | PUT /{objectName} | Updates a record |
\Swagger\Client\Model\CustomObjectsRecords addEntity($object_name, $field_values, $authorization)
Adds a record
If you have trouble with creating a record, try creating records via the web interface, and then access those records via the API. This way you can see examples of the fields and sub-elements attached to the record. 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\CustomObjectsRecordsApi(
// 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()
);
$object_name = "object_name_example"; // string | The object name
$field_values = new \Swagger\Client\Model\CustomObjectsRecords2(); // \Swagger\Client\Model\CustomObjectsRecords2 | The record to add (just include the JSON object as the request body)
$authorization = "{{Authorization}}"; // string | Authorization
try {
$result = $apiInstance->addEntity($object_name, $field_values, $authorization);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling CustomObjectsRecordsApi->addEntity: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
object_name | string | The object name | |
field_values | \Swagger\Client\Model\CustomObjectsRecords2 | The record to add (just include the JSON object as the request body) | |
authorization | string | Authorization | [default to {{Authorization}}] |
\Swagger\Client\Model\CustomObjectsRecords
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($object_name, $id, $authorization)
Deletes a Record
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new Swagger\Client\Api\CustomObjectsRecordsApi(
// 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()
);
$object_name = "object_name_example"; // string | The object name
$id = 789; // int | Entity's ID
$authorization = "{{Authorization}}"; // string | Authorization
try {
$apiInstance->deleteEntity($object_name, $id, $authorization);
} catch (Exception $e) {
echo 'Exception when calling CustomObjectsRecordsApi->deleteEntity: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
object_name | string | The object name | |
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]
object[] getEntities($object_name, $authorization, $brief, $skip, $top, $count_total)
Gets a list of records
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\CustomObjectsRecordsApi(
// 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()
);
$object_name = "object_name_example"; // string | The object name
$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($object_name, $authorization, $brief, $skip, $top, $count_total);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling CustomObjectsRecordsApi->getEntities: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
object_name | string | The object name | |
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($object_name, $authorization, $field_name, $field_value, $brief, $skip, $top, $count_total)
Gets a filtered list of records
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\CustomObjectsRecordsApi(
// 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()
);
$object_name = "object_name_example"; // string | The object name
$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($object_name, $authorization, $field_name, $field_value, $brief, $skip, $top, $count_total);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling CustomObjectsRecordsApi->getEntitiesBySearch: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
object_name | string | The object name | |
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\CustomObjectsRecords getEntity($object_name, $id, $authorization)
Gets a record
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new Swagger\Client\Api\CustomObjectsRecordsApi(
// 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()
);
$object_name = "object_name_example"; // string | The object name
$id = 789; // int | The record's ID
$authorization = "{{Authorization}}"; // string | Authorization
try {
$result = $apiInstance->getEntity($object_name, $id, $authorization);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling CustomObjectsRecordsApi->getEntity: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
object_name | string | The object name | |
id | int | The record's ID | |
authorization | string | Authorization | [default to {{Authorization}}] |
\Swagger\Client\Model\CustomObjectsRecords
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\CustomObjectsRecords updateEntity($object_name, $field_values, $authorization)
Updates a record
If you have trouble updating a record, try accessing the record 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\CustomObjectsRecordsApi(
// 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()
);
$object_name = "object_name_example"; // string | The object name
$field_values = new \Swagger\Client\Model\CustomObjectsRecords1(); // \Swagger\Client\Model\CustomObjectsRecords1 | The record to update (just include the JSON object as the request body)
$authorization = "{{Authorization}}"; // string | Authorization
try {
$result = $apiInstance->updateEntity($object_name, $field_values, $authorization);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling CustomObjectsRecordsApi->updateEntity: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
object_name | string | The object name | |
field_values | \Swagger\Client\Model\CustomObjectsRecords1 | The record to update (just include the JSON object as the request body) | |
authorization | string | Authorization | [default to {{Authorization}}] |
\Swagger\Client\Model\CustomObjectsRecords
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]