Skip to content

Latest commit

 

History

History
executable file
·
813 lines (591 loc) · 28.4 KB

NotesApi.md

File metadata and controls

executable file
·
813 lines (591 loc) · 28.4 KB

Swagger\Client\NotesApi

All URIs are relative to https://api.insightly.com/v3.0

Method HTTP request Description
addComment POST /Notes/{id}/Comments Adds a Comment to a Note
addFileAttachment POST /Notes/{id}/FileAttachments Adds a File Attachment to a Note
addFollow POST /Notes/{id}/Follow Start following a Note
addLink POST /v3.0/Notes/{id}/Links Adds a Link
deleteEntity DELETE /Notes/{id} Deletes a Note
deleteFollow DELETE /Notes/{id}/Follow Stop following a Note
deleteLink DELETE /Notes/{id}/Links/{linkId} Deletes a Link
getComments GET /Notes/{id}/Comments Gets a Note's Comments
getEntities GET /Notes Gets a list of Notes
getEntitiesBySearch GET /Notes/Search Gets a filtered list of Notes
getEntity GET /Notes/{id} Gets a Note
getFileAttachments GET /Notes/{id}/FileAttachments Gets a Note's File Attachments
getFollow GET /Notes/{id}/Follow Gets a Follow state for a Note
getLinks GET /v3.0/Notes/{id}/Links Gets a Note's Links
updateEntity PUT /Notes Updates a Note

addComment

\Swagger\Client\Model\APIComment[] addComment($id, $authorization, $field_values)

Adds a Comment to a Note

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$apiInstance = new Swagger\Client\Api\NotesApi(
    // 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
$field_values = new \Swagger\Client\Model\APIComment(); // \Swagger\Client\Model\APIComment | The record to add (just include the JSON object as the request body)

try {
    $result = $apiInstance->addComment($id, $authorization, $field_values);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling NotesApi->addComment: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
id int A Record's ID
authorization string Authorization [default to {{Authorization}}]
field_values \Swagger\Client\Model\APIComment The record to add (just include the JSON object as the request body)

Return type

\Swagger\Client\Model\APIComment[]

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]

addFileAttachment

\Swagger\Client\Model\APIFileAttachment addFileAttachment($id, $file, $authorization, $file_name, $content_type, $file_category_id)

Adds a File Attachment to a Note

This endpoint expects multipart/form-data as the request payload. See Stack Overflow for examples of how to generate multipart requests, or see our <a href="http://github.com/Insightly\" target="_blank">client libraries for an example of how this is generated. Only one file can be added per request.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$apiInstance = new Swagger\Client\Api\NotesApi(
    // 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 | Record ID
$file = "/path/to/file.txt"; // \SplFileObject | The file part of the multipart/form-data request. Only one file can be added per request.
$authorization = "{{Authorization}}"; // string | Authorization
$file_name = "file_name_example"; // string | 
$content_type = "content_type_example"; // string | 
$file_category_id = 56; // int | 

try {
    $result = $apiInstance->addFileAttachment($id, $file, $authorization, $file_name, $content_type, $file_category_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling NotesApi->addFileAttachment: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
id int Record ID
file \SplFileObject The file part of the multipart/form-data request. Only one file can be added per request.
authorization string Authorization [default to {{Authorization}}]
file_name string [optional]
content_type string [optional]
file_category_id int [optional]

Return type

\Swagger\Client\Model\APIFileAttachment

Authorization

No authorization required

HTTP request headers

  • Content-Type: multipart/form-data
  • Accept: application/json, text/json

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

addFollow

\Swagger\Client\Model\APIFollow addFollow($id, $authorization)

Start following a Note

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$apiInstance = new Swagger\Client\Api\NotesApi(
    // 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

try {
    $result = $apiInstance->addFollow($id, $authorization);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling NotesApi->addFollow: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
id int A Record's ID (RECORD_ID)
authorization string Authorization [default to {{Authorization}}]

Return type

\Swagger\Client\Model\APIFollow

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]

addLink

\Swagger\Client\Model\APILinkDto addLink($id, $authorization, $api_link)

Adds a Link

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$apiInstance = new Swagger\Client\Api\NotesApi(
    // 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 NotesApi->addLink: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

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)

Return type

\Swagger\Client\Model\APILinkDto

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($id, $authorization)

Deletes a Note

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$apiInstance = new Swagger\Client\Api\NotesApi(
    // 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 NotesApi->deleteEntity: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
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]

deleteFollow

deleteFollow($id, $authorization)

Stop following a Note

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$apiInstance = new Swagger\Client\Api\NotesApi(
    // 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

try {
    $apiInstance->deleteFollow($id, $authorization);
} catch (Exception $e) {
    echo 'Exception when calling NotesApi->deleteFollow: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
id int A Record's ID (RECORD_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]

deleteLink

deleteLink($id, $link_id, $authorization)

Deletes a Link

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$apiInstance = new Swagger\Client\Api\NotesApi(
    // 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 NotesApi->deleteLink: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

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

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]

getComments

\Swagger\Client\Model\APIComment[] getComments($id, $authorization, $updated_after_utc, $skip, $top, $count_total)

Gets a Note's Comments

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$apiInstance = new Swagger\Client\Api\NotesApi(
    // 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
$updated_after_utc = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Optional, earliest date when comment was last updated.
$skip = 56; // int | Optional, number of comments to skip.
$top = 56; // int | Optional, maximum number of comments to return in the response.
$count_total = false; // bool | true if total number of records should be returned in the response headers.

try {
    $result = $apiInstance->getComments($id, $authorization, $updated_after_utc, $skip, $top, $count_total);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling NotesApi->getComments: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
id int A Record's ID
authorization string Authorization [default to {{Authorization}}]
updated_after_utc \DateTime Optional, earliest date when comment was last updated. [optional]
skip int Optional, number of comments to skip. [optional]
top int Optional, maximum number of comments to return in the response. [optional]
count_total bool true if total number of records should be returned in the response headers. [optional] [default to false]

Return type

\Swagger\Client\Model\APIComment[]

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]

getEntities

object[] getEntities($authorization, $brief, $skip, $top, $count_total)

Gets a list of Notes

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\NotesApi(
    // 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 NotesApi->getEntities: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

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]

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($authorization, $field_name, $field_value, $brief, $skip, $top, $count_total)

Gets a filtered list of Notes

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\NotesApi(
    // 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 NotesApi->getEntitiesBySearch: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

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]

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\Note getEntity($id, $authorization)

Gets a Note

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$apiInstance = new Swagger\Client\Api\NotesApi(
    // 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 NotesApi->getEntity: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

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

Return type

\Swagger\Client\Model\Note

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]

getFileAttachments

\Swagger\Client\Model\APIFileAttachment[] getFileAttachments($id, $authorization, $updated_after_utc, $skip, $top, $count_total)

Gets a Note's File Attachments

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$apiInstance = new Swagger\Client\Api\NotesApi(
    // 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
$updated_after_utc = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Optional, earliest date when file attachment was last updated.
$skip = 56; // int | Optional, number of file attachments to skip.
$top = 56; // int | Optional, maximum number of file attachments to return in the response.
$count_total = false; // bool | true if total number of records should be returned in the response headers.

try {
    $result = $apiInstance->getFileAttachments($id, $authorization, $updated_after_utc, $skip, $top, $count_total);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling NotesApi->getFileAttachments: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
id int A Record's ID
authorization string Authorization [default to {{Authorization}}]
updated_after_utc \DateTime Optional, earliest date when file attachment was last updated. [optional]
skip int Optional, number of file attachments to skip. [optional]
top int Optional, maximum number of file attachments to return in the response. [optional]
count_total bool true if total number of records should be returned in the response headers. [optional] [default to false]

Return type

\Swagger\Client\Model\APIFileAttachment[]

Authorization

No authorization required

HTTP request headers

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

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

getFollow

\Swagger\Client\Model\APIFollow getFollow($id, $authorization)

Gets a Follow state for a Note

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$apiInstance = new Swagger\Client\Api\NotesApi(
    // 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

try {
    $result = $apiInstance->getFollow($id, $authorization);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling NotesApi->getFollow: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
id int A record's ID (RECORD_ID)
authorization string Authorization [default to {{Authorization}}]

Return type

\Swagger\Client\Model\APIFollow

Authorization

No authorization required

HTTP request headers

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

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

getLinks

\Swagger\Client\Model\APILinkDto[] getLinks($id, $authorization)

Gets a Note's Links

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$apiInstance = new Swagger\Client\Api\NotesApi(
    // 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 NotesApi->getLinks: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
id int A Record's ID
authorization string Authorization [default to {{Authorization}}]

Return type

\Swagger\Client\Model\APILinkDto[]

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\Note updateEntity($authorization, $field_values)

Updates a Note

If you have trouble updating a Note, try accessing the Note 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\NotesApi(
    // 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\Note1(); // \Swagger\Client\Model\Note1 | 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 NotesApi->updateEntity: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
authorization string Authorization [default to {{Authorization}}]
field_values \Swagger\Client\Model\Note1 The record to update (just include the JSON object as the request body)

Return type

\Swagger\Client\Model\Note

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]