Measurement profile

Measurement profiles are the sets of measurement values that are used to generate drafts. These sets also contain revisions that track the changes made to them over time. The API allows you to revert to previous revisions if necessary.

All measurement values use centimeter as their unit.

List all measurement profiles

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

API Request

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

Request parameters

Parameter Type Required Description
search string no The text used to search for measurement profile names
orderBy string no The field to order measurement profiles by. Possible values: updatedAt, name. Default: updatedAt
sort string no The order to sort measurement profiles in. Possible values: asc, desc. Default: desc
gender string no The measurement profile gender. Possible values: male, female
stage string no The measurement profile stage. Possible values: production, testing
measurementType string no The measurement type. Possible values: body, final

Example response

[
  {
    "id": "3c62721b-ac7e-42a8-b6a0-ee1c1e1a45bd",
    "name": "John Doe",
    "gender": "male",
    "measurementType": "final",
    "updatedAt": "2019-03-07T03:06:42.074Z",
    "updatedBy": "148a19ac-8afc-4a81-a86c-2457180d53ea"
  },
  {
    "id": "10ba038e-48da-487b-96e8-8d3b99b6d18a",
    "name": "Emily",
    "gender": "female",
    "measurementType": "body",
    "updatedAt": "2018-10-17T10:52:05.399Z",
    "updatedBy": "a4f58edf-49b2-441e-8c57-a9721a42c28b"
  }
]

List all revisions

Get the list of all the revisions of a measurement profile.

API Request

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

Request parameters

Parameter Type Required Description
orderBy string no The field to order revisions by. Possible values: createdAt. Default: createdAt
sort string no The order to sort revisions in. Possible values: asc, desc. Default: desc

Example response

[
  {
    "id": "dfdf97b6-588a-4d3e-867c-4e1509ca3941",
    "note": "Lorem ipsum dolor sit amet",
    "createdAt": "2019-01-09T03:54:14.589Z",
    "createdBy": "0de8bad4-1775-4277-bc7d-4a8426de8311"
  },
  {
    "id": "864820a6-4670-402f-bef8-e69d5be3b122",
    "note": "Lorem ipsum dolor sit amet",
    "createdAt": "2019-03-07T03:01:56.289Z",
    "createdBy": "8b2bd351-bc37-404c-b880-2a962986be9d"
  }
]

Get single measurement profile

API Request

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

Request parameters

Parameter Type Required Description
id string yes The ID of the measurement profile to retrieve

Example response

{
  "id": "10ba038e-48da-487b-96e8-8d3b99b6d18a",
  "name": "Emily",
  "gender": "female",
  "displayUnit": "imperial",
  "measurementType": "body",
  "measurements": {
    "fbHeight": 160,
    "fbWeight": 50
  },
  "bodyShapes": {
    "posture": "regular"
  },
  "note": "",
  "sizings": {
    "region": "US/CA",
    "bandSize": "C",
    "cupSize": "C",
    "jeanSize": "28"
  },
  "updatedAt": "2018-10-17T10:52:05.399Z",
  "updatedBy": "16f74df4-86fa-42b9-b5b7-70986e337c0d",
  "metadata": {
    "foo": "bar"
  }
}

Get single revision

API Request

GET https://api.bespokify.com/v2/measurementProfiles/{id}/revs/{revisionId}

Request parameters

Parameter Type Required Description
id string yes The ID of the measurement profile to retrieve
revisionId string yes The ID of the revision to retrieve

Example response

{
  "id": "dfdf97b6-588a-4d3e-867c-4e1509ca3941",
  "measurements": {
    "fbHeight": 160,
    "fbWeight": 50
  },
  "bodyShapes": {
    "posture": "regular"
  },
  "sizings": {
    "region": "US/CA",
    "bandSize": "C",
    "cupSize": "C",
    "jeanSize": "28"
  },
  "note": "Update measurements",
  "createdAt": "2019-01-09T03:54:14.589Z",
  "createdBy": "5feaf274-4e9f-47dd-8650-42c8cad4d3a4"
}

Create measurement profile

API Request

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

Request parameters

Parameter Type Required Description
name string yes The profile's name
gender string yes The profile's gender. Possible values: male, female
displayUnit string no The system to display measurements in. Possible values: metric, imperial
measurementType string yes The measurement's type. Possible values: body, final
measurements object yes The profile's measurements
bodyShapes object no The profile's body shapes
stage string no The profile's stage. Possible values: production, testing. Default: production
note string no The profile's note
sizings string no The profile's sizings, e.g. jeans size, shirt size, etc.
metadata string no Additional custom data

Example request

{
  "name": "Emily",
  "gender": "female",
  "displayUnit": "imperial",
  "measurementType": "body",
  "measurements": {
    "fbHeight": 160,
    "fbWeight": 50
  },
  "bodyShapes": {
    "posture": "regular"
  },
  "stage": "testing",
  "note": "This is a testing profile",
  "sizings": {
    "region": "US/CA",
    "bandSize": "C",
    "cupSize": "C",
    "jeanSize": "28"
  },
  "metadata": {
    "foo": "bar"
  }
}

Example response

{
  "id": "10ba038e-48da-487b-96e8-8d3b99b6d18a",
  "name": "Emily",
  "gender": "female",
  "displayUnit": "imperial",
  "measurementType": "body",
  "measurements": {
    "fbHeight": 160,
    "fbWeight": 50
  },
  "bodyShapes": {
    "posture": "regular"
  },
  "stage": "testing",
  "note": "This is a testing profile",
  "sizings": {
    "region": "US/CA",
    "bandSize": "C",
    "cupSize": "C",
    "jeanSize": "28"
  },
  "updatedAt": "2018-10-17T10:52:05.399Z",
  "updatedBy": "c6c85302-3e0a-47d3-919c-ed410e1cb9d5",
  "metadata": {
    "foo": "bar"
  }
}

Update measurement profile

API Request

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

Request parameters

Parameter Type Required Description
name string no The profile's new name
displayUnit string no The new to display measurements in. Possible values: metric, imperial
measurements object no The profile's new measurements
bodyShapes object no The profile's new body shapes
note string no The profile's new note
sizings string no The profile's new sizings, e.g. jeans size, shirt size, etc.
metadata string no Additional custom data

Example request

{
  "name": "Emily",
  "displayUnit": "metric",
  "measurements": {
    "fbHeight": 170,
    "fbWeight": 60
  },
  "bodyShapes": {
    "posture": "regular"
  },
  "note": "Lorem ipsum dolor sit amet",
  "sizings": {
    "region": "US/CA",
    "bandSize": "C",
    "cupSize": "C",
    "jeanSize": "28"
  },
  "metadata": {
    "foo": "lorem"
  }
}

Example response

{
  "id": "10ba038e-48da-487b-96e8-8d3b99b6d18a",
  "name": "Emily",
  "gender": "female",
  "displayUnit": "metric",
  "measurementType": "body",
  "measurements": {
    "fbHeight": 170,
    "fbWeight": 60
  },
  "bodyShapes": {
    "posture": "regular"
  },
  "note": "Lorem ipsum dolor sit amet",
  "sizings": {
    "region": "US/CA",
    "bandSize": "C",
    "cupSize": "C",
    "jeanSize": "28"
  },
  "updatedAt": "2018-10-17T10:52:05.399Z",
  "updatedBy": "a68b36ee-3615-4604-9d2d-75992be979ef",
  "metadata": {
    "foo": "lorem"
  }
}

Revert to revision

API Request

POST https://api.bespokify.com/v2/measurementProfiles/{id}/revert

Request parameters

Parameter Type Required Description
revId string yes The revision ID to revert to
note string no Note something for this action

Response status codes

Code Meaning
204 No Content The measurement profile has been reverted successfully
400 Bad Request The ID of the revision to revert to was missing, or a revision with that ID could not be found
404 Not Found A measurement profile with the provided ID could not be found

Delete measurement profile

Delete a measurement profile and all of its revisions.

API Request

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

Request parameters

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

Response status codes

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