All URIs are relative to https://api.insightly.com/v3.1
Method | HTTP request | Description |
---|---|---|
addOpportunityCategory | POST /OpportunityCategories | Adds an Opportunity Category |
deleteOpportunityCategory | DELETE /OpportunityCategories/{id} | Deactivates an Opportunity Category |
getOpportunityCategories | GET /OpportunityCategories | Gets a list of Opportunity Categories |
getOpportunityCategory | GET /OpportunityCategories/{id} | Gets an Opportunity Category |
updateOpportunityCategory | PUT /OpportunityCategories | Updates an Opportunity Category |
object addOpportunityCategory($category, $authorization)
Adds an Opportunity Category
This endpoint is used to create a new opportunity category. This endpoint is only accessible to users with administrator permission.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new SternerStuff\InsightlyPHP\Api\OpportunityCategoriesApi(
// 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()
);
$category = new \SternerStuff\InsightlyPHP\Model\APICategory(); // \SternerStuff\InsightlyPHP\Model\APICategory | The Opportunity Category to add (just include JSON object as request body)
$authorization = "{{Authorization}}"; // string | Authorization
try {
$result = $apiInstance->addOpportunityCategory($category, $authorization);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling OpportunityCategoriesApi->addOpportunityCategory: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
category | \SternerStuff\InsightlyPHP\Model\APICategory | The Opportunity Category to add (just include JSON object as request body) | |
authorization | string | Authorization | [default to {{Authorization}}] |
object
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]
deleteOpportunityCategory($id, $authorization)
Deactivates an Opportunity Category
The endpoint is used to deactivate an existing opportunity category. This endpoint is only accessible to users with administrator permission.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new SternerStuff\InsightlyPHP\Api\OpportunityCategoriesApi(
// 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 | An Opportunity Category's ID
$authorization = "{{Authorization}}"; // string | Authorization
try {
$apiInstance->deleteOpportunityCategory($id, $authorization);
} catch (Exception $e) {
echo 'Exception when calling OpportunityCategoriesApi->deleteOpportunityCategory: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
id | int | An Opportunity Category'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[] getOpportunityCategories($authorization, $skip, $top, $count_total)
Gets a list of Opportunity Categories
This read only endpoint returns a list of opportunity categories set up for the Insightly instance.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new SternerStuff\InsightlyPHP\Api\OpportunityCategoriesApi(
// 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
$skip = 56; // int | Optional, number of categories to skip.
$top = 56; // int | Optional, maximum number of categories 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->getOpportunityCategories($authorization, $skip, $top, $count_total);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling OpportunityCategoriesApi->getOpportunityCategories: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
authorization | string | Authorization | [default to {{Authorization}}] |
skip | int | Optional, number of categories to skip. | [optional] |
top | int | Optional, maximum number of categories 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/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
object getOpportunityCategory($id, $authorization)
Gets an Opportunity Category
This endpoint returns the graph for a specific opportunity category
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new SternerStuff\InsightlyPHP\Api\OpportunityCategoriesApi(
// 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 | An Opportunity Category's ID
$authorization = "{{Authorization}}"; // string | Authorization
try {
$result = $apiInstance->getOpportunityCategory($id, $authorization);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling OpportunityCategoriesApi->getOpportunityCategory: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
id | int | An Opportunity Category's ID | |
authorization | string | Authorization | [default to {{Authorization}}] |
object
No authorization required
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
object updateOpportunityCategory($category, $authorization)
Updates an Opportunity Category
This endpoint is used to update an existing opportunity category (for example, to change the background color for its label in the user interace). This endpoint is only accessible to users with administrator permission.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new SternerStuff\InsightlyPHP\Api\OpportunityCategoriesApi(
// 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()
);
$category = new \SternerStuff\InsightlyPHP\Model\APICategory(); // \SternerStuff\InsightlyPHP\Model\APICategory | An Opportunity Category (just include JSON object as request body)
$authorization = "{{Authorization}}"; // string | Authorization
try {
$result = $apiInstance->updateOpportunityCategory($category, $authorization);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling OpportunityCategoriesApi->updateOpportunityCategory: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
category | \SternerStuff\InsightlyPHP\Model\APICategory | An Opportunity Category (just include JSON object as request body) | |
authorization | string | Authorization | [default to {{Authorization}}] |
object
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]