Match Category

Description

The match category method for the Product API provides an API frontend that enables the retrieval of a list of Twenga categories.

A category is the division in which the product offer is classified because it shares common characteristics with the other offers included in this category. Example with these different lamp categories: Bedside lamp, Desk lamp, Clip lamp, etc.

Use the Match Category to retrieve the category_id you need, i.e the Twenga internal category references that you can then re exploit to refine your Search Offer calls.

API Call

In order to use the Match Category method, you need to:

A Match Category call with the primary parameter category_id filled in can be used to consult the detailed information of a particular category. If other primary parameters are filled in in the same Match Category call, they will be ignored.

The list of all parameters for the Match Category Method is the following one:

Parameter Mandatory Description
cack Yes This parameter, used internally for tracking and control, is provided by your account manager or the affinitAD support team. To receive it, please contact us.
e Yes This parameter, used internally for tracking and control, is provided by your account manager or the affinitAD support team. To receive it, please contact us.
confkey Yes Your configuration key. This parameter, used internally for tracking and control, is provided by your account manager or the affinitAD support team. To receive it, please contact us.
keyword Primary Keyword usedto search categories (LED TV, Women's blazers, Men's bootcut jeans, ...)
category_id[] Primary Twenga internal reference for the categories needed, separated by commas. If other primary parameters are filled in in the same Match Category call, they will be ignored.
nb_results No Number of categories you would like to receive. The default number is 10 and the maximum number is 50. If you set a value that is higher than 50, you’ll get 50 results.
min_offers No Minimum number of offers per category in results. Example: you want only categories where at least 2 offers exist (2 sales proposals to buy the items in this category). In that case, set min_offers to 2.

API Call Samples

GET : Querying the match category service for keyword ‘iPAD’
http://api.wtpn.twenga.co.uk/v2/match/category?[...]&nb_results=1

GET : Querying the match category service for keyword ‘iPAD’
http://api.wtpn.twenga.co.uk/v2/match/category?[...]&nb_results=1

JSON XML

{
	"code": 200,
	"infos": {
		"nb_tw_objects": 1
	},
	"tw_objects": [
		{
			"nb_results": 1,
			"confkey": "4fad3d414ce4c",
			"results": [
				{
					"name": "Apple computers & accessories",
					"category_id": 73963,
					"twenga_url": null,
					"match_url": "http://demo.wtpn.twenga.co.uk/v2/match/category?cack=91b442b514c51f66f5e96bd37a51a60c31f1b5eb&e=eyJrIjoiNGU2ZTkxNDczYzUyOCIsImMiOiIxIiwibCI6IjE1IiwibyI6Impzb24ifQ%3D%3D&confkey=4fad3d414ce4c&category_id=73963"
				}
			]
		}
	]
}

<?xml version="1.0" encoding="UTF-8"?>
<root>
   <code>200</code>
   <infos>
      <nb_tw_objects>1</nb_tw_objects>
   </infos>
   <tw_objects>
      <tw_object>
         <nb_results>1</nb_results>
         <confkey>523ff8804d3fc</confkey>
         <results>
            <result>
               <name>Ordinateurs Apple</name>
               <category_id>73963</category_id>
               <twenga_url>http://www.twenga.fr/#&p=73963&u=p</twenga_url>
               <match_url>http://demo.wtpn.twenga.fr/v2.1/match/category?cack=0f5e99fbeda053923a945d5a0be7619fc6652176&e=eyJrIjoiNGU2ZTkxNDczYzUyOCIsImMiOiI1IiwibCI6IjE1IiwibyI6InhtbCJ9&confkey=523ff8804d3fc&category_id=73963</match_url>
            </result>
         </results>
      </tw_object>
   </tw_objects>
</root>

GET : Querying the match category service for category_id of Hi-Fi
http://api.wtpn.twenga.co.uk/v2/match/category?[...]&category_id=214

Output format

The output format is set by the affinitAD support team based on the contract and technical implementation requirements.
The default output format is json. The xml format is also available: should you require this, please send us a request (use the email indicated in the "Assistance" section or contact your account manager).

Generic parameters

The code parameter is the first parameter to check.
Its possible values are :

  • 200: OK, data sent: if offers are found for your call, they are displayed. If no offers are found, 0 offers are returned.
  • 503: NOK, an error occurred: a specific error code is displayed in that case.

Retrieving a list of categories

The infos parameter contains a list of information such as:

  • nb_tw_objects: this is the number of containers for results: always one. Even if 0 offers are returned, there will be a tw_object.
  • tw_objects: It is the main results container.
  • nb_results: the number of brands sent Check this to verify that there is at least one brand.
  • confkey: Your configuration key. This parameter, used internally for tracking and control, is provided by your account manager or the affinitAD support team. To receive it, please contact us.
  • results: the list of brands sent. Its format is defined below.

The output has one single part:

  • a. Global item information

a. Global information

The current version is 2.1.0. The following fields are always available for a category.

Some are available for all versions, others not: please check the column Starting from version.

Fields Starting from version Description
category_id 1 Twenga internal category reference.
name 1 Category name. Examples: Bedside lamp, Desk lamp, Clip lamp, etc.
match_url 1 Match url to retrieve information on this particular category
twenga_url 1 Link to the category inside Twenga’s website
search_url 2.1 Search URL to retrieve directly the list of offers based on the category provided by the Match Category