Products
The Product API lets you modify products stored in the MarketHub data store.Product details are seperated into core details and product properties. The Product API is responsible for the
data operations on the core detail only.
- Method: GET
- URL: https://madic-esl.markethubpulse.com/api/Product/Get/
The method takes a single parameter via the url. Products are filtered at a store level so the
store id needs to be passed in the last part of the url. So for example if the store is 'SampleStore'
then the url for the request would be as follows: https://madic-esl.markethubpulse.com/api/product/Get/SampleStore
Request Headers
| Header Field Name | Value |
|---|---|
| Accept | application/json or application/xml |
| Authorisation | Basic authentication with base 64 encoded credentials e.g. "Basic dGVzdHVzZXI6dGVzdHBhc3N3b3Jk". See EndPoint & Authorisation for more information. |
Once the request is successful the response will return an array/list of products. Each product will contain the following fields:
| Name | Type | Description |
|---|---|---|
| OID | GUID | The unique system id for the label in the database, |
| Name | String | The brief product name |
| Description | String | The brief description of the store |
| EanNumber | String | The unqiue barcode for this product |
| GTIN | String | The Global Type Identifier Number. This is the number which uniquely idetifies the barcode across multiple systems. Defaulted to the EanNumber if it is not specified. |
| LastUpdated | Datetime | The date and time that the product was last changed. |
| LastUpdatedBy | string | The user id of the last account to change the product. |
| IsDeleted | boolean | A flag that indicates that the product has been deleted. |
| Error | boolean | A flag indicating if an error occur during the request. |
| ErrorMessage | string | If an error has occurred then the error message will be populated in this field. |
| OID | GUID | The unique System ID of the product record. |
| StoreID | string | The unique client id of the store the product is assigned to. |
| StoreOID | GUID | The unique system id of the store the product is assigned to. |
Example Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"OID":"2bef1d02-cb3c-46ad-a745-27a27736a049",
"StoreOID":"f8bba7b2-281f-4a4f-a3fc-ae7ce5def2d7",
"ProductID":"ProdID001",
"StoreID":"DemoStore",
"Name":"Sample Product 1",
"Description":"Sample Product 1 Description",
"EANNumber":"1234567890123",
"GTIN":"1234567890123",
"LastUpdated":"2014-10-10T16:48:19.32",
"LastUpdatedBy":"sampleuser",
"IsDeleted":false,
"Error":false,
"ErrorMessage":null
},
{
"OID":"ef7cd813-258e-4706-b6c6-382d55e68a75",
"StoreOID":"f8bba7b2-281f-4a4f-a3fc-ae7ce5def2d7",
"ProductID":"ProdID002",
"StoreID":null,
"Name":"Sample Product 2",
"Description":"Sample Product 2 Description",
"EANNumber":"9876543210123",
"GTIN":"9876543210123",
"LastUpdated":"2014-11-10T14:53:33.37",
"LastUpdatedBy":"sampleuser",
"IsDeleted":false,
"Error":false,
"ErrorMessage":null
}
]
Sample Code
client.BaseAddress = new Uri("https://madic-esl.markethubpulse.com/api/");
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
HttpResponseMessage response = await client.GetAsync("Product/Get/DemoStore");
if (response.IsSuccessStatusCode)
{
string data = await response.Content.ReadAsStringAsync();
// Do something with the json data
}
else
{
// Handle the failure in here
}
- Method: GET
- URL: https://madic-esl.markethubpulse.com/api/Product/GetSingle/
The method takes a 2 parameters via the url. Product properties are filtered at a store & product level so the
store id needs to be passed in the last part of the url in addition to the product is. So for example if the store is 'SampleStore'
and the product is 'Prod001' then the url for the request would be as follows:
https://madic-esl.markethubpulse.com/api/Product/GetSingle/?StoreID=SampleID&ProductID=PROD001
If the product does not exist then a 204 status code (No Content) is return otherwise a 200 code will be returned
along with the product details as described below.
Request Headers
| Header Field Name | Value |
|---|---|
| Accept | application/json or application/xml |
| Authorisation | Basic authentication with base 64 encoded credentials e.g. "Basic dGVzdHVzZXI6dGVzdHBhc3N3b3Jk". See EndPoint & Authorisation for more information. |
Once the request is successful the response will return a single product. This product will contain the following fields:
| Name | Type | Description |
|---|---|---|
| OID | GUID | The unique system id for the label in the database, |
| Name | String | The brief product name |
| Description | String | The brief derscription of the store |
| EanNumber | String | The unqiue barcode for this product |
| GTIN | String | The Global Type Identifier Number. This is the number which uniquely idetifies the barcode across multiple systems. Defaulted to the EanNumber if it is not specified. |
| LastUpdated | Datetime | The date and time that the product was last changed. |
| LastUpdatedBy | string | The user id of the last account to change the product. |
| IsDeleted | boolean | A flag that indicates that the product has been deleted. |
| Error | boolean | A flag indicating if an error occur during the request. |
| ErrorMessage | string | If an error has occurred then the error message will be populated in this field. |
| OID | GUID | The unique System ID of the product record. |
| StoreID | string | The unique client id of the store the product is assigned to. |
| StoreOID | GUID | The unique system id of the store the product is assigned to. |
Example Response
HTTP/1.1 200 OK
Content-Type: application/json
"OID":"2bef1d02-cb3c-46ad-a745-27a27736a049",
"StoreOID":"f8bba7b2-281f-4a4f-a3fc-ae7ce5def2d7",
"ProductID":"ProdID001",
"StoreID":"DemoStore",
"Name":"Sample Product 1",
"Description":"Sample Product 1 Description",
"EANNumber":"1234567890123",
"GTIN":"1234567890123",
"LastUpdated":"2014-10-10T16:48:19.32",
"LastUpdatedBy":"sampleuser",
"IsDeleted":false,
"Error":false,
"ErrorMessage":null
}
Sample Code
client.BaseAddress = new Uri("https://madic-esl.markethubpulse.com/api/");
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
HttpResponseMessage response = await client.GetAsync("Product/GetSingle?StoreId=DemoStore&ProductId=Prod001");
if (response.IsSuccessStatusCode)
{
string data = await response.Content.ReadAsStringAsync();
// Do something with the json data
}
else
{
// Handle the failure in here
}
- Method: POST
- URL: https://madic-esl.markethubpulse.com/api/Product/Add/
The method takes a single product object and adds it to the database.
The product must at the very least have a valid product id and store id specified in order for the product to be
added to the database.
Request Headers
| Header Field Name | Value |
|---|---|
| Accept | application/json or application/xml |
| Authorisation | Basic authentication with base 64 encoded credentials e.g. "Basic dGVzdHVzZXI6dGVzdHBhc3N3b3Jk". See EndPoint & Authorisation for more information. |
Body Format
| Name | Type | Description |
|---|---|---|
| ProductID | String | The unique product id for the product within the system. |
| Name | String | The brief product name |
| Description | String | The brief derscription of the store |
| EanNumber | String | The unqiue barcode for this product |
| GTIN | String | The Global Type Identifier Number. This is the number which uniquely idetifies the barcode across multiple systems. Defaulted to the EanNumber if it is not specified. |
| StoreID | string | The unique client id of the store the product is assigned to. |
Response
| Name | Type | Description |
|---|---|---|
| ProductID | String | The unique product id for the product within the system. |
| Name | String | The brief product name |
| Description | String | The brief derscription of the store |
| EanNumber | String | The unqiue barcode for this product |
| GTIN | String | The Global Type Identifier Number. This is the number which uniquely idetifies the barcode across multiple systems. Defaulted to the EanNumber if it is not specified. |
| LastUpdated | Datetime | The date and time that the product was last changed. |
| LastUpdatedBy | string | The user id of the last account to change the product. |
| IsDeleted | boolean | A flag that indicates that the product has been deleted. |
| Error | boolean | A flag indicating if an error occur during the request. |
| ErrorMessage | string | If an error has occurred then the error message will be populated in this field. |
| OID | GUID | The unique System ID of the product record. |
| ClientID | string | The unique client id of the store the product is assigned to. |
| StoreOID | GUID | The unique system id of the store the product is assigned to. |
Example Response
HTTP/1.1 200 OK
Content-Type: application/json
"OID":"2bef1d02-cb3c-46ad-a745-27a27736a049",
"StoreOID":"f8bba7b2-281f-4a4f-a3fc-ae7ce5def2d7",
"ProductID":"ProdID001",
"StoreID":"DemoStore",
"Name":"Sample Product 1",
"Description":"Sample Product 1 Description",
"EANNumber":"1234567890123",
"GTIN":"1234567890123",
"LastUpdated":"2014-10-10T16:48:19.32",
"LastUpdatedBy":"sampleuser",
"IsDeleted":false,
"Error":false,
"ErrorMessage":null
}
Sample Code
// Sample Class Definition
public class MarketHubProduct
{
public string StoreID;
public string ProductID;
public string Name;
public string Description;
public string EanNumber;
public string GTIN;
}
// Sample Code for Product post
MarketHubProduct product = new MarketHubProduct
{
ProductID ="Prod12345",
StoreID="DemoStore",
Name="Sample Product Name",
Description="Sample Product Description",
EanNumber="1234567890123",
GTIN = "1234567890123"
};
HttpClient client = new HttpClient();
client.BaseAddress = new Uri("https://madic-esl.markethubpulse.com/api/");
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
HttpResponseMessage response = client.PostAsJsonAsync("Product/Add", product).Result;
if (response.IsSuccessStatusCode)
{
string data = await response.Content.ReadAsStringAsync();
// Do something with the reurn data. Check the Error flag.
}
else
{
// Handle the post failure.
}
- Method: POST
- URL: https://madic-esl.markethubpulse.com/api/Product/Update/
The method takes a single product object and updates it in the database.
The product must at the very least have a valid product id and store id specified in order for the product to be
added to the database. The store and product id pair must have an existing match in the database.
Request Headers
| Header Field Name | Value |
|---|---|
| Accept | application/json or application/xml |
| Authorisation | Basic authentication with base 64 encoded credentials e.g. "Basic dGVzdHVzZXI6dGVzdHBhc3N3b3Jk". See EndPoint & Authorisation for more information. |
Body Format
| Name | Type | Description |
|---|---|---|
| ProductID | String | The unique product id for the product within the system. |
| Name | String | The brief product name |
| Description | String | The brief derscription of the store |
| EanNumber | String | The unqiue barcode for this product |
| GTIN | String | The Global Type Identifier Number. This is the number which uniquely idetifies the barcode across multiple systems. Defaulted to the EanNumber if it is not specified. |
| StoreID | string | The unique client id of the store the product is assigned to. |
| IsDeleted | boolean | A flag to indicate if the product should be marked as deleted or active. |
Response
| Name | Type | Description |
|---|---|---|
| ProductID | String | The unique product id for the product within the system. |
| Name | String | The brief product name |
| Description | String | The brief derscription of the store |
| EanNumber | String | The unqiue barcode for this product |
| GTIN | String | The Global Type Identifier Number. This is the number which uniquely idetifies the barcode across multiple systems. Defaulted to the EanNumber if it is not specified. |
| LastUpdated | Datetime | The date and time that the product was last changed. |
| LastUpdatedBy | string | The user id of the last account to change the product. |
| IsDeleted | boolean | A flag that indicates that the product has been deleted. |
| Error | boolean | A flag indicating if an error occur during the request. |
| ErrorMessage | string | If an error has occurred then the error message will be populated in this field. |
| OID | GUID | The unique System ID of the product record. |
| ClientID | string | The unique client id of the store the product is assigned to. |
| StoreOID | GUID | The unique system id of the store the product is assigned to. |
Example Response
HTTP/1.1 200 OK
Content-Type: application/json
"OID":"2bef1d02-cb3c-46ad-a745-27a27736a049",
"StoreOID":"f8bba7b2-281f-4a4f-a3fc-ae7ce5def2d7",
"ProductID":"ProdID001",
"StoreID":"DemoStore",
"Name":"Sample Product 1",
"Description":"Sample Product 1 Description",
"EANNumber":"1234567890123",
"GTIN":"1234567890123",
"LastUpdated":"2014-10-10T16:48:19.32",
"LastUpdatedBy":"sampleuser",
"IsDeleted":false,
"Error":false,
"ErrorMessage":null
}
Sample Code
// Sample Class Definition
public class MarketHubProduct
{
public string StoreID;
public string ProductID;
public string Name;
public string Description;
public string EanNumber;
public string GTIN;
public boolean IsDeleted;
}
// Sample Code for Product post
MarketHubProduct product = new MarketHubProduct
{
ProductID ="Prod12345",
StoreID="DemoStore",
Name="Sample Product Name",
Description="Sample Product Description",
EanNumber="1234567890123",
GTIN = "1234567890123",
IsDeleted = false };
HttpClient client = new HttpClient();
client.BaseAddress = new Uri("https://madic-esl.markethubpulse.com/api/");
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
HttpResponseMessage response = client.PostAsJsonAsync("Product/Update", product).Result;
if (response.IsSuccessStatusCode)
{
string data = await response.Content.ReadAsStringAsync();
// Do something with the reurn data. Check the Error flag.
}
else
{
// Handle the post failure.
}
- Method: POST
- URL: https://madic-esl.markethubpulse.com/api/Product/Delete/
The method takes a single product object and deletes it database.
The delete a product, a valid product id and store id must be specified in order for the product to be
selected and deleted.
Request Headers
| Header Field Name | Value |
|---|---|
| Accept | application/json or application/xml |
| Authorisation | Basic authentication with base 64 encoded credentials e.g. "Basic dGVzdHVzZXI6dGVzdHBhc3N3b3Jk". See EndPoint & Authorisation for more information. |
Body Format
| Name | Type | Description |
|---|---|---|
| ProductID | String | The unique product id for the product within the system. |
| StoreID | string | The unique client id of the store the product is assigned to. |
Response
| Name | Type | Description |
|---|---|---|
| ProductID | String | The unique product id for the product within the system. |
| Name | String | The brief product name |
| Description | String | The brief derscription of the store |
| EanNumber | String | The unqiue barcode for this product |
| GTIN | String | The Global Type Identifier Number. This is the number which uniquely idetifies the barcode across multiple systems. Defaulted to the EanNumber if it is not specified. |
| LastUpdated | Datetime | The date and time that the product was last changed. |
| LastUpdatedBy | string | The user id of the last account to change the product. |
| IsDeleted | boolean | A flag that indicates that the product has been deleted. |
| Error | boolean | A flag indicating if an error occur during the request. |
| ErrorMessage | string | If an error has occurred then the error message will be populated in this field. |
| OID | GUID | The unique System ID of the product record. |
| ClientID | string | The unique client id of the store the product is assigned to. |
| StoreOID | GUID | The unique system id of the store the product is assigned to. |
Example Response
HTTP/1.1 200 OK
Content-Type: application/json
"OID":"2bef1d02-cb3c-46ad-a745-27a27736a049",
"StoreOID":"f8bba7b2-281f-4a4f-a3fc-ae7ce5def2d7",
"ProductID":"ProdID001",
"StoreID":"DemoStore",
"Name":"Sample Product 1",
"Description":"Sample Product 1 Description",
"EANNumber":"1234567890123",
"GTIN":"1234567890123",
"LastUpdated":"2014-10-10T16:48:19.32",
"LastUpdatedBy":"sampleuser",
"IsDeleted":true,
"Error":false,
"ErrorMessage":null
}
Sample Code
// Sample Class Definition
public class MarketHubProduct
{
public string StoreID;
public string ProductID;
}
// Sample Code for Product post
MarketHubProduct product = new MarketHubProduct
{
ProductID ="Prod12345",
StoreID="DemoStore"
};
HttpClient client = new HttpClient();
client.BaseAddress = new Uri("https://madic-esl.markethubpulse.com/api/");
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
HttpResponseMessage response = client.PostAsJsonAsync("Product/Delete", product).Result;
if (response.IsSuccessStatusCode)
{
string data = await response.Content.ReadAsStringAsync();
// Do something with the reurn data. Check the Error flag.
}
else
{
// Handle the post failure.
}
- Method: GET
- URL: https://madic-esl.markethubpulse.com/api/Product/GetLinkedToLabel/
The method takes a 2 parameters via the url. Products are filtered at a store level so the
store id needs to be passed in the last part of the url in addition to the label id. So for example if the store is 'SampleStore'
and the label id is 'B3001778' then the url for the request would be as follows:
https://madic-esl.markethubpulse.com/api/Product/GetLinkedToLabel/?StoreID=SampleID&ProductID=B3001778
If the label id does not have any linked products then a 204 status code (No Content) is return otherwise a 200 code will be returned
along with the product details as described below.
Request Headers
| Header Field Name | Value |
|---|---|
| Accept | application/json or application/xml |
| Authorisation | Basic authentication with base 64 encoded credentials e.g. "Basic dGVzdHVzZXI6dGVzdHBhc3N3b3Jk". See EndPoint & Authorisation for more information. |
Once the request is successful the response will return a single product. This product will contain the following fields:
| Name | Type | Description |
|---|---|---|
| OID | GUID | The unique system id for the label in the database, |
| Name | String | The brief product name |
| Description | String | The brief derscription of the store |
| EanNumber | String | The unqiue barcode for this product |
| GTIN | String | The Global Type Identifier Number. This is the number which uniquely idetifies the barcode across multiple systems. Defaulted to the EanNumber if it is not specified. |
| LastUpdated | Datetime | The date and time that the product was last changed. |
| LastUpdatedBy | string | The user id of the last account to change the product. |
| IsDeleted | boolean | A flag that indicates that the product has been deleted. |
| Error | boolean | A flag indicating if an error occur during the request. |
| ErrorMessage | string | If an error has occurred then the error message will be populated in this field. |
| OID | GUID | The unique System ID of the product record. |
| StoreID | string | The unique client id of the store the product is assigned to. |
| StoreOID | GUID | The unique system id of the store the product is assigned to. |
Example Response
HTTP/1.1 200 OK
Content-Type: application/json
"OID":"2bef1d02-cb3c-46ad-a745-27a27736a049",
"StoreOID":"f8bba7b2-281f-4a4f-a3fc-ae7ce5def2d7",
"ProductID":"ProdID001",
"StoreID":"DemoStore",
"Name":"Sample Product 1",
"Description":"Sample Product 1 Description",
"EANNumber":"1234567890123",
"GTIN":"1234567890123",
"LastUpdated":"2014-10-10T16:48:19.32",
"LastUpdatedBy":"sampleuser",
"IsDeleted":false,
"Error":false,
"ErrorMessage":null
}
Sample Code
client.BaseAddress = new Uri("https://madic-esl.markethubpulse.com/api/");
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
HttpResponseMessage response = await client.GetAsync("Product/GetLinkedToLabe?StoreId=DemoStore&LabelID=B3001778");
if (response.IsSuccessStatusCode)
{
string data = await response.Content.ReadAsStringAsync();
// Do something with the json data
}
else
{
// Handle the failure in here
}
- Method: GET
- URL: https://madic-esl.markethubpulse.com/api/Product/GetByProperty/
The method takes a 3 parameters via the url. Products are filtered at a store level and property details so the
store id needs to be passed in the last part of the url in addition to the property name and property value.
The property value can be a wildcard using the '%' symbol as the wildcard symbol but you will need to code it correctly
using the escape sequence '%25' if you wish to use it in a wild card search.
So for example if the store is 'SampleStore' and the property name is 'Brand' and the brand value is 'Red' then the url for the request would be as follows:
https://madic-esl.markethubpulse.com/api/Product/GetByProperty/?StoreID=SampleID&PropertyName=Brand&PropertyValue=Red
If there are no products matching the criteria then a 204 status code (No Content) is return otherwise a 200 code will be returned
along with the product details as described below.
Request Headers
| Header Field Name | Value |
|---|---|
| Accept | application/json or application/xml |
| Authorisation | Basic authentication with base 64 encoded credentials e.g. "Basic dGVzdHVzZXI6dGVzdHBhc3N3b3Jk". See EndPoint & Authorisation for more information. |
Once the request is successful the response will return a single product. This product will contain the following fields:
| Name | Type | Description |
|---|---|---|
| OID | GUID | The unique system id for the label in the database, |
| Name | String | The brief product name |
| Description | String | The brief derscription of the store |
| EanNumber | String | The unqiue barcode for this product |
| GTIN | String | The Global Type Identifier Number. This is the number which uniquely idetifies the barcode across multiple systems. Defaulted to the EanNumber if it is not specified. |
| LastUpdated | Datetime | The date and time that the product was last changed. |
| LastUpdatedBy | string | The user id of the last account to change the product. |
| IsDeleted | boolean | A flag that indicates that the product has been deleted. |
| Error | boolean | A flag indicating if an error occur during the request. |
| ErrorMessage | string | If an error has occurred then the error message will be populated in this field. |
| OID | GUID | The unique System ID of the product record. |
| StoreID | string | The unique client id of the store the product is assigned to. |
| StoreOID | GUID | The unique system id of the store the product is assigned to. |
Example Response
HTTP/1.1 200 OK
Content-Type: application/json
"OID":"2bef1d02-cb3c-46ad-a745-27a27736a049",
"StoreOID":"f8bba7b2-281f-4a4f-a3fc-ae7ce5def2d7",
"ProductID":"ProdID001",
"StoreID":"DemoStore",
"Name":"Sample Product 1",
"Description":"Sample Product 1 Description",
"EANNumber":"1234567890123",
"GTIN":"1234567890123",
"LastUpdated":"2014-10-10T16:48:19.32",
"LastUpdatedBy":"sampleuser",
"IsDeleted":false,
"Error":false,
"ErrorMessage":null
}
Sample Code
client.BaseAddress = new Uri("https://madic-esl.markethubpulse.com/api/");
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
HttpResponseMessage response = await client.GetAsync("Product/GetByProperty?StoreId=DemoStore&PropertyName=Colour&PropertyValue=Blue");
if (response.IsSuccessStatusCode)
{
string data = await response.Content.ReadAsStringAsync();
// Do something with the json data
}
else
{
// Handle the failure in here
}
- Method: GET
- URL: https://madic-esl.markethubpulse.com/api/Product/GetByEanNumber/
The method takes a 2 parameters via the url. Products are filtered at a store level and barcode so the
store id needs to be passed in the last part of the url in addition to the barcode (EanNumber).
So for example if the store is 'DemoStore' and the barcode number (EanNumber) is '123456789' then the url for the request would be as follows:
https://madic-esl.markethubpulse.com/api/Product/GetByEanNumber?StoreID=DemoStore&EanNumber=123456789
If there are no products matching the criteria then a 204 status code (No Content) is return otherwise a 200 code will be returned
along with the product details as described below.
Request Headers
| Header Field Name | Value |
|---|---|
| Accept | application/json or application/xml |
| Authorisation | Basic authentication with base 64 encoded credentials e.g. "Basic dGVzdHVzZXI6dGVzdHBhc3N3b3Jk". See EndPoint & Authorisation for more information. |
Once the request is successful the response will return a single product. This product will contain the following fields:
| Name | Type | Description |
|---|---|---|
| OID | GUID | The unique system id for the label in the database, |
| Name | String | The brief product name |
| Description | String | The brief derscription of the store |
| EanNumber | String | The unqiue barcode for this product |
| GTIN | String | The Global Type Identifier Number. This is the number which uniquely idetifies the barcode across multiple systems. Defaulted to the EanNumber if it is not specified. |
| LastUpdated | Datetime | The date and time that the product was last changed. |
| LastUpdatedBy | string | The user id of the last account to change the product. |
| IsDeleted | boolean | A flag that indicates that the product has been deleted. |
| Error | boolean | A flag indicating if an error occur during the request. |
| ErrorMessage | string | If an error has occurred then the error message will be populated in this field. |
| OID | GUID | The unique System ID of the product record. |
| StoreID | string | The unique client id of the store the product is assigned to. |
| StoreOID | GUID | The unique system id of the store the product is assigned to. |
Example Response
HTTP/1.1 200 OK
Content-Type: application/json
"OID":"2bef1d02-cb3c-46ad-a745-27a27736a049",
"StoreOID":"f8bba7b2-281f-4a4f-a3fc-ae7ce5def2d7",
"ProductID":"ProdID001",
"StoreID":"DemoStore",
"Name":"Sample Product 1",
"Description":"Sample Product 1 Description",
"EANNumber":"1234567890123",
"GTIN":"1234567890123",
"LastUpdated":"2014-10-10T16:48:19.32",
"LastUpdatedBy":"sampleuser",
"IsDeleted":false,
"Error":false,
"ErrorMessage":null
}]
Sample Code
client.BaseAddress = new Uri("https://madic-esl.markethubpulse.com/api/");
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
HttpResponseMessage response = await client.GetAsync("Product/GetByEanNumber?StoreID=DemoStore&EanNumber=123456789");
if (response.IsSuccessStatusCode)
{
string data = await response.Content.ReadAsStringAsync();
// Do something with the json data
}
else
{
// Handle the failure in here
}
- Method: GET
- URL: https://madic-esl.markethubpulse.com/api/Product/GetByGTIN/
The method takes a 2 parameters via the url. Products are filtered at a store level and GTIN so the
store id needs to be passed in the last part of the url in addition to the GTIN (Global Type Identifier Number).
So for example if the store is 'DemoStore' and the GTIN number is '123456789' then the url for the request would be as follows:
https://madic-esl.markethubpulse.com/api/Product/GetByGTIN?StoreID=DemoStore>IN=123456789
If there are no products matching the criteria then a 204 status code (No Content) is return otherwise a 200 code will be returned
along with the product details as described below.
Request Headers
| Header Field Name | Value |
|---|---|
| Accept | application/json or application/xml |
| Authorisation | Basic authentication with base 64 encoded credentials e.g. "Basic dGVzdHVzZXI6dGVzdHBhc3N3b3Jk". See EndPoint & Authorisation for more information. |
Once the request is successful the response will return a single product. This product will contain the following fields:
| Name | Type | Description |
|---|---|---|
| OID | GUID | The unique system id for the label in the database, |
| Name | String | The brief product name |
| Description | String | The brief derscription of the store |
| EanNumber | String | The unqiue barcode for this product |
| GTIN | String | The Global Type Identifier Number. This is the number which uniquely idetifies the barcode across multiple systems. Defaulted to the EanNumber if it is not specified. |
| LastUpdated | Datetime | The date and time that the product was last changed. |
| LastUpdatedBy | string | The user id of the last account to change the product. |
| IsDeleted | boolean | A flag that indicates that the product has been deleted. |
| Error | boolean | A flag indicating if an error occur during the request. |
| ErrorMessage | string | If an error has occurred then the error message will be populated in this field. |
| OID | GUID | The unique System ID of the product record. |
| StoreID | string | The unique client id of the store the product is assigned to. |
| StoreOID | GUID | The unique system id of the store the product is assigned to. |
Example Response
HTTP/1.1 200 OK
Content-Type: application/json
"OID":"2bef1d02-cb3c-46ad-a745-27a27736a049",
"StoreOID":"f8bba7b2-281f-4a4f-a3fc-ae7ce5def2d7",
"ProductID":"ProdID001",
"StoreID":"DemoStore",
"Name":"Sample Product 1",
"Description":"Sample Product 1 Description",
"EANNumber":"1234567890123",
"GTIN":"1234567890123",
"LastUpdated":"2014-10-10T16:48:19.32",
"LastUpdatedBy":"sampleuser",
"IsDeleted":false,
"Error":false,
"ErrorMessage":null
}]
Sample Code
client.BaseAddress = new Uri("https://madic-esl.markethubpulse.com/api/");
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
HttpResponseMessage response = await client.GetAsync("Product/GetByGTIN?StoreID=DemoStore>IN=123456789");
if (response.IsSuccessStatusCode)
{
string data = await response.Content.ReadAsStringAsync();
// Do something with the json data
}
else
{
// Handle the failure in here
}
