Light Services

Publish a new version of an option's file

Publishes to the file one of the product's options hands over. The benefit id comes from the benefits endpoint, where an option's benefit carries an option_id. The product's own file is published through the product route instead.

POST
/products/{product}/benefits/{benefit}/versions

Authorization

bearerAuth
AuthorizationBearer <token>

Personal access token generated in the admin dashboard.

In: header

Path Parameters

product*integer

The product ID

benefit*integer

The benefit ID

Request Body

multipart/form-data

version_name*string
Lengthlength <= 255
title*string
Lengthlength <= 255
changelog*string
changelog_format?string
Value in"markdown" | "html"
file*file
Formatbinary

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "http://localhost:8000/api/products/0/benefits/0/versions" \  -F version_name="string" \  -F title="string" \  -F changelog="string" \  -F file="string"
{
  "data": {
    "id": 0,
    "product_id": "string",
    "option_id": 0,
    "purchase_benefit_id": 0,
    "benefit_name": "string",
    "version_number": "string",
    "title": "string",
    "changelog": "string",
    "download_url": "string",
    "file_name": "string",
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z"
  }
}
{
  "message": "string"
}
{
  "message": "string"
}
{
  "message": "string"
}
{
  "message": "string",
  "errors": {
    "property1": [
      "string"
    ],
    "property2": [
      "string"
    ]
  }
}