Products

Add a Product

POST /api/products

Payload

propertytypedescriptionexample
titlestring requiredProduct NameMackerel
codestring requiredproduct code stringBOX001
metastring requiredProduct Meta@wifi_enabled=true
descriptionstringProduct DescriptionMy Amazing Product
platform_idid requiredID of Platform this product contains877b4c52-4cc3-4fd2-8492-7b0c3fe1ab0d
flavor_ididID 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

propertytypedescriptionexample
product_ididid1a9e45b4-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

propertytypedescriptionexample
product_ididid1a9e45b4-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

propertytypedescriptionexample
product_ididid1a9e45b4-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

propertytypedescriptionexample
product_ididid1a9e45b4-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

propertytypedescriptionexample
product_ididid1a9e45b4-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

propertytypedescriptionexample
product_ididid1a9e45b4-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

propertytypedescriptionexample
product_ididid1a9e45b4-2c30-4cbd-8812-fcc82c1f3ea1
tagstringtagrelease

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

propertytypedescriptionexample
product_ididid1a9e45b4-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

propertytypedescriptionexample
product_ididid1a9e45b4-2c30-4cbd-8812-fcc82c1f3ea1

Payload

propertytypedescriptionexample
titlestringProduct NameMackerel
codestring requiredproduct code string (excluding OUI)BOX001
summarystringOne line descriptionMy Amazing Product
descriptionstringFull descriptionMy Amazing Product
metastringProduct Meta@wifi_enabled=true
statestringpublished 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

propertytypedescriptionexample
product_ididid1a9e45b4-2c30-4cbd-8812-fcc82c1f3ea1

Payload

propertytypedescriptionexample
statestringactive 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