ProductService


Click here for a complete list of operations.

GetProductData

The main function of this Web Service. Looks up and retrieves the data for all the products that matches the GTINs sent in as an argument. The product data is placed in the same order as the GTINs are sent in (so the product information for the GTIN in gtinVec[5] is in Product-vector[5]). Remember that it´s about 48 times faster to call this method ONCE with 50 GTINs, than calling it 50 times with one GTIN in each call - so make sure to call it in baches if possible. Maximum number of GTINs in each call: 500. This method returns Product-objects that has a default set of information that satisfies most needs. If you want more information, more images in each call, or simply want to slim down each call to fit your needs exactly, see the GetCustomProductData-method. langTargetmarketLimit can be used to only request data from products with information in a certain language, thats sold in the requested country. It should be written in ISO 639.1 and ISO 3166. So sv-SE will for instance request Swedish products with information in swedish. If langTargetmarketLimit is null, a product from any country with any language might be returned

Test

The test form is only available for requests from the local machine.

SOAP 1.1

The following is a sample SOAP 1.1 request and response. The placeholders shown need to be replaced with actual values.

POST /WS/General/v181/ProductService.asmx HTTP/1.1
Host: api.opv.se
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://www.opv.se/GetProductData"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <GetProductData xmlns="http://www.opv.se/">
      <gtinVec>
        <string>string</string>
        <string>string</string>
      </gtinVec>
      <thumbFormat>Jpg or Png or Tiff or Tga or Undefined</thumbFormat>
      <thumbSize>px50 or px66 or px75 or px100 or px150 or px200 or px250 or px300 or px400 or px500 or px709 or px750 or px1000 or px1500 or px2000 or px2500 or Original or px150x150 or px500x500 or px222x222 or px265x265</thumbSize>
      <langTargetmarketLimit>string</langTargetmarketLimit>
      <secKey>string</secKey>
    </GetProductData>
  </soap:Body>
</soap:Envelope>
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <GetProductDataResponse xmlns="http://www.opv.se/">
      <GetProductDataResult>
        <Data>
          <Product>
            <SuppArtNo>string</SuppArtNo>
            <Content>string</Content>
            <Nutrition>string</Nutrition>
            <Markings xsi:nil="true" />
            <Allergies xsi:nil="true" />
            <CustomFields xsi:nil="true" />
          </Product>
          <Product>
            <SuppArtNo>string</SuppArtNo>
            <Content>string</Content>
            <Nutrition>string</Nutrition>
            <Markings xsi:nil="true" />
            <Allergies xsi:nil="true" />
            <CustomFields xsi:nil="true" />
          </Product>
        </Data>
      </GetProductDataResult>
    </GetProductDataResponse>
  </soap:Body>
</soap:Envelope>

SOAP 1.2

The following is a sample SOAP 1.2 request and response. The placeholders shown need to be replaced with actual values.

POST /WS/General/v181/ProductService.asmx HTTP/1.1
Host: api.opv.se
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <GetProductData xmlns="http://www.opv.se/">
      <gtinVec>
        <string>string</string>
        <string>string</string>
      </gtinVec>
      <thumbFormat>Jpg or Png or Tiff or Tga or Undefined</thumbFormat>
      <thumbSize>px50 or px66 or px75 or px100 or px150 or px200 or px250 or px300 or px400 or px500 or px709 or px750 or px1000 or px1500 or px2000 or px2500 or Original or px150x150 or px500x500 or px222x222 or px265x265</thumbSize>
      <langTargetmarketLimit>string</langTargetmarketLimit>
      <secKey>string</secKey>
    </GetProductData>
  </soap12:Body>
</soap12:Envelope>
HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <GetProductDataResponse xmlns="http://www.opv.se/">
      <GetProductDataResult>
        <Data>
          <Product>
            <SuppArtNo>string</SuppArtNo>
            <Content>string</Content>
            <Nutrition>string</Nutrition>
            <Markings xsi:nil="true" />
            <Allergies xsi:nil="true" />
            <CustomFields xsi:nil="true" />
          </Product>
          <Product>
            <SuppArtNo>string</SuppArtNo>
            <Content>string</Content>
            <Nutrition>string</Nutrition>
            <Markings xsi:nil="true" />
            <Allergies xsi:nil="true" />
            <CustomFields xsi:nil="true" />
          </Product>
        </Data>
      </GetProductDataResult>
    </GetProductDataResponse>
  </soap12:Body>
</soap12:Envelope>