Example JSON Representation

{
  "id": 5052,
  "brand_id":549,
  "name":"New Model A",
  "approved":false
}

GET /models
List models

GET /brands/:id/models
List models

Examples

GET /models
200
{
  "pagination": {
    "per_page": 25,
    "total_pages": 0,
    "total_objects": 0
  },
  "models": []
}

Params

Param name Description
page
optional

Validations:

  • Must be Integer.

per_page
optional

Validations:

  • Must be Integer.

name
optional

List models with names matching the provided string.

Validations:

  • Must be a String

name_like
optional

List models with names matching, or similar to, the provided string. Slower, but useful for correcting user input.

Validations:

  • Must be a String

brand
optional

Validations:

  • Must be a String

brand_id
optional

Validations:

  • Must be Integer.

approved
optional

Validations:

  • Must be true or false.

pending
optional

Validations:

  • Must be true or false.

in_use
optional

Validations:

  • Must be true or false.


GET /models/:id
Show a model

Examples

GET /models/3436
200
{
  "id": 3436,
  "name": "O30acb4bb72-ae2a-4f22-93d3-cbf924d5b1d7",
  "approved": true,
  "brand_id": 4313
}

POST /models
Create a model

Errors

Code Description
400

Examples

curl -X POST -H "Authorization: XXXX" -H "Content-Type: application/json" -d '{"name": "New Model A", "brand_id": 549}' "https://api.axefax.com/models"

Response:

{
  "model":{
    "id": 5052,
    "brand_id":549,
    "name":"New Model A",
    "approved":false
  }
}
      
POST /models
{
  "name": "A-6099b6b808dd-d96f-45fa-921a-9a51f5038d97",
  "model": {
    "name": "A-6099b6b808dd-d96f-45fa-921a-9a51f5038d97"
  }
}
201
{
  "id": 3437,
  "name": "A-6099b6b808dd-d96f-45fa-921a-9a51f5038d97",
  "approved": false,
  "brand_id": null
}

Params

Param name Description
name
optional

Validations:

  • Must be a String

brand_id
optional

Validations:

  • Must be a String


PUT /models/:id
Update a model

Errors

Code Description
400

Examples

PATCH /models/3439
{
  "name": "Stratocaster",
  "model": {
    "name": "Stratocaster"
  }
}
202
{
  "id": 3439,
  "name": "Stratocaster",
  "approved": false,
  "brand_id": 4314
}

Params

Param name Description
name
optional

Validations:

  • Must be a String

brand_id
optional

Validations:

  • Must be a String


DELETE /models/:id
Destroy a model

Errors

Code Description
405

Examples

DELETE /models/3444
{
  "model": {}
}
204