Material

List all material

Get the list of all materials that belong to the current user's group.

API Request

GET https://api.bespokify.com/v2/materials

Request parameters

Parameter Type Required Description
search string no The text to search for material names, factory IDs, and groups.
orderBy string no The field to order materials by. Possible values: createdAt, updatedAt, name. Default: updatedAt
sort string no The order to sort materials in. Possible values: asc, desc. Default: desc
groups array no Used to filter materials by groups

Example response

[
  {
    "id": "9af52b94-88f6-4b1b-868a-1f74d670983b",
    "name": "Paper",
    "factoryId": null,
    "createdAt": "2019-03-16T02:56:58.832Z",
    "createdBy": "abe3beb5-90c9-4155-9586-07d2cad93940",
    "updatedAt": "2019-03-16T02:56:58.832Z",
    "updatedBy": "abe3beb5-90c9-4155-9586-07d2cad93940",
    "groups": ["primary"],
    "nesting": {
      "partMargin": 1,
      "sheetWidth": 140,
      "partRotation": "+180",
      "preNestRotation": 270
    },
    "global": true,
    "scaling": {
      "easeAdjWarp": 1,
      "easeAdjWeft": 1,
      "shrinkageWarp": 1,
      "shrinkageWeft": 1
    },
    "imageUrl": "https://bespokify.com/assets/images/0a987c56-631a-48d6-9df3-881572c57d2a/51a5ef8b-f71b-411b-a662-0758b370fa13.png"
  },
  {
    "id": "222a048e-b8c5-468e-ac0b-4a5e9473c218",
    "name": "Material",
    "factoryId": "FAD",
    "createdAt": "2019-03-15T10:39:21.936Z",
    "createdBy": "abe3beb5-90c9-4155-9586-07d2cad93940",
    "updatedAt": "2019-03-15T10:39:21.936Z",
    "updatedBy": "abe3beb5-90c9-4155-9586-07d2cad93940",
    "groups": ["primary"],
    "global": null,
    "nesting": {
      "partMargin": 1,
      "sheetWidth": 140,
      "partRotation": "+180",
      "preNestRotation": 270
    },
    "scaling": {
      "easeAdjWarp": 1,
      "easeAdjWeft": 1,
      "shrinkageWarp": 1,
      "shrinkageWeft": 1
    },
    "imageUrl": null
  }
]

Get single material

API Request

GET https://api.bespokify.com/v2/materials/{id}

Request parameters

Parameter Type Required Description
id string yes The ID of the material

Example response

{
  "id": "222a048e-b8c5-468e-ac0b-4a5e9473c218",
  "name": "Paper",
  "factoryId": null,
  "partRotation": null,
  "createdAt": "2019-03-15T10:39:21.936Z",
  "createdBy": "abe3beb5-90c9-4155-9586-07d2cad93940",
  "updatedAt": "2019-03-15T10:39:21.936Z",
  "updatedBy": "abe3beb5-90c9-4155-9586-07d2cad93940",
  "groups": ["primary"],
  "nesting": {
    "partMargin": 1,
    "sheetWidth": 140,
    "partRotation": "+180",
    "preNestRotation": 270
  },
  "global": true,
  "scaling": {
    "easeAdjWarp": 1,
    "easeAdjWeft": 1,
    "shrinkageWarp": 1,
    "shrinkageWeft": 1
  },
  "imageUrl": "https://bespokify.com/assets/images/0a987c56-631a-48d6-9df3-881572c57d2a/51a5ef8b-f71b-411b-a662-0758b370fa13.png"
}

Create material

API Request

POST https://api.bespokify.com/v2/materials

Request parameters

Parameter Type Required Description
name string yes The material's name
factoryId string no The material's factory ID
imageUrl string no The URL of the image describing the option / measurement / body shape / seam allowance. You may upload images to our server.
groups array no The material group names which this material belong to
nesting object yes See Nesting config
scaling object yes See Scaling config

Example request

{
  "name": "Material 1",
  "factoryId": "b39e6fe0-2712-470c-9ec4-f9b5e7edbad0",
  "imageUrl": "https://bespokify.com/assets/images/0a987c56-631a-48d6-9df3-881572c57d2a/51a5ef8b-f71b-411b-a662-0758b370fa13.png",
  "groups": ["primary"],
  "nesting": {
    "partMargin": 1,
    "sheetWidth": 140,
    "partRotation": "+180",
    "preNestRotation": 270
  },
  "scaling": {
    "easeAdjWarp": 1,
    "easeAdjWeft": 1,
    "shrinkageWarp": 1,
    "shrinkageWeft": 1
  }
}

Example response

{
  "id": "9af52b94-88f6-4b1b-868a-1f74d670983b",
  "name": "Material 1",
  "factoryId": "b39e6fe0-2712-470c-9ec4-f9b5e7edbad0",
  "createdAt": "2019-03-16T02:56:58.832Z",
  "createdBy": "abe3beb5-90c9-4155-9586-07d2cad93940",
  "updatedAt": "2019-03-16T02:56:58.832Z",
  "updatedBy": "abe3beb5-90c9-4155-9586-07d2cad93940",
  "groups": ["primary"],
  "nesting": {
    "partMargin": 1,
    "sheetWidth": 140,
    "partRotation": "+180",
    "preNestRotation": 270
  },
  "global": null,
  "scaling": {
    "easeAdjWarp": 1,
    "easeAdjWeft": 1,
    "shrinkageWarp": 1,
    "shrinkageWeft": 1
  },
  "imageUrl": "https://bespokify.com/assets/images/0a987c56-631a-48d6-9df3-881572c57d2a/51a5ef8b-f71b-411b-a662-0758b370fa13.png"
}

Update material

API Request

PATCH https://api.bespokify.com/v2/materials/{id}

Request parameters

Parameter Type Required Description
name string no The material's name
factoryId string no The material's factory ID
imageUrl string no The URL of the image describing the option / measurement / body shape / seam allowance. You may upload images to our server.
groups array no The material group names which this material belong to
nesting object no See Nesting config
scaling object no See Scaling config

Example request

{
  "name": "Material 2",
  "factoryId": "FDA",
  "imageUrl": "",
  "groups": ["lining"],
  "nesting": {
    "partMargin": 1,
    "sheetWidth": 140,
    "partRotation": "+180",
    "preNestRotation": 270
  },
  "scaling": {
    "easeAdjWarp": 1,
    "easeAdjWeft": 1,
    "shrinkageWarp": 1,
    "shrinkageWeft": 1
  },
  "imageUrl": "https://bespokify.com/assets/images/0a987c56-631a-48d6-9df3-881572c57d2a/51a5ef8b-f71b-411b-a662-0758b370fa13.png"
}

Example response

{
  "id": "9af52b94-88f6-4b1b-868a-1f74d670983b",
  "name": "Material 2",
  "factoryId": "FDA",
  "createdAt": "2019-03-16T02:56:58.832Z",
  "createdBy": "abe3beb5-90c9-4155-9586-07d2cad93940",
  "updatedAt": "2019-03-16T02:56:58.832Z",
  "updatedBy": "abe3beb5-90c9-4155-9586-07d2cad93940",
  "nesting": {
    "partMargin": 1,
    "sheetWidth": 140,
    "partRotation": "+180",
    "preNestRotation": 270
  },
  "global": null,
  "scaling": {
    "easeAdjWarp": 1,
    "easeAdjWeft": 1,
    "shrinkageWarp": 1,
    "shrinkageWeft": 1
  },
  "imageUrl": "https://bespokify.com/assets/images/0a987c56-631a-48d6-9df3-881572c57d2a/51a5ef8b-f71b-411b-a662-0758b370fa13.png"
}

Delete material

API Request

DELETE https://api.bespokify.com/v2/materials/{id}

Request parameters

Parameter Type Required Description
id string yes The ID of the material to delete

Response status codes

Code Meaning
204 No Content The material has been deleted successfully
404 Not Found A material with the provided ID could not be found