Example JSON Representation

{
  "id": 7977,
  "brand_id":478,
  "model_id":12432,
  "name":"Electric Lap Steel",
  "approved":true
}

GET /submodels
List submodels

GET /brands/:id/models/:model_id/submodels
List submodels

Examples

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

Params

Param name Description
page
optional

Validations:

  • Must be Integer.

per_page
optional

Validations:

  • Must be Integer.

name
optional

List submodels with names matching the provided string.

Validations:

  • Must be a String

name_like
optional

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

Validations:

  • Must be a String

model
optional

Validations:

  • Must be a String

model_id
optional

Validations:

  • Must be Integer.

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.


GET /submodels/:id
Show a submodel

Examples

GET /submodels/1898
200
{
  "id": 1898,
  "name": "Genesis Weber3ed9c3a1-c9a6-467e-8a3b-d63fa2a3d082",
  "approved": true,
  "brand_id": 4321,
  "model_id": 3446
}

POST /submodels
Create a submodel

Errors

Code Description
400

Examples

curl -X POST -H "Authorization: XXXXX" -H "Content-Type: application/json" -d '{"name": "New Submodel B", "brand_id": 549, "model_id": 5052}' "https://api.axefax.com/submodels"

Response:

{
  "submodel":{
    "id": 7977,
    "brand_id":478,
    "model_id":12432,
    "name":"Electric Lap Steel",
    "approved":true
  }
}
      
POST /submodels
{
  "name": "Lourdes Prohaska699354e4-9c69-49b8-bba6-3f529a053b82",
  "model_id": 3447,
  "submodel": {
    "name": "Lourdes Prohaska699354e4-9c69-49b8-bba6-3f529a053b82",
    "model_id": 3447
  }
}
201
{
  "id": 1900,
  "name": "Lourdes Prohaska699354e4-9c69-49b8-bba6-3f529a053b82",
  "approved": false,
  "brand_id": 4322,
  "model_id": 3447
}

Params

Param name Description
name
optional

Validations:

  • Must be a String

brand_id
optional

Validations:

  • Must be a String

model_id
optional

Validations:

  • Must be a String


PUT /submodels/:id
Update a submodel

Errors

Code Description
400

Examples

PATCH /submodels/1903
{
  "name": "Fender",
  "submodel": {
    "name": "Fender"
  }
}
202
{
  "id": 1903,
  "name": "Fender",
  "approved": false,
  "brand_id": 4324,
  "model_id": 3449
}

Params

Param name Description
name
optional

Validations:

  • Must be a String

brand_id
optional

Validations:

  • Must be a String

model_id
optional

Validations:

  • Must be a String


DELETE /submodels/:id
Destroy a submodel

Errors

Code Description
405

Examples

DELETE /submodels/1908
{
  "submodel": {}
}
204