2021-10-17 18:26:00 +02:00
|
|
|
---
|
|
|
|
title: Models
|
|
|
|
---
|
2021-08-25 16:09:31 +02:00
|
|
|
|
|
|
|
## Create model
|
|
|
|
|
2021-10-17 18:26:00 +02:00
|
|
|
```
|
|
|
|
POST /models
|
|
|
|
{
|
|
|
|
'name': 'The model name',
|
|
|
|
'breasts': false,
|
|
|
|
'units': 'imperial'
|
|
|
|
}
|
|
|
|
```
|
2021-08-25 16:09:31 +02:00
|
|
|
On success:
|
2021-10-17 18:26:00 +02:00
|
|
|
```
|
|
|
|
200
|
|
|
|
{
|
|
|
|
'model': {
|
|
|
|
'breasts': false,
|
|
|
|
'units': 'imperial',
|
|
|
|
'handle': 'dnkve',
|
|
|
|
'user': 'ohium',
|
|
|
|
'name': The model name',
|
|
|
|
'createdAt': '2019-08-12T12:06:41.086Z',
|
|
|
|
'updatedAt': '2019-08-12T12:06:41.086Z',
|
|
|
|
'pictureUris': {
|
|
|
|
'l': 'https://static.she.freesewing.org/users/o/ohium/models/dnkve/dnkve.svg',
|
|
|
|
'm': 'https://static.she.freesewing.org/users/o/ohium/models/dnkve/dnkve.svg',
|
|
|
|
's': 'https://static.she.freesewing.org/users/o/ohium/models/dnkve/dnkve.svg',
|
|
|
|
'xs': 'https://static.she.freesewing.org/users/o/ohium/models/dnkve/dnkve.svg'
|
2021-08-25 16:09:31 +02:00
|
|
|
}
|
2021-10-17 18:26:00 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
2021-08-25 16:09:31 +02:00
|
|
|
On failure:
|
2021-10-17 18:26:00 +02:00
|
|
|
```
|
|
|
|
400
|
|
|
|
```
|
2021-08-25 16:09:31 +02:00
|
|
|
|
|
|
|
Creates a model and returns its data.
|
|
|
|
|
|
|
|
## Read model
|
2021-10-17 18:26:00 +02:00
|
|
|
```
|
|
|
|
GET /models/:handle
|
|
|
|
```
|
2021-08-25 16:09:31 +02:00
|
|
|
On success: The model data
|
|
|
|
On failure:
|
2021-10-17 18:26:00 +02:00
|
|
|
```
|
|
|
|
400
|
|
|
|
```
|
2021-08-25 16:09:31 +02:00
|
|
|
|
|
|
|
Loads a model's data
|
|
|
|
|
|
|
|
## Update model
|
|
|
|
|
2021-10-17 18:26:00 +02:00
|
|
|
```
|
|
|
|
PUT /models/:handle
|
|
|
|
{
|
|
|
|
'measurements': {
|
|
|
|
'ankleCircumference': 234
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
2021-08-25 16:09:31 +02:00
|
|
|
|
|
|
|
Updates the model and returns the (updated) model data.
|
|
|
|
|
|
|
|
## Remove model
|
|
|
|
|
2021-10-17 18:26:00 +02:00
|
|
|
```
|
|
|
|
DELETE /models/:handle
|
|
|
|
```
|
2021-08-25 16:09:31 +02:00
|
|
|
On success:
|
2021-10-17 18:26:00 +02:00
|
|
|
```
|
|
|
|
200
|
|
|
|
```
|
2021-08-25 16:09:31 +02:00
|
|
|
On failure:
|
2021-10-17 18:26:00 +02:00
|
|
|
```
|
|
|
|
400
|
|
|
|
```
|
2021-08-25 16:09:31 +02:00
|
|
|
|
2021-10-17 17:34:55 +02:00
|
|
|
Removes the model
|
2021-10-17 18:26:00 +02:00
|
|
|
|