Skip to content

Latest commit

 

History

History
1027 lines (725 loc) · 34.3 KB

ProductsApi.md

File metadata and controls

1027 lines (725 loc) · 34.3 KB

SternerStuff\InsightlyPHP\ProductsApi

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

Method HTTP request Description
addChildEntity POST /Product/{id}/PricebookEntry Adds a Price Book Entry to a Product
addEntity POST /Product Adds a Product
addFollow POST /Product/{id}/Follow Start following a Product
deleteChildEntity DELETE /Product/{id}/PricebookEntry/{childEntityId} Deletes a Price Book Entry of a Product
deleteEntity DELETE /Product/{id} Deletes a Product
deleteFollow DELETE /Product/{id}/Follow Stop following a Product
deleteImage DELETE /Product/{id}/Image Deletes a Product's Image
deleteImageField DELETE /Product/{id}/ImageField/{fieldName} Deletes a Product's Custom Image Field
getChildEntities GET /Product/{id}/PricebookEntry Gets a list of Price Book Entries of a Product
getEntities GET /Product Gets a list of Products
getEntitiesBySearch GET /Product/Search Gets a filtered list of Products
getEntity GET /Product/{id} Gets a Product
getFollow GET /Product/{id}/Follow Gets a Follow state for a Product
getImage GET /Product/{id}/Image Gets a Product's Image
getImageField GET /Product/{id}/ImageField/{fieldName} Gets a Product's Custom Image Field
updateChildEntity PUT /Product/{id}/PricebookEntry Updates a Price Book Entry of a Product
updateEntity PUT /Product Updates a Product
updateImage PUT /Product/{id}/Image/{filename} Updates a Product's Image
updateImageField PUT /Product/{id}/ImageField/{fieldName}/{fileName} Updates a Product's Custom Image Field

addChildEntity

object[] addChildEntity($id, $authorization, $api_child_entity)

Adds a Price Book Entry to a Product

Example

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

$apiInstance = new SternerStuff\InsightlyPHP\Api\ProductsApi(
    // 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
$api_child_entity = new \SternerStuff\InsightlyPHP\Model\APIPricebookEntry(); // \SternerStuff\InsightlyPHP\Model\APIPricebookEntry | The child entity to add (just include JSON object as request body)

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

Parameters

Name Type Description Notes
id int A Record's ID
authorization string Authorization [default to {{Authorization}}]
api_child_entity \SternerStuff\InsightlyPHP\Model\APIPricebookEntry The child entity to add (just include JSON object as request body)

Return type

object[]

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]

addEntity

object addEntity($authorization, $field_values)

Adds a Product

If you have trouble with creating a Product, try creating Products via the web interface, and then access those Products via the API. This way you can see examples of the fields and sub-elements attached to the Product. 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 SternerStuff\InsightlyPHP\Api\ProductsApi(
    // 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 \SternerStuff\InsightlyPHP\Model\\SternerStuff\InsightlyPHP\Model\FieldValues(); // \SternerStuff\InsightlyPHP\Model\FieldValues | The record to add (just include the JSON object as the request body)

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

Parameters

Name Type Description Notes
authorization string Authorization [default to {{Authorization}}]
field_values \SternerStuff\InsightlyPHP\Model\FieldValues The record to add (just include the JSON object as the request body)

Return type

object

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]

addFollow

\SternerStuff\InsightlyPHP\Model\APIFollow addFollow($id, $authorization)

Start following a Product

Example

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

$apiInstance = new SternerStuff\InsightlyPHP\Api\ProductsApi(
    // 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 ProductsApi->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

\SternerStuff\InsightlyPHP\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]

deleteChildEntity

deleteChildEntity($id, $child_entity_id, $authorization)

Deletes a Price Book Entry of a Product

Example

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

$apiInstance = new SternerStuff\InsightlyPHP\Api\ProductsApi(
    // 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
$child_entity_id = 789; // int | A child entity's ID
$authorization = "{{Authorization}}"; // string | Authorization

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

Parameters

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

deleteEntity

deleteEntity($id, $authorization)

Deletes a Product

Example

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

$apiInstance = new SternerStuff\InsightlyPHP\Api\ProductsApi(
    // 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 ProductsApi->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 Product

Example

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

$apiInstance = new SternerStuff\InsightlyPHP\Api\ProductsApi(
    // 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 ProductsApi->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]

deleteImage

deleteImage($id, $authorization)

Deletes a Product's Image

Example

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

$apiInstance = new SternerStuff\InsightlyPHP\Api\ProductsApi(
    // 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 {
    $apiInstance->deleteImage($id, $authorization);
} catch (Exception $e) {
    echo 'Exception when calling ProductsApi->deleteImage: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

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

deleteImageField

deleteImageField($id, $field_name, $authorization)

Deletes a Product's Custom Image Field

Example

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

$apiInstance = new SternerStuff\InsightlyPHP\Api\ProductsApi(
    // 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
$field_name = "field_name_example"; // string | An image field name
$authorization = "{{Authorization}}"; // string | Authorization

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

Parameters

Name Type Description Notes
id int A Record's ID
field_name string An image field name
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]

getChildEntities

object[] getChildEntities($id, $authorization)

Gets a list of Price Book Entries of a Product

Example

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

$apiInstance = new SternerStuff\InsightlyPHP\Api\ProductsApi(
    // 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->getChildEntities($id, $authorization);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ProductsApi->getChildEntities: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

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

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]

getEntities

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

Gets a list of Products

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 SternerStuff\InsightlyPHP\Api\ProductsApi(
    // 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 ProductsApi->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, $updated_after_utc, $brief, $skip, $top, $count_total)

Gets a filtered list of Products

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 SternerStuff\InsightlyPHP\Api\ProductsApi(
    // 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
$updated_after_utc = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Optional, earliest date when a record was last updated.
$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, $updated_after_utc, $brief, $skip, $top, $count_total);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ProductsApi->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]
updated_after_utc \DateTime Optional, earliest date when a record was last updated. [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

object getEntity($id, $authorization)

Gets a Product

Example

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

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

Parameters

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

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]

getFollow

\SternerStuff\InsightlyPHP\Model\APIFollow getFollow($id, $authorization)

Gets a Follow state for a Product

Example

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

$apiInstance = new SternerStuff\InsightlyPHP\Api\ProductsApi(
    // 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 ProductsApi->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

\SternerStuff\InsightlyPHP\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]

getImage

getImage($id, $authorization)

Gets a Product's Image

Example

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

$apiInstance = new SternerStuff\InsightlyPHP\Api\ProductsApi(
    // 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 {
    $apiInstance->getImage($id, $authorization);
} catch (Exception $e) {
    echo 'Exception when calling ProductsApi->getImage: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
id int A Record'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/octet-stream, application/json

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

getImageField

getImageField($id, $field_name, $authorization)

Gets a Product's Custom Image Field

Example

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

$apiInstance = new SternerStuff\InsightlyPHP\Api\ProductsApi(
    // 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
$field_name = "field_name_example"; // string | An image field name
$authorization = "{{Authorization}}"; // string | Authorization

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

Parameters

Name Type Description Notes
id int A Record's ID
field_name string An image field name
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/octet-stream, application/json

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

updateChildEntity

object[] updateChildEntity($id, $authorization, $api_child_entity)

Updates a Price Book Entry of a Product

Example

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

$apiInstance = new SternerStuff\InsightlyPHP\Api\ProductsApi(
    // 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
$api_child_entity = new \SternerStuff\InsightlyPHP\Model\APIPricebookEntry(); // \SternerStuff\InsightlyPHP\Model\APIPricebookEntry | The child entity to add (just include the JSON object as request body)

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

Parameters

Name Type Description Notes
id int A Record's ID
authorization string Authorization [default to {{Authorization}}]
api_child_entity \SternerStuff\InsightlyPHP\Model\APIPricebookEntry The child entity to add (just include the JSON object as request body)

Return type

object[]

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]

updateEntity

object updateEntity($authorization, $field_values)

Updates a Product

If you have trouble updating a Product, try accessing the Product 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 SternerStuff\InsightlyPHP\Api\ProductsApi(
    // 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 \SternerStuff\InsightlyPHP\Model\\SternerStuff\InsightlyPHP\Model\FieldValues(); // \SternerStuff\InsightlyPHP\Model\FieldValues | 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 ProductsApi->updateEntity: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

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

Return type

object

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]

updateImage

object[] updateImage($id, $filename, $authorization, $file)

Updates a Product's Image

This action will replace any existing Image attached to the Product. The contents of the image data should be sent as binary data in the request payload. See our <a href="http://github.com/Insightly\" target="_blank">client libraries for an example of how this is done.

Example

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

$apiInstance = new SternerStuff\InsightlyPHP\Api\ProductsApi(
    // 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
$filename = "filename_example"; // string | Name of Image File to be attached to Record
$authorization = "{{Authorization}}"; // string | Authorization
$file = "B"; // string | File to upload

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

Parameters

Name Type Description Notes
id int A Record's ID
filename string Name of Image File to be attached to Record
authorization string Authorization [default to {{Authorization}}]
file string File to upload

Return type

object[]

Authorization

No authorization required

HTTP request headers

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

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

updateImageField

object[] updateImageField($id, $field_name, $file_name, $authorization, $file)

Updates a Product's Custom Image Field

This action will replace any existing Image attached to the Product's image field. The contents of the image data should be sent as binary data in the request payload. See our <a href="http://github.com/Insightly\" target="_blank">client libraries for an example of how this is done.

Example

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

$apiInstance = new SternerStuff\InsightlyPHP\Api\ProductsApi(
    // 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
$field_name = "field_name_example"; // string | An image field name
$file_name = "file_name_example"; // string | An image file name
$authorization = "{{Authorization}}"; // string | Authorization
$file = "B"; // string | File to upload

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

Parameters

Name Type Description Notes
id int A Record's ID
field_name string An image field name
file_name string An image file name
authorization string Authorization [default to {{Authorization}}]
file string File to upload

Return type

object[]

Authorization

No authorization required

HTTP request headers

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

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