pixiItemGetByTags
API call for getting a list of items filtered by assigned item tags
Since pixi version: 19.09 (9.0.7.42222) Additional notes: XML structure for @TagFilter parameter:
<TagFilter>
<AND>
<TagName>Batch Number</TagName>
<TagName>Best Before Date</TagName>
<TagId>-5</TagId>
</AND>
<OR>
<TagName>Personalized Item</TagName>
</OR>
<NOT>
<TagName>SN</TagName>
</NOT>
</TagFilter>
Sample to find all items with tag discount:
<TagFilter>
<AND/>
<OR>
<TagName>discount</TagName>
</OR>
<NOT/>
</TagFilter>
PartialTagNameMatch = 1
Items with tag "discount 10" or "discount 20" are returned
Sample to find items that have multiple tags assigned to them:
<TagFilter>
<AND>
<TagName>be</TagName>
</AND>
<OR/>
<NOT/>
</TagFilter>
PartialTagNameMatch = 1
StrictANDCondition = 1
Items that have "Best Before date" and "Batch Number" are returned. Since we have the StrictANDCondition set to 1 the api call returns only items that have only those two tags assigned.
In case we set parameter StrictANDCondition to 0, then the call will also return items that have those two tags and any other tag assigned.
Sample to find items that have multiple tags assigned to them and exclude some system tags:
<TagFilter>
<AND>
<TagName>Best Before date</TagName>
<TagName>Batch Number</TagName>
</AND>
<OR/>
<NOT>
<TagName>A</TagName>
<TagName>B</TagName>
</NOT>
</TagFilter>
PartialTagNameMatch = 0
Only items that have item tag "Best Before date" and "Batch Number" are returned. But it they also have system tag "A" or "B" they are ignored.
Request
Request body
Name | Type | Required | Description |
---|---|---|---|
TagFilter | string | true | Filter operator Type: varchar(-1) Default value: Example: See Additional Information for the XML structure Available from: 19.09 (9.0.7.42222) |
StrictANDCondition | boolean | false | Switch: Only exact matches for AND condition will be shown Type: bit Default value: 0 Example: 0 or 1 Available from: 19.09 (9.0.7.42222) |
PartialTagNameMatch | boolean | false | Switch: Enables partial matching for tag name Type: bit Default value: 0 Example: 0 or 1 Available from: 19.09 (9.0.7.42222) |
Request Example
<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
<Body xmlns="">
<pixiItemGetByTags>
<TagFilter>string</TagFilter>
<PartialTagNameMatch>true</PartialTagNameMatch>
<StrictANDCondition>true</StrictANDCondition>
</pixiItemGetByTags>
</Body>
</Envelope>
Response
1. Items list
Name | Type | Description |
---|---|---|
ItemId | integer | Item Id Type: int Available from: 25.06 (25.6.0.58802) |
ItemName | string | Item name Type: varchar (120) Available from: 25.06 (25.6.0.58802) |
ItemNrInt | string | Shop item number Type: varchar (50) Available from: 25.06 (25.6.0.58802) |
Response Example
<PixiItemGetByTagsPost200TextXmlResponse>
<ItemId>0</ItemId>
<ItemNrInt>string</ItemNrInt>
<ItemName>string</ItemName>
</PixiItemGetByTagsPost200TextXmlResponse>
2. Error response
Name | Type | Description |
---|---|---|
TagId | integer | TagId found in the database Type: int Available from: 25.06 (25.6.0.58802) |
Status | string | Filter line status (OK/ERROR) Type: varchar (10) Available from: 25.06 (25.6.0.58802) |
TagName | string | TagName found in the database Type: varchar (50) Available from: 25.06 (25.6.0.58802) |
XMLTagId | string | TagId node value provided in XML Type: nvarchar Available from: 25.06 (25.6.0.58802) |
Operation | string | Filter operation (AND/OR/NOT) Type: varchar (3) Available from: 25.06 (25.6.0.58802) |
XMLTagName | string | TagName node value provided in XML Type: nvarchar Available from: 25.06 (25.6.0.58802) |
StatusMessage | string | Filter line status description Type: varchar (100) Available from: 25.06 (25.6.0.58802) |
Response Example
<PixiItemGetByTagsPost400TextXmlResponse>
<Operation>string</Operation>
<XMLTagId>string</XMLTagId>
<XMLTagName>string</XMLTagName>
<TagId>0</TagId>
<TagName>string</TagName>
<Status>string</Status>
<StatusMessage>string</StatusMessage>
</PixiItemGetByTagsPost400TextXmlResponse>
HTTP Example
POST https://apigateway.descartes.com/tms/pixi/
Content-Type: text/xml; charset=utf-8
# echo -n '{{username}}:{{password}}' | base64 | pbcopy
Authorization: Basic {{token}}
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="https://apigateway.descartes.com/tms/pixi/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns1:pixiItemGetByTags>
<TagFilter xsi:type="xsd:string">See Additional Information for the XML structure</TagFilter> <!-- required -->
<StrictANDCondition xsi:type="xsd:boolean">0 or 1</StrictANDCondition>
<PartialTagNameMatch xsi:type="xsd:boolean">0 or 1</PartialTagNameMatch>
</ns1:pixiItemGetByTags>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
PHP Example
<?php
getPixiSoapClientResponse('pixiItemGetByTags', [
'TagFilter' => 'See Additional Information for the XML structure', // string (required)
'StrictANDCondition' => '0 or 1', // boolean
'PartialTagNameMatch' => '0 or 1', // boolean
]);
function getPixiSoapClientResponse(string $method, array $arguments = [])
{
$soapArguments = [];
foreach ($arguments as $key => $value) {
$soapArguments[] = new SoapVar($value, null, '', '', $key);
}
$soapClient = new SoapClient(null, [
'login' => '...',
'password' => '...',
'uri' => 'https://apigateway.descartes.com/tms/pixi/',
'location' => 'https://apigateway.descartes.com/tms/pixi/',
]);
return $soapClient->__call($method, $soapArguments);
}