API Endpoints and Events
Complete technical reference for cobby's API endpoints and events. This reference is intended for developers creating custom Magento extensions based on cobby.
Version History
Starting with cobby version 1.38.1.1, many requests changed to a leaner naming scheme. Custom extensions from previous versions should check for both old and new formats.
Custom Change Notification Event
Use this event to notify cobby when your extension writes directly to Magento's database:
Event Name: cobby_handle_changes
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| entity | string | Yes | Entity type (e.g., 'product') |
| action | string | Yes | Action type (e.g., 'save') |
| ids | array | Yes | Array of entity IDs (e.g., [1,2,3]) |
| context | string | Yes | Context identifier (e.g., 'custom') |
| username | string | Yes | Username performing the action |
Example (Magento 1):
Mage::dispatchEvent('cobby_handle_changes', array(
'entity' => 'product',
'action' => 'save',
'ids' => array(1,2,3),
'context' => 'custom',
'username' => 'Bob'
));
Event Types
Import Events
Before Events (cobby_import_...._import_before)
- Triggered before import operation
- Use to manipulate data before import
After Events (cobby_import_...._import_after)
- Triggered after import operation
- Use to manipulate returned data rendered in cobby
Attribute Set
Export Attribute Sets
Magento 1: cobby_catalog_product_attribute_set.export
Magento 2: GET cobby/products/attribute/sets
Events: None
Category
Export Category Tree
Magento 1: cobby_catalog_category.export
Magento 2: GET cobby/categories
Events: None
Attributes
Attribute Info
Magento 1: cobby_catalog_product_attribute.info
Magento 2: None
Events: None
Export Attributes
Magento 1: cobby_catalog_product_attribute.export
Magento 2: GET cobby/product/attributes
Events:
| Event | Description |
|---|---|
| cobby_catalog_product_attribute_export_after | Triggered after exporting attribute. Use to change attribute type (e.g., text to dropdown) |
| cobby_catalog_product_attribute_option_export_after | Triggered for attributes with options. Use to modify or remove options |
Trigger Sequence: For attributes with options (e.g., select attributes), both events trigger after export.
Attribute Options
Export Attribute Options
Magento 1: cobby_catalog_product_attribute_option.export
Magento 2: GET cobby/product/attribute/options
Events:
| Event | Description |
|---|---|
| cobby_catalog_product_attribute_option_export_after | Use to modify or remove options |
Import Attribute Options
Magento 1: cobby_catalog_product_attribute_option.import
Magento 2: None
Events:
| Event | Description |
|---|---|
| cobby_catalog_product_attribute_option_export_after | Use to modify or remove options |
Configurable Product
Assign Configurable Product
Magento 1: cobby_catalog_product_type_configurable.assign
Magento 2: None
Events: None