All URIs are relative to https://api.insightly.com/v3.0
Method | HTTP request | Description |
---|---|---|
addFileAttachment | POST /Comment/{id}/FileAttachments | Adds a File Attachment to a Comment |
deleteEntity | DELETE /Comment/{id} | Deletes a Comment |
getFileAttachments | GET /Comment/{id}/FileAttachments | Gets a Comment's File Attachments |
updateEntity | PUT /Comment | Updates a Comment |
\Swagger\Client\Model\APIFileAttachment addFileAttachment($id, $file, $authorization, $file_name, $content_type, $file_category_id)
Adds a File Attachment to a Comment
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.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new Swagger\Client\Api\CommentApi(
// 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 CommentApi->addFileAttachment: ', $e->getMessage(), PHP_EOL;
}
?>
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] |
\Swagger\Client\Model\APIFileAttachment
No authorization required
- Content-Type: multipart/form-data
- Accept: application/json, text/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deleteEntity($id, $authorization)
Deletes a Comment
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new Swagger\Client\Api\CommentApi(
// 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 CommentApi->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]
\Swagger\Client\Model\APIFileAttachment[] getFileAttachments($id, $authorization, $updated_after_utc, $skip, $top, $count_total)
Gets a Comment's File Attachments
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new Swagger\Client\Api\CommentApi(
// 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 CommentApi->getFileAttachments: ', $e->getMessage(), PHP_EOL;
}
?>
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] |
\Swagger\Client\Model\APIFileAttachment[]
No authorization required
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\Swagger\Client\Model\Comment1 updateEntity($authorization, $field_values)
Updates a Comment
If you have trouble updating a Comment, try accessing the Comment 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\CommentApi(
// 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\Comment(); // \Swagger\Client\Model\Comment | 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 CommentApi->updateEntity: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
authorization | string | Authorization | [default to {{Authorization}}] |
field_values | \Swagger\Client\Model\Comment | The record to update (just include the JSON object as the request body) |
\Swagger\Client\Model\Comment1
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]