The API key for the connecting user can be provided in one of the following ways:
As password of the Basic HTTP Authorization header of the request (with empty username).
As content of the user element (child of the root element) of the XML in the request. (Unless it concerns a GET request)
curl \ https://xmlagri.qcone.com/api/v1/inspections/:inspection_id/units.xml \ -X POST \ -H "Content-Type: text/xml" \ --user :api_key \ --data '<?xml version="1.0" encoding="UTF-8"?> <Message> <ContentType>text/xml</ContentType> <user>:api_key</user> <Data> <Units> <UnitLine> <Unit> <productName>Apples</productName> <varietyName>African Carmine</varietyName> <palletCode>123456</palletCode> </Unit> </UnitLine> <UnitLine> <Unit> <productName>Apples</productName> <varietyName>African Carmine</varietyName> <palletCode>123457</palletCode> <parameterValues> <parameterValue> <numericValue>12345</numericValue> <parameterId>12</parameterId> </parameterValue> <parameterValue> <stringValue>Example string value</stringValue> <parameterId>12</parameterId> </parameterValue> </parameterValues> <auditItems> <auditItem> <label>ABCD 12345</label> <value>true</value> <type>load_carrier</type> </auditItem> <auditItem> <label>10</label> <type>number_of_packages</type> </auditItem> </auditItems> </Unit> </UnitLine> </Units> </Data> </Message>'
<?xml version="1.0" encoding="UTF-8"?> <inspection> <id>160234</id> <shipperId>11951</shipperId> <consigneeId>9289</consigneeId> <principalId>9289</principalId> <shipperReference>EXAMPLE SHIPER REF</shipperReference> <consigneeReference>EXAMPLE CONSIGNEE REFERENCE</consigneeReference> <inspectionType>import</inspectionType> <instructions>Please check pallets in the back extra!</instructions> <isHighPrio>false</isHighPrio> <isWaitingForArrival>false</isWaitingForArrival> <isUnitDataEditable>true</isUnitDataEditable> <eta>2015-12-03T11:00:00Z</eta> <location/> <inspectionPoint>arrival</inspectionPoint> <details> <type>containerized</type> <vessel>SANTA ELANE</vessel> <container>SUDU 123456-7</container> </details> <created>2016-12-16T11:04:26Z</created> <units> <unit> <id>2598789</id> <productId>7</productId> <varietyId>240</varietyId> <carton/> <brand/> <productClass/> <packType/> <palletCode>123456</palletCode> <growerCode/> <countSize/> <surveyMethod>count</surveyMethod> <sampleSize/> </unit> <unit> <id>2598790</id> <productId>7</productId> <varietyId>240</varietyId> <carton/> <brand/> <productClass/> <packType/> <palletCode>123457</palletCode> <growerCode/> <countSize/> <surveyMethod>count</surveyMethod> <sampleSize/> </unit> </units> </inspection>
Param name | Description |
---|---|
user required |
API key for the connecting user Validations:
|
Units required |
Validations:
|
Units[UnitLine] optional |
Validations:
|
Units[UnitLine][Unit] optional |
Validations:
|
Units[UnitLine][Unit][productName] required |
Product name Validations:
|
Units[UnitLine][Unit][varietyName] required |
Variety name Validations:
|
Units[UnitLine][Unit][carton] optional |
Number of cartons Validations:
|
Units[UnitLine][Unit][brand] optional |
Product brand Validations:
|
Units[UnitLine][Unit][productClass] required |
Validations:
|
Units[UnitLine][Unit][packType] optional |
Pack type Validations:
|
Units[UnitLine][Unit][palletCode] optional |
Pallet code Validations:
|
Units[UnitLine][Unit][growerCode] optional |
Either GGN or GC Validations:
|
Units[UnitLine][Unit][organic] optional |
Organic: boolean or string value (e.g. 'yes' or 'no') Validations:
|
Units[UnitLine][Unit][countSize] required |
Count/size: number representing number of items in unit, or a string (e.g. 'L') when survey method manual Validations:
|
Units[UnitLine][Unit][countryOfOrigin] optional |
Country of origin Validations:
|
Units[UnitLine][Unit][packhouse] optional |
Packhouse Validations:
|
Units[UnitLine][Unit][color] optional |
Color Validations:
|
Units[UnitLine][Unit][ggn] optional |
GGN Validations:
|
Units[UnitLine][Unit][gln] optional |
GLN Validations:
|
Units[UnitLine][Unit][description] optional |
Unit description. This can be an internal article description Validations:
|
Units[UnitLine][Unit][trace] optional |
Trace / Lot Validations:
|
Units[UnitLine][Unit][orchard] optional |
Orchard Validations:
|
Units[UnitLine][Unit][carrier] optional |
Carrier Validations:
|
Units[UnitLine][Unit][additional] optional |
Additional Validations:
|
Units[UnitLine][Unit][url] optional |
URL Validations:
|
Units[UnitLine][Unit][daysOnStock] optional |
Days on stock Validations:
|
Units[UnitLine][Unit][tradingUnit] optional |
Trading unit Validations:
|
Units[UnitLine][Unit][productSpecificationId] optional |
Product Specification ID Validations:
|
Units[UnitLine][Unit][parameterValues] optional |
Parameter values: Only one value or unit ID per parameter is allowed Validations:
|
Units[UnitLine][Unit][parameterValues][parameterId] required |
Parameter ID Validations:
|
Units[UnitLine][Unit][parameterValues][numericValue] optional |
Validations:
|
Units[UnitLine][Unit][parameterValues][stringValue] optional |
Validations:
|
Units[UnitLine][Unit][parameterValues][dateValue] optional |
Format (ISO 8601): 'YYYY-MM-DD' Validations:
|
Units[UnitLine][Unit][parameterValues][itemId] optional |
Validations:
|
Units[UnitLine][Unit][auditItems] optional |
Validations:
|
Units[UnitLine][Unit][auditItems][label] required |
The label/number/code to be checked Validations:
|
Units[UnitLine][Unit][auditItems][value] optional |
Validations:
|
Units[UnitLine][Unit][auditItems][type] required |
Validations:
|