Skip to content

Latest commit

 

History

History
executable file
·
347 lines (251 loc) · 13.7 KB

CustomObjectsRecordsApi.md

File metadata and controls

executable file
·
347 lines (251 loc) · 13.7 KB

Swagger\Client\CustomObjectsRecordsApi

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

addEntity

\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.

Example

<?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;
}
?>

Parameters

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}}]

Return type

\Swagger\Client\Model\CustomObjectsRecords

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, text/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

deleteEntity

deleteEntity($object_name, $id, $authorization)

Deletes a Record

Example

<?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;
}
?>

Parameters

Name Type Description Notes
object_name string The object name
id int Entity's ID
authorization string Authorization [default to {{Authorization}}]

Return type

void (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, text/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getEntities

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.

Example

<?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;
}
?>

Parameters

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]

Return type

object[]

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/octet-stream, application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getEntitiesBySearch

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.

Example

<?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;
}
?>

Parameters

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]

Return type

object[]

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/octet-stream, application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getEntity

\Swagger\Client\Model\CustomObjectsRecords getEntity($object_name, $id, $authorization)

Gets a record

Example

<?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;
}
?>

Parameters

Name Type Description Notes
object_name string The object name
id int The record's ID
authorization string Authorization [default to {{Authorization}}]

Return type

\Swagger\Client\Model\CustomObjectsRecords

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/octet-stream, application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

updateEntity

\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.

Example

<?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;
}
?>

Parameters

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}}]

Return type

\Swagger\Client\Model\CustomObjectsRecords

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, text/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]