Hi, it seems like the Cloud API endpoint for “product detail” just changed recently (not sure how recently exactly), and this has happened without a version bump, and seemingly without any warning.
Specifically, the /v1/products/:id endpoint response format has changed. 2 major changes:
- The payload at
$.productis now a hash/object, rather than an array - A bunch of the attributes of that product object are different.
Full before/after diff is below.
This is problematic because it randomly breaks functionality for clients/customers/users of Particle. For example, we have a custom build script that builds new firmware, uploads it, pings our system, and does some other stuff. This requires getting some information about the product we’re building for. This recent API change broke that script and set off a fair bit of debugging.
Note: I feel like a Github issue would be the ideal place to put this, but I don’t think the API code is open-source, and I wanted to let someone at the Particle team know about this issue, and suggest changes; and also to see if there are some update channels that we should be aware of where we can be notified of changes.
My recommendation: use (actually use) semantic versioning. So this new endpoint format would work just fine at /v2/products/:id.
Example of what changed:
Old response body format (from the current docs, which reflected the truth until recently):
{
"product": [
{
"id": "0123456789abcdef01234567",
"product_id": 6,
"name": "Photon",
"slug": "photon",
"description": "Traveling Light",
"type": "Consumer",
"hardware_version": "v1.0.0",
"config_id": "0123456789abcdef01234567",
"organization": "0123456789abcdef01234567",
"platform_id": 6,
"requires_activation_codes": false
}
]
}
New response body format:
{
"product": {
"id": 12345,
"platform_id": 10,
"name": "myproduct",
"slug": "myproduct-v010",
"description": "This is a super cool product whose description I have changed",
"subscription_id": 11111,
"mb_limit": null,
"groups": [],
"settings": {
"quarantine": true
},
"org": "myproduct-v010"
}
}
Would like to know if there can be some commitment to semantic versioning. Thanks!