Metadata
Metadata is additional data (e.g. title, description, image, video) for measurements, options, body shapes, seam allowances and materials.
When a group is created, it will have a default set of metadata, which can be modified later. If a metadata has "isDefault": true
, it is the system's default.
Get imageUrl
by using Upload media file endpoint to upload image.
Create metadata
API Request
POST https://api.bespokify.com/v2/metadata
Request parameters
Parameter | Type | Required | Description |
---|---|---|---|
id | string | yes | The ID of the option / measurement / body shape / seam allowance |
gender | string | yes if metadata is for option, body shape or measurement | The gender that the option / measurement / body shape is for |
patternId | number | yes if metadata is for option | The patternId of option |
title | object | no | The title of the option / measurement / body shape / seam allowance in different languages |
description | object | no | The description of the option / measurement / body shape / seam allowance in different languages |
imageUrl | string | no | The URL of the image describing the option / measurement / body shape / seam allowance. You may upload images to our server. |
videoUrl | string | no | The URL of the video describing the option / measurement / body shape / seam allowance |
customData | object | no | Custom data that is not any of the ones above |
Example request
{
"id": "fit",
"gender": "male",
"patternId": 1,
"title": {
"en": "fit"
},
"description": {
"en": "Fit description"
},
"imageUrl": "https://example.com/images/56cc9a1b-c3e4-4293-a1d9-c9d33eaf4644",
"videoUrl": "https://example.com/videos/32cc9a1b-c3e4-4293-a1d9-c9d33eaf4644",
"customData": {
"foo": "bar"
}
}
Example response
{
"uuid": "875dec2d-f83f-476d-90f0-2929f9ad1054",
"id": "fit",
"gender": "male",
"isDefault": false,
"parentId": null,
"title": {
"en": "fit"
},
"description": {
"en": "Fit description"
},
"imageUrl": "https://example.com/images/56cc9a1b-c3e4-4293-a1d9-c9d33eaf4644",
"videoUrl": "https://example.com/videos/32cc9a1b-c3e4-4293-a1d9-c9d33eaf4644",
"customData": {
"foo": "bar"
}
}
Update metadata
API Request
PATCH https://api.bespokify.com/v2/metadata/{uuid}
Request parameters
Parameter | Type | Required | Description |
---|---|---|---|
title | object | no | The title of the option / measurement / body shape / seam allowance in different languages |
description | object | no | The description of the option / measurement / body shape / seam allowance in different languages |
imageUrl | string | no | The URL of the image describing the option / measurement / body shape / seam allowance |
videoUrl | string | no | The URL of the video describing the option / measurement / body shape / seam allowance |
customData | object | no | Custom data that is not any of the ones above |
Example request
{
"title": {
"en": "fit"
},
"description": {
"en": "Update fit option"
}
}
Example response
{
"uuid": "875dec2d-f83f-476d-90f0-2929f9ad1054",
"id": "fit",
"gender": "male",
"isDefault": false,
"parentId": null,
"title": {
"en": "fit"
},
"description": {
"en": "Update fit option"
},
"imageUrl": "https://example.com/images/56cc9a1b-c3e4-4293-a1d9-c9d33eaf4644",
"videoUrl": "https://example.com/videos/32cc9a1b-c3e4-4293-a1d9-c9d33eaf4644",
"customData": {
"foo": "bar"
}
}
List all metadata
Get the list of all metadata that belong to the current user's group.
API Request
GET https://api.bespokify.com/v2/metadata
Request parameters
Parameter | Type | Description |
---|---|---|
search | string | The text to search metadata's IDs, titles, descriptions by |
orderBy | string | The field to order metadata by. Possible values: id . Default: id |
sort | string | The order to sort metadata in. Possible values: asc , desc . Default: desc |
type | string | The type to filter metadata by. Possible values: seam , bodyShape , measurement , option |
gender | string | The gender to filter metadata by. Possible values: male , female |
patternId | number | The pattern ID to filter metadata by |
patternRefId | string | The pattern rev ID to filter metadata by. patternId is required if patternRefId is provided |
parentIds | array | The parent metadata IDs to filter metadata by, e.g. /metadata?parentIds[]=null&parentIds[]=foo&parentIds=bar |
measurementType | string | The measurement type to filter measurement metadata by. Possible values: body , final . type must be measurement when measurementType is provided. |
Example response
[
{
"uuid": "06f839a1-69a1-4216-a291-a2be2c73ae7e",
"id": "fit",
"type": "option",
"isDefault": true,
"parentId": null,
"title": {
"en": "fit en",
"fr": "fit fr"
},
"description": {
"en": "fit des",
"fr": "fit fr"
},
"gender": "male",
"imageUrl": "https://example.com/images/56cc9a1b-c3e4-4293-a1d9-c9d33eaf4644",
"videoUrl": "https://example.com/videos/32cc9a1b-c3e4-4293-a1d9-c9d33eaf4644",
"customData": { "foo": "bar" }
}
]
Get single metadata
Get a single metadata element, by its UUID, that belongs to the current user's group.
API Request
GET https://api.bespokify.com/v2/metadata/{uuid}
Example response
{
"uuid": "06f839a1-69a1-4216-a291-a2be2c73ae7e",
"id": "fit",
"type": "option",
"isDefault": true,
"parentId": null,
"title": {
"en": "fit en",
"fr": "fit fr"
},
"description": {
"en": "fit des",
"fr": "fit fr"
},
"gender": "male",
"imageUrl": "https://example.com/images/56cc9a1b-c3e4-4293-a1d9-c9d33eaf4644",
"videoUrl": "https://example.com/videos/32cc9a1b-c3e4-4293-a1d9-c9d33eaf4644",
"customData": { "foo": "bar" }
}
Revert to default metadata
Revert a metadata element to the system's default.
API Request
DELETE https://api.bespokify.com/v2/metadata/{uuid}
Response status codes
Code | Meaning |
---|---|
204 No Content | The metadata has been reverted successfully |
404 Not Found | A metadata with the provided UUID could not be found |
Import metadata csv
Update metadata by import metadata csv file.
API Request
POST https://api.bespokify.com/v2/metadata/import
File structure
The following is an example of the content of the CSV file to be uploaded. The header (first row) must remain the same.
id,type,gender,image_url,video_url,custom_data,pattern_id,title_en,description_en,title_jp,description_jp,title_cn,description_cn,title_th,description_th,
necklineAdj.2,option,male,,,,397,2
collar.shortRegular,option,male,,,,397,Short Kent
Export metadata
API Request
POST https://api.bespokify.com/v2/metadata/export
Request parameters
Parameter | Type | Description |
---|---|---|
fileType | string | File type of the export. Possible values: csv , json . Default: csv |
patternId | number | The pattern ID to filter metadata by |
type | string | Metadata type. Possible values: option , measurement , bodyShape , seam , material |
excludedFields | array | Fields to exclude from the export |
Example request
{
"fileType": "json",
"patternId": 376,
"type": "option",
"excludedFields": ["video_url", "custom_data"]
}
Example response
JSON
{
"fileName": "metadata.json",
"content": "aWQsdHlwZSxnZW5kZXIsdmlkZW9fdXJsLGN1c3RvbV9kYXRhLHBhdHRlcm5faWQK",
"size": 48,
"encoding": "base64",
"contentSha256": "887a874b8561b131c69ad7503f125acfea0d3dc71b9036b3b5ca3be2e6a4b189"
}
CSV
id,type,gender,image_url,video_url,custom_data,pattern_id,title_en,description_en,title_jp,description_jp,title_cn,description_cn,title_th,description_th,
necklineAdj.2,option,male,,,,397,2
collar.shortRegular,option,male,,,,397,Short Kent