Skip to content

Migrating from v1 ​

This page lists what changes when you move an integration from the Legacy API (v1) to the Platform API (v2). It is for developers who maintain a v1 integration. Most of the page covers the download endpoint. The last section maps the v1 integration actions to their v2 endpoints.

In samples, API_KEY stands for your v1 API key and API_TOKEN stands for your v2 API token.

What Changes for Downloads ​

The v1 /api/download endpoint matches the v2 Download Declarations module. The following table lists each change:

ItemLegacy API (v1)Platform API (v2)
Base URLhttps://www.bomcheck.net/apihttps://api.bomcheck.com/v2 on the Production Site, https://api.demo.bomcheck.com/v2 on the Demo Site
AuthorizationAn apikey parameter in the request bodyA Bearer token in the Authorization header
Request methodPOST only, with form dataGET with a query string, or POST with a JSON body
formatXML or CSV. XML returned IPC-1752B.1752A, 1752B or CSV
formatClassC, D or checkDthenC. Required for XML.No change. Required unless format is CSV.
supplierOne or more DUNS numbers, separated by commasOne nine-digit DUNS number
partNumbersOne string, with each part number in double quotes and separated by commasAn array of up to 500 part numbers. Each part number can have up to 50 characters.
startdateA date in YYYY-MM-DD formatRenamed to startDate. The format does not change.
Required filterNone. With no filter, v1 returned every declaration you could access.supplier, partNumbers, or both

For the full parameter list and the responses, see Download Declarations.

Base URL ​

Each site has its own API base URL and its own API tokens. A token from the Demo Site does not work on the Production Site. For the API base URLs, see Getting Started.

Authorization ​

v1 used an API key, sent as the apikey parameter. v2 uses an API token, sent in the Authorization header of each request:

http
Authorization: Bearer API_TOKEN

You create API tokens in your BOMcheck account. See Create an API Token.

Request Method ​

v2 accepts two request methods for /download:

  • GET, with the parameters in the query string.
  • POST, with the same parameters as a JSON body.

Both methods return the same result. Use POST when your list of partNumbers is too long for a URL.

Parameters ​

To move your parameters to v2:

  1. Change format from XML to 1752B to get the same files as v1. To get IPC-1752A files, use 1752A.
  2. Send one request for each supplier. v2 accepts only one DUNS number in supplier.
  3. Send partNumbers as an array. In a query string, repeat the parameter: partNumbers[]=ABC123&partNumbers[]=DEF456. In a JSON body, use a JSON array: ["ABC123", "DEF456"].
  4. Split lists of more than 500 part numbers into several requests.
  5. Rename startdate to startDate.
  6. Send supplier, partNumbers, or both. v2 does not download all declarations in one request.

Compare a Request ​

The following samples download Class D declarations, with Class C as the fallback, for two parts from one supplier:

bash
curl "https://www.bomcheck.net/api/download/" \
  --data-urlencode "apikey=API_KEY" \
  --data-urlencode "format=XML" \
  --data-urlencode "formatClass=checkDthenC" \
  --data-urlencode "supplier=123456789" \
  --data-urlencode 'partNumbers="ABC123","DEF456"' \
  --data-urlencode "startdate=2024-01-01" \
  -o declarations.zip
bash
curl -G "https://api.bomcheck.com/v2/download" \
  -H "Authorization: Bearer API_TOKEN" \
  --data-urlencode "format=1752B" \
  --data-urlencode "formatClass=checkDthenC" \
  --data-urlencode "supplier=123456789" \
  --data-urlencode "partNumbers[]=ABC123" \
  --data-urlencode "partNumbers[]=DEF456" \
  --data-urlencode "startDate=2024-01-01" \
  -o declarations.zip
bash
curl -X POST "https://api.bomcheck.com/v2/download" \
  -H "Authorization: Bearer API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"format": "1752B", "formatClass": "checkDthenC", "supplier": "123456789", "partNumbers": ["ABC123", "DEF456"], "startDate": "2024-01-01"}' \
  -o declarations.zip

Errors ​

v2 returns standard HTTP status codes. For example, an invalid parameter returns 422 Unprocessable Entity with a JSON list of the failed fields, and a request with no matching declarations returns 404 Not Found. Successful downloads count towards your tiered allowance. For all status codes, see HTTP Responses and Allowances & Limits.

What Changes for Integration Data ​

The v1 /api/integration endpoint took an action parameter. In v2, each action is a separate GET endpoint in the Integration Data module:

v1 actionv2 endpoint
listSubstanceCategoriesGET /integration/substance-lists
listCasNumbersGET /integration/substance-lists/{substanceCategoryListId}/substances/{substanceCategoryId}
listExemptionsGET /integration/exemption-lists
listSuppliersGET /integration/suppliers

v1 listCasNumbers returned one list of all CAS numbers. v2 returns the CAS numbers for one substance category at a time, in JSON only.

v1 returned XML. v2 returns JSON by default. To get XML from the substance lists, exemption lists and suppliers endpoints, add format=xml. The v1 output parameter becomes the v2 output query parameter, with the values content and file. Check the response format of each endpoint on Integration Data before you change your integration.

Next Steps ​