Create a new machine.

Supported Formats

json, multipart/form-data

Examples

curl -X POST
     -H "Authorization:Token token=xxx"
     -H "Content-Type:multipart/form-data"
     -H "Accept: application/json"
     -F machine[name]="Epilog laser"
     -F machine[description]="La découpeuse laser vous permet de découper ou graver des matériaux."
     -F machine[machine_image_attributes[attachment]]=@epilog.jpeg
     /open_api/v1/machines

curl -X POST
     -H "Authorization:Token token=xxx"
     -H "Content-Type:application/json"
     -H "Accept: application/json"
     -d '{"machine": { "name": "DMP Flex 100", "description": "Cette imprimante 3D peut imprimer des métaux." }}'
     /open_api/v1/machines

Params

Param name Description
machine
required

Validations:

  • Must be a Hash

machine[name]
required

The name of the machine.

Validations:

  • Must be a String

machine[description]
required

A long textual description of the machine. HTML is supported.

Validations:

  • Must be a String

machine[spec]
optional

A long textual description of the technical specifications of the machine. HTML is supported.

Validations:

  • Must be a String

machine[disabled]
optional

Should the machine be disabled? If yes, the machine won’t be reservable and will be shown apart.

Validations:

  • Must be one of: TrueClass, FalseClass.

machine[machine_image_attributes]
optional

Validations:

  • Must be a Hash

machine[machine_image_attributes][attachment]
required

Upload a picture for the machine.

Validations:

  • Must be a ActionDispatch::Http::UploadedFile

Returns

HTTP code: 201

Description:

The machine was successfully created

Param name Description