Products
Add a Product
POST /api/products
Payload
propertytype | descriptionexample | titlestring required | Product NameMackerel |
codestring required | product code stringBOX001 |
metastring required | Product Meta@wifi_enabled=true |
descriptionstring | Product DescriptionMy Amazing Product |
platform_idid required | ID of Platform this product contains877b4c52-4cc3-4fd2-8492-7b0c3fe1ab0d |
flavor_idid | ID of Flavor this product requires877b4c52-4cc3-4fd2-8492-7b0c3fe1ab0d |
Curl Example
curl -v -X POST -H 'Authorization: Bearer <user-token>' -H "Content-type: application/json" -d '{"title":"Mackerel","code":"BOX001","meta":"@wifi_enabled=true","description":"My Amazing Product","platform_id":"877b4c52-4cc3-4fd2-8492-7b0c3fe1ab0d","flavor_id":"877b4c52-4cc3-4fd2-8492-7b0c3fe1ab0d"}' http://localhost:2002/api/products
Delete Product CloudFS asset
DELETE /api/products/{product_id}/assets/{path*}
Parameters
propertytype | descriptionexample | product_idid | id1a9e45b4-2c30-4cbd-8812-fcc82c1f3ea1 |
Curl Example
curl -v -X DELETE -H 'Authorization: Bearer <user-token>' http://localhost:2002/api/products/{product_id}/assets/{path*}
Get a CloudFS asset
GET /api/products/{product_id}/assets/{path*}
Parameters
propertytype | descriptionexample | product_idid | id1a9e45b4-2c30-4cbd-8812-fcc82c1f3ea1 |
Curl Example
curl -v -X GET -H 'Authorization: Bearer <user-token>' http://localhost:2002/api/products/{product_id}/assets/{path*}
Index Product CloudFS assets
GET /api/products/{product_id}/assets
Parameters
propertytype | descriptionexample | product_idid | id1a9e45b4-2c30-4cbd-8812-fcc82c1f3ea1 |
Curl Example
curl -v -X GET -H 'Authorization: Bearer <user-token>' http://localhost:2002/api/products/{product_id}/assets
Upload a CloudFS asset
POST /api/products/{product_id}/assets/{path*}
Parameters
propertytype | descriptionexample | product_idid | id1a9e45b4-2c30-4cbd-8812-fcc82c1f3ea1 |
Curl Example
curl -v -X POST -H 'Authorization: Bearer <user-token>' http://localhost:2002/api/products/{product_id}/assets/{path*}
Delete product
DELETE /api/products/{product_id}
Parameters
propertytype | descriptionexample | product_idid | id1a9e45b4-2c30-4cbd-8812-fcc82c1f3ea1 |
Curl Example
curl -v -X DELETE -H 'Authorization: Bearer <user-token>' http://localhost:2002/api/products/{product_id}
Get a Product
GET /api/products/{product_id}
Parameters
propertytype | descriptionexample | product_idid | id1a9e45b4-2c30-4cbd-8812-fcc82c1f3ea1 |
Curl Example
curl -v -X GET -H 'Authorization: Bearer <user-token>' http://localhost:2002/api/products/{product_id}
Get Product bundle by tag
GET /api/products/{product_id}/bundles/{tag}
Parameters
propertytype | descriptionexample | product_idid | id1a9e45b4-2c30-4cbd-8812-fcc82c1f3ea1 |
tagstring | tagrelease |
Curl Example
curl -v -X GET -H 'Authorization: Bearer <user-token>' http://localhost:2002/api/products/{product_id}/bundles/{tag}
Return HTML formatted description of Product
GET /api/products/{product_id}/description.html
Parameters
propertytype | descriptionexample | product_idid | id1a9e45b4-2c30-4cbd-8812-fcc82c1f3ea1 |
Curl Example
curl -v -X GET -H 'Authorization: Bearer <user-token>' http://localhost:2002/api/products/{product_id}/description.html
Index products
GET /api/products
Curl Example
curl -v -X GET -H 'Authorization: Bearer <user-token>' http://localhost:2002/api/products
Update a Product
PUT /api/products/{product_id}
Parameters
propertytype | descriptionexample | product_idid | id1a9e45b4-2c30-4cbd-8812-fcc82c1f3ea1 |
Payload
propertytype | descriptionexample | titlestring | Product NameMackerel |
codestring required | product code string (excluding OUI)BOX001 |
summarystring | One line descriptionMy Amazing Product |
descriptionstring | Full descriptionMy Amazing Product |
metastring | Product Meta@wifi_enabled=true |
statestring | published or archivepublished |
Curl Example
curl -v -X PUT -H 'Authorization: Bearer <user-token>' -H "Content-type: application/json" -d '{"title":"Mackerel","code":"BOX001","summary":"My Amazing Product","description":"My Amazing Product","meta":"@wifi_enabled=true","state":"published"}' http://localhost:2002/api/products/{product_id}
Set Product State
POST /api/products/{product_id}/state
Parameters
propertytype | descriptionexample | product_idid | id1a9e45b4-2c30-4cbd-8812-fcc82c1f3ea1 |
Payload
propertytype | descriptionexample | statestring | active or trashtrash |
Curl Example
curl -v -X POST -H 'Authorization: Bearer <user-token>' -H "Content-type: application/json" -d '{"state":"trash"}' http://localhost:2002/api/products/{product_id}/state