API

Authorization

To use the API you need an access token. All authorization requests are protected using HTTP Basic Authentication, and all requests are a HTTP POST as defined in the OAuth2 RFC.

You can request an token using the client credentials you received and the following requests.

POST /authorization/oauth2/token

This request must be used when a client wants to request a access_token for a user using OAuth Resource Owner Password Credentials authorization or Refresh Token grant. Each request will create a new UserToken and remove expired tokens.

Example request

Using Resource Owner Password Credentials

POST /authorization/oauth2/token HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Accept: application/json
Authorization: Basic base64("clientname:clientsecret")

grant_type=password&username=username&password=userpassword

Using a Refresh Token

POST /authorization/oauth2/token HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Accept: application/json
Authorization: Basic base64("clientname:clientsecret")

grant_type=refresh_token&refresh_token=c807b638ad0c11d62d000e4e32d8504efef738e532d090d377784ef04dbab5bd

Example response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "access_token": "9fd9cdab-06e3-4479-a1a9-48f0d1f0b0e3",
    "token_type": "Bearer",
    "expires_in": 31536000,
    "refresh_token": "c807b638ad0c11d62d000e4e32d8504efef738e532d090d377784ef04dbab5bd"
}
grant_type:Must always be password or refresh_token
password:User password
refresh_token:Refresh token for that Client - User combination
username:User username
POST /authorization/oauth2/tokeninfo

Verify the status of an Access Token

Example request

POST /authorization/oauth2/tokeninfo HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Accept: application/json
Authorization: Basic base64("clientname:clientsecret")

access_token=9fd9cdab-06e3-4479-a1a9-48f0d1f0b0e3

Example response

HTTP/1.1 200 OK
content-type: application/json

{
    "user_id": 13,
    "client_id": 42,
    "status": "ACTIVE",
    "expires_in": 31536000
}
POST authorization/oauth2/revoke

Revoke any access or refresh token

Example request

POST /authorization/oauth2/revoke HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Accept: application/json
Authorization: Basic base64("clientname:clientsecret")

token=9fd9cdab-06e3-4479-a1a9-48f0d1f0b0e3

Example response

HTTP/1.1 204 No Content

Important

All API requests not related to authorization must include the Authorization header containing a bearer token.

GET /public-api/some_call HTTP/1.1
Authorization: Bearer 9fd9cdab-06e3-4479-a1a9-48f0d1f0b0e3

User

GET /public-api/user/

Get the calling User details

Example request

GET /public-api/user HTTP/1.1

Example response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "id": "42",
    "login": "user@quantacorp.io",
    "status": "ACTIVE",
    "gender": "MALE",
    "roles": ["PUBLIC_ADMIN"]
}
GET /public-api/user/company_chain

Get all the Users within the specified Company, that is within the Company Chain of the calling User.

Example request

GET /public-api/user/company_chain HTTP/1.1
Accept: application/json

Example response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "companies_users": [{
        "company_id": 1,
        "company_name": "QuantaCorp NV",
        "users": [{
            "id": 123,
            "login": "user@quantacorp.io",
            "status": "ACTIVE",
            "gender": "MALE",
            "roles": ["PUBLIC_ADMIN"]
        }]
    }]
}
PUT /public-api/user/password

Sets a new password for the calling User. Note: The only requirement is minimum length of 6 chars.

Example request

PUT /public-api/user/password HTTP/1.1
Content-Type: application/json

{
    "current_password": "thisismyCURRENTpassword"
    "new_password": "thisismyNEWpassword"
}

Example response

HTTP/1.1 204 No Content
GET /public-api/user/(int: user_id)
Returns a User by its Id, within the Company Chain of the calling User.

Example request

GET /public-api/user/42 HTTP/1.1

Example response

HTTP/1.1 200 OK
Content-Type: application/json

{
 "id": "42",
 "login": "user@quantacorp.io",
 "status": "ACTIVE",
 "gender": "MALE",
 "roles": ["PUBLIC_ADMIN"]
}
PUT /public-api/user/(int: user_id)

Full or partial update of a User, within the Company Chain of the calling User.

Example request

Full update

PUT /public-api/user/42 HTTP/1.1
Content-Type: Application/json

{
    "login": "my@unique.name",
    "status": "ACTIVE",
    "gender": "MALE"
}

Partial update

PUT /public-api/user/42 HTTP/1.1
Content-Type: Application/json

{
    "gender": "MALE"
}

Example response

HTTP/1.1 204 No Content
GET /public-api/user/company/(int: company_id)

Get all the Users within the specified Company, that is within the Company Chain of the calling User.

Example request

GET /public-api/user/company/123 HTTP/1.1
Accept: Application/json

Example response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "id": "42",
    "login": "user@quantacorp.io",
    "status": "ACTIVE",
    "gender": "MALE",
    "roles": ["PUBLIC_ADMIN"]
}
POST /public-api/user/company/(int: company_id)

Create a new User for a certain Company, within the Company chain of the calling User.

Example request

POST /public-api/user/company/123 HTTP/1.1
Content-Type: Application/json

{
    "login": "my@email.address",
    "status": "ACTIVE",
    "password": "mysecret",
    "gender": "MALE"
}

Example response

HTTP/1.1 201 Created
Location: /user/45
GET /public-api/user/project/(int: project_id)/candidates

Get all Users that can be linked to the specified Project.

Example request

GET /public-api/user/project/456/candidates HTTP/1.1
Accept: Application/json

Example response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "linked_users": [{
        "id": 42,
        "login": "info@quantacorp.io",
        "status": "ACTIVE",
        "gender": "MALE",
        "roles": ["PUBLIC_ADMIN"]
    }],
    "other_users": [{
        "id": 54,
        "login": "dummy@quantacorp.io",
        "status": "ACTIVE",
        "gender": "MALE",
        "roles": ["PUBLIC_ADMIN"]
    }]
}
GET /public-api/user/project/(int: project_id)/linked

Get all linked Users of a Project.

Example request

GET /public-api/user/project/456/linked HTTP/1.1
Accept: Application/json

Example response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "users": [{
        "id": 42,
        "login": "info@quantacorp.io",
        "status": "ACTIVE",
        "gender": "MALE",
        "roles": ["PUBLIC_ADMIN"]
    }],
POST /public-api/user/(int: user_id)/project/(int: project_id)

Create a link between an User and a Project, that the calling User can manage.

Example request

POST /public-api/user/54/project/456 HTTP/1.1

Example response

HTTP/1.1 204 No Content
DELETE /public-api/user/(int: user_id)/project/(int: project_id)

Delete a link between an User and a Project.

Example request

DELETE /public-api/user/54/project/456 HTTP/1.1

Example response

HTTP/1.1 204 No Content

Size Passport

A size passport is split into two resources: a Body, defining a physical person and a Scan, defining the measurements.

Body

POST /public-api/body

Create a new body with an alias and a Company

Example request:

POST /public-api/body HTTP/1.1
Content-Type: application/json

{
    "alias": "lynda.desmedt@email.address",
    "company_id": 37,
    "height": 1650,
    "gender": "FEMALE",
    "first_name": "Lynda",
    "last_name": "Desmedt",
    "crm_id": "356468413655",
    "notes": "Lynda prefers trousers with longer legs.",
    "link_to_project": 35,
    "custom_1": "axbc23",
    "custom_2": 951357,
    "custom_3": "Department Name",
    "custom_4": "any custom value",
    "custom_5": "some data"
}

Example response:

HTTP/1.1 201 Created
Content-Type: application/json
Location: body/324
alias:a unique identifier used to refer to a person (name, employee id, etc.)
company_id:the company this body must be linked to
height:the height of the person in mm
gender:can be UNKNOWN, MALE, FEMALE
first_name:optional
last_name:optional
crm_id:optional, can be use to link a person with an external system
notes:optional
link_to_project:
 optional, when empty, the body will only be visible from the customer, not from any project
GET /public-api/body/(int: user_id)

Get a body with specific id

Example request:

GET /public-api/body/123 HTTP/1.1
Accept: application/json

Example response:

HTTP/1.1 200 OK
Content-Type: application/json

{
    "id": 42,
    "alias": "lynda@desmedt.com",
    "first_name": "Lynda",
    "last_name": "Desmedt",
    "crm_id": "356468413655",
    "user_id": 42,
    "company_id": 37,
    "company_name": "QuantaCorp NV",
    "height": 1650,
    "gender": "FEMALE",
    "notes": "..."
}
GET /public-api/body/alias/(string: alias)

Get a list of bodies matching the given alias

Example request

GET /public-api/body/alias/lynda HTTP/1.1
Accept: application/json

Example response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "bodies": [
        {
            "id": 11,
            "alias": "lynda@desmedt.com",
            "first_name": "Lynda",
            "last_name": "Desmedt",
            "crm_id": "356468413655",
            "user_id": 13,
            "company_id": 1,
            "company_name": "QuantaCorp NV",
            "height": 1650,
            "gender": "MALE",
            "notes": "...",
            "link_to_project": 35
        }
    ]
}
GET /public-api/body/company/(int: company_id)

Get all the Bodies of the specified Company

Example request

GET /public-api/body/company/12 HTTP/1.1
Accept: application/json

Example response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "bodies" : [ {
        "id" : 11,
        "alias" : "lynda@desmedt.com",
        "first_name" : "Lynda",
        "last_name" : "Desmedt",
        "crm_id" : "356468413655",
        "user_id" : 13,
        "company_id" : 1,
        "company_name" : "QuantaCorp NV",
        "height" : 1650,
        "weight" : 12345,
        "gender" : "FEMALE",
        "notes" : "Some details",
        "num_scans" : 3,
        "linked_projects" : [
            {
                "id" : 16,
                "name" : "project16"
            },
            {
                "id" : 17,
                "name" : "project17"
            }
        ],
        "custom_1" : {
            "key" : "status",
            "value" : "ok"
        }
    }]
}
GET /public-api/body/project/(int: project_id)

Get all the Bodies of the specified Project

Example request

GET /public-api/body/project/24 HTTP/1.1
Accept: application/json

Example response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "bodies": [
        {
            "id": 11,
            "alias": "lynda@desmedt.com",
            "first_name": "Lynda",
            "last_name": "Desmedt",
            "crm_id": "356468413655",
            "user_id": 13,
            "company_id": 1,
            "company_name": "QuantaCorp NV",
            "height": 1650,
            "gender": "FEMALE",
            "notes": "..."
        }
    ]
}
POST /public-api/body/(int: body_id)/project/(int: project_id)

Creates a link between a Project and a Body.

Example request

POST /public-api/body/11/project/24 HTTP/1.1
Accept: application/json

Example response

HTTP/1.1 204 No Content
Content-Type: application/json
DELETE /public-api/body/(int: body_id)/project/(int: project_id)

Tries to remove a link between a Project and a Body. This will fail if the Body already has scans for that Project.

Example request

DELETE /public-api/body/11/project/24 HTTP/1.1
Accept: application/json

Example response

HTTP/1.1 204 No Content
Content-Type: application/json
PUT /public-api/body/(int: id)

Full or partial update of a Body.

Example request

Full update

PUT /public-api/body/123 HTTP/1.1
Accept: application/json

{
    "alias": "lynda.desmedt@email.address",
    "company_id": 37,
    "height": 1650,
    "gender": "MALE",
    "first_name": "Lynda",
    "last_name": "Desmedt",
    "crm_id": "356468413655",
    "user_id": 42,
    "notes": "..."
}

Partial update

PUT /public-api/body/123 HTTP/1.1
Accept: application/json

{
    "alias": "my@unique.name"
}

Clear a field by sending a empty String:

PUT /public-api/body/123 HTTP/1.1
Accept: application/json

{
    "first_name": ""
}

Example response

HTTP/1.1 200 OK
Content-Type: application/json
DELETE /public-api/body/(int: id)

Delete a Body

Example request

DELETE /public-api/body/123 HTTP/1.1
Accept: application/json

Example response

HTTP/1.1 204 No Content
Content-Type: application/json

Scan

POST /public-api/scan/project/(int: projectId)/body/(int: bodyId)

Create a scan for a body within a project.

Scan requirements

To take a proper scan, your scanning application must take the following requirements into account

  • The camera must be perpendicular to the floor and not tilted on any axis so no skewing is introduced.
  • The person must stand in an A-pose for the front-view
  • The person must keep the feet together and hands tight to the body for the side-view

Hint

Take a look at the scanning manual of the QuantaCorp App.

Hint

You should use the overlay used in the QuantaCorp App, to assist the pose of the scanned person:

../_images/FrontBordered.png ../_images/SideOverlayBorder.png

Image file requirements

Property Value
Max Filesize 150 kB
Imagesize 400x480 pixels
Fileformat PNG or JPG

Note

The upload uses a multipart/form-data request, as shown in the request example. However do not implement this yourself. Most http frameworks support this type of requests, and have implement these features following the RFC.

Example request

POST /public-api/scan/project/12/body/215 HTTP/1.1
Content-Length: 524
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryRBThslRCcTNVDj1z
Accept: application/json

------WebKitFormBoundaryRBThslRCcTNVDj1z
Content-Disposition: form-data; name="front"; filename="person_front.jpeg"
Content-Type: image/jpeg

<base64 image data>

------WebKitFormBoundaryRBThslRCcTNVDj1z
Content-Disposition: form-data; name="side"; filename="person_side.jpeg"
Content-Type: image/jpeg

<base64 image data>

------WebKitFormBoundaryRBThslRCcTNVDj1z--

Example response

HTTP/1.1 202 Accepted
Content-Type: application/json
GET /public-api/scan/project/(int: projectId)/body/(int: bodyId)/latest

Get the latest scan of a body within a defined project.

Example request

GET /public-api/scan/project/12/body/123/latest HTTP/1.1
Accept: application/json

Example response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "id" : "17",
    "measurements" : [{
            "type" : "height",
            "value" : 1466,
            "unit" : "mm"
        }, {
            "type" : "chest_circ_max",
            "value" : 847,
            "unit" : "mm"
        }, {
            "type" : "waist_circ_pref",
            "value" : 646,
            "unit" : "mm"
        }, {
            "type" : "hip_circ_max",
            "value" : 826,
            "unit" : "mm"
        }, {
            "type" : "crotch_height",
            "value" : 664,
            "unit" : "mm"
        }, {
            "type" : "shoulder_to_wrist_length",
            "value" : 521,
            "unit" : "mm"
        }, {
            "type" : "hps_to_wrist_length",
            "value" : 691,
            "unit" : "mm"
        }, {
            "type" : "neck_circ_base",
            "value" : 504,
            "unit" : "mm"
        }, {
            "type" : "custom_belly_circ",
            "value" : 994,
            "unit" : "mm"
        }, {
            "type" : "volume_torso",
            "value" : 60942193,
            "unit" : "mm3"
        }
    ]
}
GET /public-api/scan/body/(int: bodyid)/latest

Get the latest scan result for a body.

Note

A body can be linked to multiple projects. This is the latest scan on whatever project the calling user has access to.

Example request

GET /public-api/scan/body/12/latest HTTP/1.1
Accept: application/json

Example response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "id" : "17",
    "measurements" : [{
            "type" : "height",
            "value" : 1466,
            "unit" : "mm"
        }, {
            "type" : "chest_circ_max",
            "value" : 847,
            "unit" : "mm"
        }, {
            "type" : "waist_circ_pref",
            "value" : 646,
            "unit" : "mm"
        }, {
            "type" : "hip_circ_max",
            "value" : 826,
            "unit" : "mm"
        }, {
            "type" : "crotch_height",
            "value" : 664,
            "unit" : "mm"
        }, {
            "type" : "shoulder_to_wrist_length",
            "value" : 521,
            "unit" : "mm"
        }, {
            "type" : "hps_to_wrist_length",
            "value" : 691,
            "unit" : "mm"
        }, {
            "type" : "neck_circ_base",
            "value" : 504,
            "unit" : "mm"
        }, {
            "type" : "custom_belly_circ",
            "value" : 994,
            "unit" : "mm"
        }, {
            "type" : "volume_torso",
            "value" : 60942193,
            "unit" : "mm3"
        }
    ]
}
GET /public-api/scan/(int: scanId)/model_hq

Get a high quality 3D model of a scan, in OBJ format.

Example request

GET public-api/scan/412/model_hq HTTP/1.1
Accept: text/plain

Company

POST /public-api/company

Create a new child company .

Example request

POST /public-api/company HTTP/1.1
Content-Type: application/json
Accept: application/json

{
    "name": "QuantaCorp NV",
    "parent_id": 42,
    "valid_from": "2017-02-01",
    "valid_until": "2027-02-28"
}

Example response

HTTP/1.1 201 CREATED
Location: /company/34
valid_from:optional, by default this is the current date
valid_until:optional, when omitted, the validity is forever. If both valid_from and valid_until are specified, valid_until must be equal to valid_from, or be in the future.
GET /public-api/company

Get the company the current user is linked to.

Example request

GET /public-api/company HTTP/1.1
Accept: application/json

Example response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "id": 42,
    "name": "QuantaCorp NV",
    "parent_id": 41,
    "valid_from": "2017-02-01",
    "valid_until": "2027-02-28"
}
GET /public-api/company/(int: id)

Get the company with the given id.

Example request

GET /public-api/company/42 HTTP/1.1
Accept: application/json

Example response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "id": 42,
    "name": "QuantaCorp NV",
    "parent_id": 41,
    "valid_from": "2017-02-01",
    "valid_until": "2027-02-28"
}
GET /public-api/company/children

Get the direct child companies of the Company of the linked user.

Example request

GET /public-api/company/children HTTP/1.1
Accept: application/json

Example response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "companies": [
        {
            "id": 41,
            "name": "A and C: Kortrijk",
             "parent_id": 12
        },
        {
            "id": 42,
            "name": "A and C: Gent",
            "parent_id": 12
        }
    ]
}
GET /public-api/company/(int: id)/children

Get the direct child companies of the Company with the given id.

Example request

GET /public-api/company/12/children HTTP/1.1
Accept: application/json

Example response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "companies": [
        {
            "id": 41,
            "name": "A and C: Kortrijk",
             "parent_id": 12
        },
        {
            "id": 42,
            "name": "A and C: Gent",
            "parent_id": 12
        }
    ]
}
GET /public-api/company/custom_body_field

Get the Custom Body Fields of the Company.

Example request

GET /public-api/company/custom_body_field HTTP/1.1
Accept: application/json

Example response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "custom_1" : "Some_important_value",
    "custom_2" : "reference",
    "custom_3" : "Department",
    "custom_4" : "Useful_tag",
    "custom_5" : "Demo_value"
}
PUT /public-api/company/custom_body_field

Update a specific Custom Body Field.

Example request

PUT /public-api/company/custom_body_field HTTP/1.1
Accept: application/json

{
    "key": "custom_1",
    "value" : "Some other important value"
}

Example response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "key": "custom_1",
    "value" : "Some_other_important_value"
}
key:This is a value ranging from custom_1 to custom_5
value:The name that should be used to display the custom value, this value must not contain spaces.
DELETE /public-api/company/custom_body_field/(string: custom_body_field_key)

Purges a specific Custom Body Field of the Company of the User. Since this a purge, the specified Custom Body Field will also be cleared in the Bodies and Export.

Example request

DELETE /public-api/company/custom_body_field/custom_1 HTTP/1.1
Accept: application/json

Example response

HTTP/1.1 204 No Content
Content-Type: application/json
custom_body_field_key:
 This is a value ranging from custom_1 to custom_5

Project

POST /public-api/project

Create a new project, within the Company Chain of the calling User.

Example request

POST /public-api/project HTTP/1.1
Content-Type: application/json
Accept: application/json

{
    "name": "My Project",
    "branch" "Brussels",
    "initiator_id": 1,
    "supplier_ids": [1, 2, 3, 4],
    "customer_id": 1,
    "parent_id": 2
}

Example response

HTTP/1.1 201 Created
Location: /project/51
GET /public-api/project/all

Get all Projects, within the Company Chain of the calling User.

Example request

GET /public-api/project/all HTTP/1.1
Accept: application/json

Example reponse

HTTP/1.1 200 Ok
Content-Type: application/json

{
    "projects" : [{
        "id" : 1,
        "name" : "...",
        "branch" : "...",
        "suppliers": [{ "id": 123, "name": "..." }],
        "initiator": { "id": 123, "name": "..." },
        "customer": { "id": 123, "name": "..." },
        "parent_id" : 1,
        "has_children" : true
    }]
}
GET /public-api/project/candidates

Get all the possible Suppliers and Customers to create new Projects with.

Example request

GET /public-api/project/candidates HTTP/1.1
Accept: application/json

Example reponse

HTTP/1.1 200 Ok
Content-Type: application/json

{
    "suppliers": [{ "id": 1, "name": "Supplier One" }],
    "customers": [{ "id": 1, "name": "Customer One" }]
}
GET /public-api/project/linked

Get all Linked Projects for the calling User.

Example request

GET /public-api/project/linked HTTP/1.1
Accept: application/json

Example reponse

HTTP/1.1 200 Ok
Content-Type: application/json

{
    "projects" : [{
        "id" : 1,
        "name" : "...",
        "branch" : "...",
        "suppliers": [{ "id": 123, "name": "..." }],
        "initiator": { "id": 123, "name": "..." },
        "customer": { "id": 123, "name": "..." },
        "parent_id" : 1,
        "has_children" : true
    }]
}
GET /public-api/project/roots

Get all root Projects within the Company Chain of the calling User. A Project root is defined as a Project with no parent Project.

Example request

GET /public-api/project/roots HTTP/1.1
Accept: application/json

Example reponse

HTTP/1.1 200 Ok
Content-Type: application/json

{
    "projects" : [{
        "id" : 1,
        "name" : "...",
        "branch" : "...",
        "suppliers": [{ "id": 123, "name": "..." }],
        "initiator": { "id": 123, "name": "..." },
        "customer": { "id": 123, "name": "..." },
        "parent_id" : 1,
        "has_children" : true
    }]
}
GET /public-api/project/(int: id)

Get the details of a linked Project with id.

Example request

GET /public-api/project/42 HTTP/1.1
Accept: application/json

Example reponse

HTTP/1.1 200 Ok
Content-Type: application/json

{
    "id": 42,
    "name": "...",
    "branch": "...",
    "initiator":  { "id": 1, "name": "Company #1", "parent_id": 123 },
    "suppliers": [{ "id": 1, "name": "Company #1" }, { "id": 2, "name": "Supplier 1" }, { "id": 3, "name": "Supplier #2" }],
    "customer": { "id": 1, "name": "Company #1", "parent_id": 123 },
    "parent": { "id": 456, "name": "Root Project" },
    "garments": [ { "id": 789, "name": "Red T-Shirt" }],
    "collections": [ { "id": 789, "name": "Halloween Firefighter" }],
    "has_children": true
}
PUT /public-api/project/(int: id)

Full update of a Project the calling User can manage.

Example request

PUT /public-api/project/42 HTTP/1.1
Content-Type: application/json

{
    "name": "...",
    "branch": "...",
    "initiator_id": 1,
    "supplier_ids": [1, 2, 3, 4],
    "customer_id": 1,
    "parent_id": 2
}

Example reponse

HTTP/1.1 204 No Content
GET /public-api/project(int: project_id)/children

Get the direct children of the Project the calling User is linked to.

Example request

GET /public-api/project/42/children HTTP/1.1
Accept: application/json

Example reponse

HTTP/1.1 200 Ok
Content-Type: application/json

{
    "projects" : [{
        "id" : 1,
        "name" : "...",
        "branch" : "...",
        "suppliers": [{ "id": 123, "name": "..." }],
        "initiator": { "id": 123, "name": "..." },
        "customer": { "id": 123, "name": "..." },
        "parent_id" : 1,
        "has_children" : true
    }]
}
GET /public-api/project/linked/user/(int: user_id)

Get all Linked Projects for a User.

Example request
GET /public-api/project/linked/user/42 HTTP/1.1
Accept: application/json

Example reponse

HTTP/1.1 200 Ok
Content-Type: application/json

{
    "projects" : [{
        "id" : 1,
        "name" : "...",
        "branch" : "...",
        "suppliers": [{ "id": 123, "name": "..." }],
        "initiator": { "id": 123, "name": "..." },
        "customer": { "id": 123, "name": "..." },
        "parent_id" : 1,
        "has_children" : true
    }]
}
GET /public-api/project/(int: project_id)/export

Export all data from the given Project.

Note

Use the Accept header to choose the preferred format. For CSV use text/csv, for JSON use application/json

Example request

GET /public-api/project/linked/user/42 HTTP/1.1
Accept: application/json

Example response

HTTP/1.1 200 Ok
Content-Type: application/json

{
    "export" : [{
        "project_id" : 42,
        "project_name" : "A&C Global",
        "project_branch" : "Branch ...",
        "project_initiator_name" : "A and C",
        "project_supplier_name" : "Cloths And Co",
        "project_customer_name" : "A and C",
        "body_id" : 30,
        "body_alias" : "A&C - root",
        "body_crm" : "356468413655",
        "collection_id" : 3,
        "collection_name" : "Halloween Firefighter",
        "garment_id" : 13,
        "garment_ext_id" : "someExtId",
        "garment_name" : "Garment Name",
        "size_name" : "XL",
        "preferred_size_name" : "XL",
        "order_size_name" : "XL",
        "order_quantity" : 1
    }]
}

Garment

GET /public-api/garment/(int: garment_id)

Get a garment.

Example request

GET /public-api/garment/12 HTTP/1.1
Accept: application/json

Example response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "id": 42,
    "ext_id": "11612:2008 EU",
    "description": "Fire Resistance Trousers for welding.",
    "name": "MALE",
    "garment_type": "TROUSERS",
    "gender": "MALE",
    "conversion_group": 1
}
GET /public-api/garment/chain

Get all garments.

Example request

GET /public-api/garment/chain HTTP/1.1
Accept: application/json

Example response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "garments": [
        {
            "id": 148,
            "ext_id": "someExtId",
            "description": "Fire Resistance",
            "name": "Garment Name",
            "garment_type": "TROUSERS",
            "gender": "MALE",
            "conversion_group": 1
        },
        {
            "id": 149,
            "ext_id": "someExtId",
            "description": "Overall",
            "name": "Garment Name",
            "garment_type": "OVERALLS",
            "gender": "FEMALE",
            "conversion_group": 2
        }
    ]
}
GET /public-api/garment/project/(int: project_id)/linked

Get a list of all garments linked to a specific project

Example request

GET /public-api/garment/project/10/linked HTTP/1.1
Accept: application/json

Example response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "garments" : [{
          "id" : 148,
          "ext_id" : "someExtId",
          "description" : "Fire Resistance",
          "name" : "Garment Name",
          "garment_type" : "TROUSERS",
          "gender" : "MALE",
          "conversion_group" : 1,
          "order_quantity" : 3
      }]
}
GET /public-api/garment/project/(int: project_id)/all

Get a list of garments of all suppliers of a project.

Note

Incomplete garments (garments without conversions) are not included.

Example request

GET /public-api/garment/project/10/all HTTP/1.1
Accept: application/json

Example response

HTTP/1.1 200 OK
Content-Type: application/json

{
     "garments" : [{
     "id" : 148,
      "ext_id" : "someExtId",
      "description" : "Fire Resistance",
      "name" : "Garment Name",
      "garment_type" : "TROUSERS",
      "gender" : "MALE",
      "conversion_group" : 1
    }]
}
GET /public-api/garment/project/(int: project_id)/linked/body/(int: body_id)

Get all linked garments for a certain body in a project.

Example request

GET /public-api/garment/project/10/linked/body/512 HTTP/1.1
Accept: application/json

Example response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "garments": [{
        "id": 1,
        "name" : "...",
        "order_quantity": 1
    }]
}
POST /public-api/garment

Create a new garment.

Example request

POST /public-api/garment HTTP/1.1
Content-Type: application/json
Accept: application/json

{
    "name": "WBP",
    "garment_type": "BERMUDA",
    "gender": "MALE",
    "description": "White Bermuda Pants",
    "ext_id": "ABC:123 BWT",
    "conversion_group": 12
}

Example response

HTTP/1.1 201 Created
Location: /garment/123
name:mandatory, unique name identifying the garment
gender:mandatory, can be UNKNOWN, MALE, FEMALE
garment_type:mandatory, string like Polo or Jacket
conversion_group:
 optional, but when present the group must already exist
POST /public-api/garment/(int: garment_id)/project/(int: project_id)/quantity/(int: order_quantity)

Create a link between a garment and a project, with a specific order quantity.

Example request

POST /public-api/garment/5/project/10/quantity/3 HTTP/1.1
Accept: application/json

Example response

HTTP/1.1 201 Created
POST /public-api/garment/(int: garment_id)/project/(int: project_id)/body/(int: body_id)/quantity/(int: orderQuantity)

Create a link between a garment, body and project.

Note

The garment must already be linked to the specified project.

Important

Linking a body specific garment affects the matching rules.

Example request

POST /public-api/garment/5/project/10/body/123/quantity/3 HTTP/1.1
Accept: application/json

Example response

HTTP/1.1 204 No Content
PUT /public-api/garment/(int: garment_id)

Partial of full update a garment.

Example request

PUT /public-api/garment/10 HTTP/1.1
Content-Type: application/json

{
    "name": "MALE",
    "garment_type": "TROUSERS",
    "gender": "MALE",
    "ext_id": "11612:2008 EU",
    "description": "Fire Resistance Trousers for welding.",
    "conversion_group": 1
}

Example response

HTTP/1.1 200 OK
PUT /public-api/garment/(int: garment_id)/project/(int: project_id)/quantity/(int: order_quantity)

Update the order quantity of a garment within the linked project.

Example request

PUT /public-api/garment/10/project/123/quantity/5 HTTP/1.1
Accept: application/json

Example response

HTTP/1.1 204 No Content
PUT /garment/(int: garment_id)/project/(int: project_id)/body/(int: body_id)/quantity/(int: order_quantity)

update the order quantity of the garment within the linked project and body.

Example request

PUT /public-api/garment/10/project/123/body/512/quantity/5 HTTP/1.1
Accept: application/json

Example response

HTTP/1.1 204 No Content
DELETE /public-api/garment/(int: garment_id)

Delete a garment.

Example request

DELETE /public-api/garment/10 HTTP/1.1

Example response

HTTP/1.1 204 No Content
DELETE /public-api/garment/(int: garment_id)/project/(int: project_id)

Delete the link between a garment and a project.

Example request

DELETE /public-api/garment/10/project/8 HTTP/1.1
Accept: application/json

Example response

HTTP/1.1 204 No Content
DELETE /public-api/garment/(int: garment_id)/project/(int: project_id)/body/(int: body_id)

Delete a link between a garment, body and a project.

Example request

DELETE /public-api/garment/10/project/12/body/512 HTTP/1.1

Example response

HTTP/1.1 204 No Content

Conversion

Important

All measurement values are in millimeter [mm]

GET /public-api/conversion/{id}

Get a single conversion. A specific garment measurement to size.

Example request

GET /public-api/conversion/42 HTTP/1.1
Accept: application/json

Example response

HTTP/1.1 200 OK
Content-Type: application/json

 {
    "id": 42,
    "conversion_group": 12,
    "size_name": "XL",
    "measure_type": "waist",
    "min": 0,
    "max": 1700
  }
Min:minimum measurement of the garment, the lower bound is 0
Max:max measurement of the garment, the upper bound is null

Note

A range min, max is defined as: [min, max[ (max excl.)

POST /public-api/conversion

Create a new single conversion.

If a conversion_group is not present, a new conversion group will be generated. The id of the new conversion_group can be found in the header of the response. If a conversion_group is present, it must already exist. When min is set and max is not, max will be set to the max upper limit being either null or the min of the next size. When max is set and min is not, min will be set the the min lower limit being either 0 or the max of the previous size.

Example request

POST /public-api/conversion HTTP/1.1
Content-Type: application/json
Accept: application/json

{
    "conversion_group": 12
    "size_name": "XL",
    "measure_type": "waist",
    "min": 0,
    "max": 1700
}

Example response

HTTP/1.1 201 Created
Content-Type: application/json
X-Conversion-Group-Id: 13
Location: conversion/42
PUT /public-api/conversion/(int: conversion_id)

Partial or full update a conversion.

Note

if you don’t specify max, the value will not be updated. If you specify max to null, the upper bound is set to null (~ infinity).

Example request

PUT /public-api/conversion/42 HTTP/1.1
Content-Type: application/json

{
    "maxSet" : true,
    "measure_type" : "...",
    "size_name" : "...",
    "conversion_group" : 12345,
    "max" : 1040,
    "min" : 1000
}

Example response

HTTP/1.1 204 No Content
DELETE /public-api/conversion/(int: conversion_id)

Delete a conversion.

Example request

DELETE /public-api/conversion/42 HTTP/1.1

Example response

HTTP/1.1 204 No Content

Offset

GET /public-api/offset/(int: offset_id)

Get an Offset with id

Example request

GET /public-api/offset/42 HTTP/1.1
Accept: application/json

Example response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "id": 42,
    "measure_type": "chest_circ_max",
    "value": 60
}
GET /public-api/offset/group/(int: conversiongroup_id)

Get all Offsets for a conversion group.

Example request

GET /public-api/offset/group/50 HTTP/1.1
Accept: application/json

Example response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "offsets": [
        {
            "id": 42,
            "measure_type": "custom_waist_circ",
            "value": 60
        },
        {
            "id": 43,
            "measure_type": "custom_chest_circ",
            "value": 90
        }]
}
POST /public-api/offset/group/(int: conversiongroup_id)

Create a new Offset for a given Conversion Group.

Example request

POST /public-api/offset/group/50 HTTP/1.1
Content-Type: application/json

{
    "measure_type": "chest_circ_max",
    "value": 60
}

Example response

HTTP/1.1 201 SUCCESS
PUT /public-api/offset/(int: id)

Full update of an Offset.

Example request

PUT /public-api/offset/42 HTTP/1.1
Content-Type: application/json

{
    "measure_type": "custom_waist_circ",
    "value": 60
}

Example response

HTTP/1.1 204 No Content
DELETE /public-api/offset/(int: id)

Delete an Offset

Example request

DELETE /public-api/offset/42 HTTP/1.1

Example response

HTTP/1.1 204 No Content

Garment Bundles

POST /public-api/garmentbundle

Create a new garment bundle

Example request

POST /public-api/garmentbundle HTTP/1.1
Content-Type: application/json

{
    "name": "...",
    "garments": [
        { "id": 1, "order_quantity": 1 },
        { "id": 2, "order_quantity": 1 }
    ]
}

Example response

HTTP/1.1 204 CREATED
GET /public-api/garmentbundle

Get all the garment bundles.

Example request

GET /public-api/garmentbundle HTTP/1.1
Accept: application/json

Example response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "garment_bundles": [{
        "id": 123,
        "name": "...",
        "garments": [{
            "id": 148,
            "ext_id": "someExtId",
            "description": "Fire Resistance",
            "name": "Garment Name",
            "garment_type": "TROUSERS",
            "gender": "MALE",
            "conversion_group": 1,
            "order_quantity": 3
        }]
    }]
}
GET /public-api/garmentbundle/(int: id)

Get a single garment bundle.

Example request

GET /public-api/garmentbundle/42 HTTP/1.1
Accept: application/json

Example response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "id": 123,
    "name": "...",
    "garments": [{
        "id": 148,
        "ext_id": "someExtId",
        "description": "Fire Resistance",
        "name": "Garment Name",
        "garment_type": "TROUSERS",
        "gender": "MALE",
        "conversion_group": 1,
        "order_quantity": 3
    }]
}
PUT /public-api/garmentbundle/(int: id)

Update an existing garment bundle.

Example request

PUT /public-api/garmentbundle/42 HTTP/1.1
Content-Type: application/json

{
    "name": "...",
    "garments": [
        { "id": 1, "order_quantity": 1 },
        { "id": 2, "order_quantity": 1 }
    ]
}

Example response

HTTP/1.1 204 NO CONTENT
DELETE /public-api/garmentbundle/(int: id)

Delete a garment bundle.

Example request

DELETE /public-api/garmentbundle/42 HTTP/1.1

Example response

HTTP/1.1 204 NO CONTENT
GET /public-api/garmentbundle/project/(int: project_id)/company/(int: company_id)

Get all the garment bundles of a specific supplier of a project.

Example request

GET /public-api/garmentbundle/project/42/company/50 HTTP/1.1
Accept: application/json

Example response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "garment_bundles": [{
        "id": 123,
        "name": "...",
        "garments": [{
            "id": 148,
            "ext_id": "someExtId",
            "description": "Fire Resistance",
            "name": "Garment Name",
            "garment_type": "TROUSERS",
            "gender": "MALE",
            "conversion_group": 1,
            "order_quantity": 3
        }]
    }]
}

Collections

GET /public-api/collection/project/(int: project_id)

Get highlevel information about all the collections for the specified project.

Example request

GET /public-api/collection/project/42 HTTP/1.1
Accept: application/json

Example response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "collections": [
        {
            "id": 1,
            "name": "Collection One"
        },
        {
            "id": 2,
            "name": "Collection Two"
        }]
}
POST /public-api/collection/project/(int: project_id)

Create a new Collection with existing Garments or a Garment bundle from the specified Project supplier. Either provide a list of Garments or provide the i of a Garment bundle.

Warning

The list of garments must be of a single Supplier only.

Example request

POST /public-api/collection/project/42 HTTP/1.1
Content-Type: application/json

{
    "name": "...",
    "garments": [
        { "id": 1, "order_quantity": 1 },
        { "id": 2, "order_quantity": 2 },
        { "id": 3, "order_quantity": 5 }
    ]
}

Or

POST /public-api/collection/project/42 HTTP/1.1
Content-Type: application/json

{
    "name": "...",
    "garment_bundle_id": 123
}

Example response

HTTP/1.1 201 CREATED
GET /public-api/collection/(int: collection_id)/project/(int: project_id)

Get a specific collection from a specific `project.

Example request

GET /public-api/collection/42/project/50 HTTP/1.1
Accept: application/json

Example response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "id": 123,
    "name": "..",
    "garments" : [{
        "id" : 148,
        "ext_id" : "someExtId",
        "description" : "Fire Resistance",
        "name" : "Garment Name",
        "garment_type" : "TROUSERS",
        "gender" : "MALE",
        "conversion_group" : 1,
        "order_quantity" : 3
    }]
}
PUT /public-api/collection/(int: collection_id)/project/(int: project_id)

Full update of a collection from a specific project.

Example request

PUT /public-api/collection/42/project/50 HTTP/1.1
Content-Type: application/json

{
    "name": "...",
    "garments": [
        { "id": 1, "order_quantity": 1 },
        { "id": 2, "order_quantity": 2 },
        { "id": 3, "order_quantity": 5 }
    ]
}

Example response

HTTP/1.1 204 NO CONTENT
DELETE /public-api/collection/(int: collection_id)/project/(int: project_id)

Delete a collection from a project.

Example request

DELETE /public-api/collection/42/project/50 HTTP/1.1

Example response

HTTP/1.1 200 OK
GET /public-api/collection/project/(int: project_id)/linked/body/(int: body_id)

Get all linked `collcetions for a body in a project.

Example request

GET /public-api/collection/project/42/linked/body/12 HTTP/1.1
Accept: application/json

Example response

HTTP/1.1 200 ok
Content-Type: application/json

{
    "collections": [{ "id": 1, "name" : "Collection One" } ]
}
POST /public-api/collection/project/(int: project_id)/linked/body/(int: body_id)

Link a body to a collection of a project.

Example request

POST /public-api/collection/project/42/linked/body/12 HTTP/1.1

Example response

HTTP/1.1 204 No Content
DELETE /public-api/collection/project/(int: project_id)/linked/body/(int: body_id)

Delete a link between a body and a collecton of a project.

Example request

DELETE /public-api/collection/project/42/linked/body/12 HTTP/1.1

Example response

HTTP/1.1 204 NO CONTENT

Matching

POST /public-api/match/project/(int: id)/body/(int: id)

Requests a match for a body and project, using the latest scan measurements.

Ruleset that will impact the result:

  • The gender of the Body is used to remove Garments of the opposite gender.
  • Garments without Conversions are not included.
  • If no Body Garments/Collections are configured, all the Garments/Collections of the Project are used.
  • Garment Offsets are taken into account.
  • If a certain Garment doesn’t fit, the forcé (F) size_name is used.

The size_name is the size advice by the platform. It is based on the body measurements and the configured garment details. Via the scanning app and the portal it is possible to overwrite this advice. The new value is available as the preferred_size_name property. A rule of thumb is to use the preferred_size_name when avaialable and when it is not use the size_name.

Example request

GET /public-api/match/project/1/body/12 HTTP/1.1
Accept: application/json

Example response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "garment_matches": [{
        "id": 123,
        "name": "WBP",
        "company_id": 24,
        "garment_type": "BERMUDA",
        "gender": "MALE",
        "size_name": "S",
        "preferred_size_name": "S",
        "ext_id": "ABC:123 BWT",
        "description": "White Bermuda Pants",
        "variations" : [{
            "measure_type" : "shoulder_to_wrist_length",
            "variation" : 150,
            "type" : "STANDARD_VARIATION"
        }],
        "conversion_group_id": 1
    }],
    "collection_matches": [{
        "id": 321,
        "name": "My Collection",
        "garment_matches": [{
            "id": 123,
            "name": "WBP",
            "company_id": 24,
            "garment_type": "BERMUDA",
            "gender": "MALE",
            "size_name": "S",
            "preferred_size_name": "S",
            "ext_id": "ABC:123 BWT",
            "description": "White Bermuda Pants",
            "variations" : [{
                "measure_type" : "shoulder_to_wrist_length",
                "variation" : 150,
                "type" : "STANDARD_VARIATION"
            }],
            "conversion_group_id": 1
        }]
    }]
}