Course material
This is the material for the Developing with PIM course. Please make sure you have attended the Using PIM course and/or read the PIM concept article and PIM developer overview article
SDK
The NuGet package (Bizzkit.Sdk.Pim
) is an automated swagger client that includes a factory client for easy authentication. See Swagger UI for reference.
API
The Bizzkit PIM API contains methods related to products, hierarchies, attributes, etc.
- AttributeGroups
- AttributeOrders
- Attributes
- Brands
- Channels
- ExternalBulkOperations
- GlobalLists
- Markets
- ProductCategories
- ProductHierarchies
- Products
- ResolvedViews
- Segmentations
- Tasks
- TranslationCultures
and is more or less self-explanatory.
Frontend views
A frontend view is a simplified view of some PIM entity that is intended for consumption in an external system such as a website frontend. By simplified we mean flattened and resolved such that a view contains information that is targeted to one specific segmentation.
PIM has the following views:
- Published product views
- Product hierarchy views
- Attribute views
- Attribute predefined values views
- Brand views
- Attribute group views
- Global list views
Use the Swagger UI or VS to get an overview of the request- and response models.
Lifecycle of views
First and foremost frontend views for some entity only exist for a specific segmentation if the segmentation has its Auto publish to frontend flag set to true. This also means that if the flag is disabled, all views related to that segmentation will be deleted. So, under the assumption that the flag is enabled, then views are created, updated and deleted automatically due to internal events inside PIM.
In general there’s no need to manually manage or rebuild views, however PIM does allow rebuilding the views on demand if this is required for some reason. That is done in the UI under Administration → Frontend Models.
Managing views
The managing of views happens in a recurring job in PIM job runner Hangfire. The name of the job is WatchAllGeneratedViewsAndModels and it creates, updates, and deletes a batch of views each time it runs. If there’s still work left to do, it enqueues itself immediately to run again and build another batch. This goes on until all views are built. After that it runs at a lower frequency until it detects work to be done again, and it all starts over.
Importing and exporting
PIM has the ability to import and export products, brands, global lists, product hierarchies, attributes, etc., from a csv-format. See CSV specification for a general reference.
API
The PIM API consists of several methods related to importing and exporting data - like
- Attributes/Import
- Brands/Import
- Global lists/import
- Product hierarchies/import
- Products import
- Products export
Response
An API call to import related methods will return a JSON response with information about the task and a result URL - like:
You can use the GetStatus and GetResult methods to get the status of the import. See Swagger UI for more information about methods and models.
Webhooks
Internally in PIM domain events are being raised when product catalog items and other entities are created, updated, deleted, etc. A subset of these events can be subscribed to from external applications via Webhooks.
In order to subscribe to events, you have to register one or more webhook URLs in PIM. This is done either via the API or in the UI under Administration → Webhooks. The secret must be a string of at least 16 characters. It’s the value for the IssuerSigningKey of a JWT token. The same value should be used on the receiving end of the webhook.
If you prefer using the API instead of the UI that’s possible in the domain-events resource. Use the PUT operation. URL and secret previously mentioned are specified in the request body.
Payload
PIM will send a request to the web hook in a simple format (see also UI):
External bulk operations
External bulk operations are an extension point in PIM, enabling you to perform custom operations or jobs on the product catalog which are run on the customer solution side. External bulk operations are triggered the same way as the built-in bulk operations already provided by PIM. This feature thus enables you to develop your own third-party integrations, when your specific needs are not covered by the built-in bulk operations.
You can set up an external bulk operation in Settings → External Bulk Operations and execute an operation through Products → Operations.
Payload
When calling your customer solution, PIM makes a POST request with a JSON body according to the following specification:
The fields of this body are used as:
operationName
is the unique system name of the external bulk operation and is used to distinguish external bulk operations from one another when sharing a customer solution URL.productUniqueNames
is an array of the unique names of the products that were matched by the product catalog filter when triggering the external bulk operation from the dashboard.
Securing request
When creating an external bulk operation, a symmetric secret is generated for you and presented to you only once. This secret should be known only to PIM and the customer solution. After creation, there is no way to view the secret again via the dashboard or the public API. The secret is encrypted and sent to the customer solution in the HTTP headers on every request.
UI extension frame sets
In PIM you can extend the UI through Extensions Frame Sets. It provides a way to call an external URL with parameters, and display the result internally or externally.
You can extend the UI in the main tab
A click on the extension button with call a page (or several pages) with information about dimensions, segmentation, user ID, etc.
You can also extend the UI in the product tab
The link under the Product Administration will call a page (or several pages) with information about dimensions, segmentation, product ID, unique name, user ID, etc.
Examples
Based on the Getting-started console application here is a few examples in a helper class you can add to a project as PimHelper.cs
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 |
|