Preset
Draft presets provide a convenient way of saving customisations for specific patterns. These customisations include a selection of pattern options, the needed measurements to use, definitions of seam allowances, and addtional metadata.
List all presets
Get the list of all presets that belong to the current user's group.
API Request
GET https://api.bespokify.com/v2/presets
Request parameters
Parameter | Type | Required | Description |
---|---|---|---|
search | string | no | The text used to search presets' names |
orderBy | string | no | The field to order presets by. Possible values: createdAt , updatedAt , name . Default: updatedAt |
sort | string | no | The order to sort presets in. Possible values: asc , desc . Default: desc |
patternId | string | no | The pattern ID to filter presets by |
enabled | boolean | no | Filter presets by their availability |
gender | boolean | no | Filter presets by their gender. Possible value: male , female |
Example response
[
{
"id": "43949d72-524a-4435-8b8a-7eae341a31fe",
"name": "Pattern Test",
"patternId": 379,
"enabled": true,
"createdAt": "2018-10-17T09:52:05.399Z",
"createdBy": "lorem",
"updatedAt": "2018-10-25T09:52:05.399Z",
"updatedBy": "lorem",
"metadata": {
"foo": "bar"
}
}
]
Get single preset
API Request
GET https://api.bespokify.com/v2/presets/{id}
Request parameters
Parameter | Type | Required | Description |
---|---|---|---|
id | string | no | The ID of the preset to retrieve |
Example response
{
"id": "43949d72-524a-4435-8b8a-7eae341a31fe",
"patternId": 379,
"enabled": true,
"name": "Pattern Test",
"options": {
"collar": "collar.wide",
"pocket": "pocket.none"
},
"measurements": {
"body": {
"group": "measurementId",
"midNeck": "mbMidNeckGirth"
},
"final": {
"group": "measurementId",
"midNeck": "mfMidNeckGirth"
}
},
"materials": {
"primary": {
"id": "e6131e69-2a68-46a5-a9db-97a0e10b3ae2",
"name": "Paper",
"factoryId": null,
"nesting": {
"partMargin": 1,
"sheetWidth": 140,
"partRotation": "0",
"preNestRotation": null
},
"scaling": {
"easeAdjWarp": 1,
"easeAdjWeft": 1,
"shrinkageWarp": 1,
"shrinkageWeft": 1
}
}
},
"seams": {
"cuff": 1,
"none": 0,
"collar": 0.6
},
"metadata": {
"foo": "bar"
},
"createdAt": "2018-10-17T09:52:05.399Z",
"createdBy": "lorem"
}
Create preset
API Request
POST https://api.bespokify.com/v2/presets
Request parameters
Parameter | Type | Required | Description |
---|---|---|---|
patternId | string | yes | The pattern's ID |
name | string | yes | The preset's name |
enabled | boolean | no | Whether the preset will be enabled or not. Default: true |
measurements | object | yes | The preset's measurements |
options | object | yes | The preset's options |
seams | object | yes | The preset's seams |
metadata | object | no | Additional data |
Example request
{
"patternId": 379,
"enabled": true,
"name": "Pattern Test",
"options": {
"collar": "collar.wide",
"pocket": "pocket.none"
},
"measurements": {
"body": {
"group": "measurementId",
"midNeck": "mbMidNeckGirth"
},
"final": {
"group": "measurementId",
"midNeck": "mfMidNeckGirth"
}
},
"materials": {
"primary": {
"id": "e6131e69-2a68-46a5-a9db-97a0e10b3ae2",
"name": "Paper",
"factoryId": null,
"nesting": {
"partMargin": 1,
"sheetWidth": 140,
"partRotation": "0",
"preNestRotation": null
},
"scaling": {
"easeAdjWarp": 1,
"easeAdjWeft": 1,
"shrinkageWarp": 1,
"shrinkageWeft": 1
}
}
},
"metadata": {
"foo": "bar"
},
"seams": {
"cuff": 1,
"none": 0,
"collar": 0.6
}
}
Example response
{
"id": "43949d72-524a-4435-8b8a-7eae341a31fe",
"patternId": 379,
"enabled": true,
"name": "Pattern Test",
"options": {
"collar": "collar.wide",
"pocket": "pocket.none"
},
"measurements": {
"body": {
"group": "measurementId",
"midNeck": "mbMidNeckGirth"
},
"final": {
"group": "measurementId",
"midNeck": "mfMidNeckGirth"
}
},
"materials": {
"primary": {
"id": "e6131e69-2a68-46a5-a9db-97a0e10b3ae2",
"name": "Paper",
"factoryId": null,
"nesting": {
"partMargin": 1,
"sheetWidth": 140,
"partRotation": "0",
"preNestRotation": null
},
"scaling": {
"easeAdjWarp": 1,
"easeAdjWeft": 1,
"shrinkageWarp": 1,
"shrinkageWeft": 1
}
}
},
"seams": {
"cuff": 1,
"none": 0,
"collar": 0.6
},
"metadata": {
"foo": "bar"
},
"createdAt": "2018-10-17T09:52:05.399Z",
"createdBy": "lorem"
}
Update preset
API Request
PATCH https://api.bespokify.com/v2/presets/{id}
Request parameters
Parameter | Type | Required | Description |
---|---|---|---|
name | string | no | The preset's new name |
enabled | boolean | no | Whether the preset will be enabled or not |
measurements | object | no | The preset's new measurements |
options | object | no | The preset's new options |
seams | object | no | The preset's new seams |
metadata | object | no | The preset's new metadata |
Example request
{
"enabled": false,
"name": "Updated preset",
"options": {
"collar": "collar.wide",
"pocket": "pocket.none"
},
"measurements": {
"body": {
"group": "measurementId",
"midNeck": "mbMidNeckGirth"
},
"final": {
"group": "measurementId",
"midNeck": "mfMidNeckGirth"
}
},
"metadata": {
"foo": "lorem"
},
"seams": {
"cuff": 1,
"none": 1,
"collar": 0.6
}
}
Example response
{
"id": "43949d72-524a-4435-8b8a-7eae341a31fe",
"patternId": 379,
"enabled": false,
"name": "Updated preset",
"options": {
"collar": "collar.wide",
"pocket": "pocket.none"
},
"measurements": {
"body": {
"group": "measurementId",
"midNeck": "mbMidNeckGirth"
},
"final": {
"group": "measurementId",
"midNeck": "mfMidNeckGirth"
}
},
"seams": {
"cuff": 1,
"none": 1,
"collar": 0.6
},
"metadata": {
"foo": "lorem"
},
"createdAt": "2018-10-17T09:52:05.399Z",
"createdBy": "lorem",
"updatedAt": "2018-10-25T09:52:05.399Z",
"updatedBy": "lorem"
}
Delete preset
API Request
DELETE https://api.bespokify.com/v2/presets/{id}
Request parameters
Parameter | Type | Required | Description |
---|---|---|---|
id | string | no | The ID of the preset to delete |
Response status codes
Code | Meaning |
---|---|
204 No Content | The preset was deleted successfully |
404 Not Found | A preset with the provided ID could not be found |