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:
| Item | Legacy API (v1) | Platform API (v2) |
|---|---|---|
| Base URL | https://www.bomcheck.net/api | https://api.bomcheck.com/v2 on the Production Site, https://api.demo.bomcheck.com/v2 on the Demo Site |
| Authorization | An apikey parameter in the request body | A Bearer token in the Authorization header |
| Request method | POST only, with form data | GET with a query string, or POST with a JSON body |
format | XML or CSV. XML returned IPC-1752B. | 1752A, 1752B or CSV |
formatClass | C, D or checkDthenC. Required for XML. | No change. Required unless format is CSV. |
supplier | One or more DUNS numbers, separated by commas | One nine-digit DUNS number |
partNumbers | One string, with each part number in double quotes and separated by commas | An array of up to 500 part numbers. Each part number can have up to 50 characters. |
startdate | A date in YYYY-MM-DD format | Renamed to startDate. The format does not change. |
| Required filter | None. 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:
Authorization: Bearer API_TOKENYou 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:
- Change
formatfromXMLto1752Bto get the same files as v1. To get IPC-1752A files, use1752A. - Send one request for each supplier. v2 accepts only one DUNS number in
supplier. - Send
partNumbersas an array. In a query string, repeat the parameter:partNumbers[]=ABC123&partNumbers[]=DEF456. In a JSON body, use a JSON array:["ABC123", "DEF456"]. - Split lists of more than 500 part numbers into several requests.
- Rename
startdatetostartDate. - 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:
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.zipcurl -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.zipcurl -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.zipErrors
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 action | v2 endpoint |
|---|---|
listSubstanceCategories | GET /integration/substance-lists |
listCasNumbers | GET /integration/substance-lists/{substanceCategoryListId}/substances/{substanceCategoryId} |
listExemptions | GET /integration/exemption-lists |
listSuppliers | GET /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
- To create a token and send a first request, see Getting Started.
- For every download parameter and response, see Download Declarations.