GET | /api/products/{id} | Get Product by Key |
---|
import java.math.*;
import java.util.*;
import net.servicestack.client.*;
public class dtos
{
public static class GetProduct
{
public String id = null;
public String getId() { return id; }
public GetProduct setId(String value) { this.id = value; return this; }
}
public static class ProductDto
{
public String id = null;
public String name = null;
public String description = null;
public String longDescription = null;
public String details = null;
public BigDecimal price = null;
public String productType = null;
public Integer year = null;
public String applicationId = null;
public String requiredProductId = null;
public String scope = null;
public String feature = null;
public Boolean isVisible = null;
public String iconUrl = null;
public HashMap<Integer,BigDecimal> volumeDiscounts = null;
public String getId() { return id; }
public ProductDto setId(String value) { this.id = value; return this; }
public String getName() { return name; }
public ProductDto setName(String value) { this.name = value; return this; }
public String getDescription() { return description; }
public ProductDto setDescription(String value) { this.description = value; return this; }
public String getLongDescription() { return longDescription; }
public ProductDto setLongDescription(String value) { this.longDescription = value; return this; }
public String getDetails() { return details; }
public ProductDto setDetails(String value) { this.details = value; return this; }
public BigDecimal getPrice() { return price; }
public ProductDto setPrice(BigDecimal value) { this.price = value; return this; }
public String getProductType() { return productType; }
public ProductDto setProductType(String value) { this.productType = value; return this; }
public Integer getYear() { return year; }
public ProductDto setYear(Integer value) { this.year = value; return this; }
public String getApplicationId() { return applicationId; }
public ProductDto setApplicationId(String value) { this.applicationId = value; return this; }
public String getRequiredProductId() { return requiredProductId; }
public ProductDto setRequiredProductId(String value) { this.requiredProductId = value; return this; }
public String getScope() { return scope; }
public ProductDto setScope(String value) { this.scope = value; return this; }
public String getFeature() { return feature; }
public ProductDto setFeature(String value) { this.feature = value; return this; }
public Boolean getIsVisible() { return isVisible; }
public ProductDto setIsVisible(Boolean value) { this.isVisible = value; return this; }
public String getIconUrl() { return iconUrl; }
public ProductDto setIconUrl(String value) { this.iconUrl = value; return this; }
public HashMap<Integer,BigDecimal> getVolumeDiscounts() { return volumeDiscounts; }
public ProductDto setVolumeDiscounts(HashMap<Integer,BigDecimal> value) { this.volumeDiscounts = value; return this; }
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /api/products/{id} HTTP/1.1 Host: accounts.dev.healthmonix.com Accept: application/xml
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <ProductDto xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Hmx.Products.ServiceModel"> <ApplicationId>String</ApplicationId> <Description>String</Description> <Details>String</Details> <Feature>String</Feature> <IconUrl>String</IconUrl> <Id>String</Id> <IsVisible>false</IsVisible> <LongDescription>String</LongDescription> <Name>String</Name> <Price>0</Price> <ProductType>String</ProductType> <RequiredProductId>String</RequiredProductId> <Scope>String</Scope> <VolumeDiscounts xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d2p1:KeyValueOfintdecimal> <d2p1:Key>0</d2p1:Key> <d2p1:Value>0</d2p1:Value> </d2p1:KeyValueOfintdecimal> </VolumeDiscounts> <Year>0</Year> </ProductDto>