External Channels Templates
This is supporting information for Listings on a Channel Integration explaining how templates are used
Jobs
External Template Processing works with Feeds, even if the actual external channel does not. If the external channel does not work with feeds (such as Bluepark), the external developer will have to provide a fake feed id when templates are being processed.
Step 1: Submitting Feed Data
When an External listing is processed, a wireup of type GENERIC_EXTERNAL_LISTING is created. The templateid will be stored in Automation_Wireup_Property and linked to the respective wireup.
When these wireups are picked up for this time, we use the templateid, to find the channelid and group the wireup submission by channelid.
For each channel, we group the templates by status.
For Creating and Updating, we use the endpoint URL_ListingUpdate with type Create and Update respectively. As part of the call, we send the data on the template as well as all the customer settings values on the configurator.
For Deleting, we use the endpoint URL_ListingDelete, which sends a list of linnworks templateids along with their activelistingids.
As the external calling has the timeout restriction, we submit a maximum of 50 listings to the external endpoint in 1 go. Using ListingUpdateBatchSize setting on the external manifest, it is possible for the external developer to set a lower value than 50, to achieve successful submissions to the actual channel without timeout error.
Both URL_ListingUpdate and URL_ListingDelete return a feed id, which we store on the template as well as table [listings].[feed].
If there are Successful template submissions a new wireup will be created of type GENERIC_EXTERNAL_FEED. The channelid will be stored in Automation_Wireup_Property and linked to the respective wireup.
Step 2: Checking if Feed is ready
Using the channelid on the wireup, we get the list of feeds associated to that channel. For each feedid we make the call to the endpoint URL_CheckFeed, to check if the feed is ready and if ready, to get the results.
If the feed is ready: We get the list of templates associated to the feedid and proceed to sort the successful and unsuccessful templates out.
Any successful templates (ones that have no errors associated to them), will have the status set to OK and will have the activelistingid and listingurl assigned to it. For variation listings, the channel reference will be assigned to the child items.
Any unsuccessful templates will still have the activelistingid and listingurl assigned (if not null) along with the provided error messages.
Both successful and unsuccessful templates will be unlocked and the feedid removed from the template. The feed id will also be removed from table [listings].[feed]
If any of the feeds are not ready: We requeue the GENERIC_EXTERNAL_FEED job
N.B. Code has been added to the WireupScanner to check for both missing GENERIC_EXTERNAL_LISTING and GENERIC_EXTERNAL_FEED wireups
Updated over 1 year ago