curl --request POST \
--url https://cloudlab.scispot.io/labsheets/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Sample Manager",
"columns": [
{
"name": "Sample ID",
"type": "ID_BARCODE",
"position": 0,
"prefix": "SMPL"
},
{
"name": "Sample Name",
"type": "TEXT",
"position": 1
},
{
"name": "Sample #",
"type": "NUMBER",
"position": 2
},
{
"name": "Sample Type",
"type": "LIST",
"position": 3,
"references": [
"DNA",
"RNA",
"Protein",
"Cell Culture",
"Other"
]
},
{
"name": "Sample Status",
"type": "STATUS",
"position": 4,
"references": [
"Completed",
"In Progress",
"Cancelled"
],
"colors": [
"#16a34a",
"#facc15",
"#dc2626"
]
},
{
"name": "Sample Quantity",
"type": "QUANTITY",
"position": 5
},
{
"name": "Sample Units",
"type": "UNIT",
"position": 6,
"references": [
"mg",
"g",
"kg",
"ml"
]
},
{
"name": "Test Results",
"type": "LOOKUP_REFERENCE",
"position": 7,
"labsheet": "Test Results"
},
{
"name": "Test Run ID",
"type": "LOOKUP",
"position": 8,
"linkColumn": "Test Results",
"lookupColumnName": "Test Run ID"
}
],
"folder": "Samples Folder",
"waitRefresh": true
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Sample Manager',
columns: [
{name: 'Sample ID', type: 'ID_BARCODE', position: 0, prefix: 'SMPL'},
{name: 'Sample Name', type: 'TEXT', position: 1},
{name: 'Sample #', type: 'NUMBER', position: 2},
{
name: 'Sample Type',
type: 'LIST',
position: 3,
references: ['DNA', 'RNA', 'Protein', 'Cell Culture', 'Other']
},
{
name: 'Sample Status',
type: 'STATUS',
position: 4,
references: ['Completed', 'In Progress', 'Cancelled'],
colors: ['#16a34a', '#facc15', '#dc2626']
},
{name: 'Sample Quantity', type: 'QUANTITY', position: 5},
{
name: 'Sample Units',
type: 'UNIT',
position: 6,
references: ['mg', 'g', 'kg', 'ml']
},
{
name: 'Test Results',
type: 'LOOKUP_REFERENCE',
position: 7,
labsheet: 'Test Results'
},
{
name: 'Test Run ID',
type: 'LOOKUP',
position: 8,
linkColumn: 'Test Results',
lookupColumnName: 'Test Run ID'
}
],
folder: 'Samples Folder',
waitRefresh: true
})
};
fetch('https://cloudlab.scispot.io/labsheets/create', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://cloudlab.scispot.io/labsheets/create"
payload = {
"name": "Sample Manager",
"columns": [
{
"name": "Sample ID",
"type": "ID_BARCODE",
"position": 0,
"prefix": "SMPL"
},
{
"name": "Sample Name",
"type": "TEXT",
"position": 1
},
{
"name": "Sample #",
"type": "NUMBER",
"position": 2
},
{
"name": "Sample Type",
"type": "LIST",
"position": 3,
"references": ["DNA", "RNA", "Protein", "Cell Culture", "Other"]
},
{
"name": "Sample Status",
"type": "STATUS",
"position": 4,
"references": ["Completed", "In Progress", "Cancelled"],
"colors": ["#16a34a", "#facc15", "#dc2626"]
},
{
"name": "Sample Quantity",
"type": "QUANTITY",
"position": 5
},
{
"name": "Sample Units",
"type": "UNIT",
"position": 6,
"references": ["mg", "g", "kg", "ml"]
},
{
"name": "Test Results",
"type": "LOOKUP_REFERENCE",
"position": 7,
"labsheet": "Test Results"
},
{
"name": "Test Run ID",
"type": "LOOKUP",
"position": 8,
"linkColumn": "Test Results",
"lookupColumnName": "Test Run ID"
}
],
"folder": "Samples Folder",
"waitRefresh": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"name": "Samples",
"uuid": "<uuid>",
"success": true
}{
"success": false,
"message": "Invalid Authentication Token"
}{
"success": false,
"message": "Missing Authentication Token"
}{
"success": false,
"message": "Not found"
}{
"success": false,
"message": "Conflict"
}{
"success": false,
"message": "Invalid column type: <Invalid column type>. Allowed: ID, TEXT, NUMBER, LIST, STATUS, CONNECTION, DATE, DATETIME, LOOKUP_REFERENCE, LOOKUP, QUANTITY, QUANTITY_LEFT, QUANTITY_CONSUMED, PARENT, CHILDREN, CHECKBOX, ATTACHED_FILES, IMAGE_COL, LABSPACES, LAST_MODIFIED, EXISTING_MANIFEST, PROTOCOLS, EXPERIMENTS, CREATED_BY, DATE_CREATED"
}{
"success": false,
"message": "Operation failed"
}Create Labsheet
NOTE:
-
Labsheet names must be unique, non-empty, and have at most 30 characters
-
Every labsheet must have exactly one ID type column, refer to the API Overview for more information on ID type columns.
-
Column names must be unique within the same labsheet, non-empty, and have at most 30 characters
-
Labsheets can be created within a labsheet folder by specifying the name of folder
-
List of supported magic column types: “LABSPACES”, “LAST_MODIFIED”, “EXISTING_MANIFEST”, “PROTOCOLS”, “EXPERIMENTS”. Additonal Note: Names are ignored for these columns as they have already have a set name
Column objects require name/type for normal columns; LIST, STATUS, and UNIT columns require references. The following column types are supported by this endpoint: ID, TEXT, NUMBER, LIST, STATUS, CONNECTION, DATE, DATETIME, LOOKUP_REFERENCE, LOOKUP, QUANTITY, QUANTITY_LEFT, QUANTITY_CONSUMED, PARENT, CHILDREN, CHECKBOX, ATTACHED_FILES, IMAGE_COL, LABSPACES, LAST_MODIFIED, EXISTING_MANIFEST, PROTOCOLS, EXPERIMENTS, CREATED_BY, DATE_CREATED. More information on supported column types can be found in the API Overview.
curl --request POST \
--url https://cloudlab.scispot.io/labsheets/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Sample Manager",
"columns": [
{
"name": "Sample ID",
"type": "ID_BARCODE",
"position": 0,
"prefix": "SMPL"
},
{
"name": "Sample Name",
"type": "TEXT",
"position": 1
},
{
"name": "Sample #",
"type": "NUMBER",
"position": 2
},
{
"name": "Sample Type",
"type": "LIST",
"position": 3,
"references": [
"DNA",
"RNA",
"Protein",
"Cell Culture",
"Other"
]
},
{
"name": "Sample Status",
"type": "STATUS",
"position": 4,
"references": [
"Completed",
"In Progress",
"Cancelled"
],
"colors": [
"#16a34a",
"#facc15",
"#dc2626"
]
},
{
"name": "Sample Quantity",
"type": "QUANTITY",
"position": 5
},
{
"name": "Sample Units",
"type": "UNIT",
"position": 6,
"references": [
"mg",
"g",
"kg",
"ml"
]
},
{
"name": "Test Results",
"type": "LOOKUP_REFERENCE",
"position": 7,
"labsheet": "Test Results"
},
{
"name": "Test Run ID",
"type": "LOOKUP",
"position": 8,
"linkColumn": "Test Results",
"lookupColumnName": "Test Run ID"
}
],
"folder": "Samples Folder",
"waitRefresh": true
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Sample Manager',
columns: [
{name: 'Sample ID', type: 'ID_BARCODE', position: 0, prefix: 'SMPL'},
{name: 'Sample Name', type: 'TEXT', position: 1},
{name: 'Sample #', type: 'NUMBER', position: 2},
{
name: 'Sample Type',
type: 'LIST',
position: 3,
references: ['DNA', 'RNA', 'Protein', 'Cell Culture', 'Other']
},
{
name: 'Sample Status',
type: 'STATUS',
position: 4,
references: ['Completed', 'In Progress', 'Cancelled'],
colors: ['#16a34a', '#facc15', '#dc2626']
},
{name: 'Sample Quantity', type: 'QUANTITY', position: 5},
{
name: 'Sample Units',
type: 'UNIT',
position: 6,
references: ['mg', 'g', 'kg', 'ml']
},
{
name: 'Test Results',
type: 'LOOKUP_REFERENCE',
position: 7,
labsheet: 'Test Results'
},
{
name: 'Test Run ID',
type: 'LOOKUP',
position: 8,
linkColumn: 'Test Results',
lookupColumnName: 'Test Run ID'
}
],
folder: 'Samples Folder',
waitRefresh: true
})
};
fetch('https://cloudlab.scispot.io/labsheets/create', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://cloudlab.scispot.io/labsheets/create"
payload = {
"name": "Sample Manager",
"columns": [
{
"name": "Sample ID",
"type": "ID_BARCODE",
"position": 0,
"prefix": "SMPL"
},
{
"name": "Sample Name",
"type": "TEXT",
"position": 1
},
{
"name": "Sample #",
"type": "NUMBER",
"position": 2
},
{
"name": "Sample Type",
"type": "LIST",
"position": 3,
"references": ["DNA", "RNA", "Protein", "Cell Culture", "Other"]
},
{
"name": "Sample Status",
"type": "STATUS",
"position": 4,
"references": ["Completed", "In Progress", "Cancelled"],
"colors": ["#16a34a", "#facc15", "#dc2626"]
},
{
"name": "Sample Quantity",
"type": "QUANTITY",
"position": 5
},
{
"name": "Sample Units",
"type": "UNIT",
"position": 6,
"references": ["mg", "g", "kg", "ml"]
},
{
"name": "Test Results",
"type": "LOOKUP_REFERENCE",
"position": 7,
"labsheet": "Test Results"
},
{
"name": "Test Run ID",
"type": "LOOKUP",
"position": 8,
"linkColumn": "Test Results",
"lookupColumnName": "Test Run ID"
}
],
"folder": "Samples Folder",
"waitRefresh": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"name": "Samples",
"uuid": "<uuid>",
"success": true
}{
"success": false,
"message": "Invalid Authentication Token"
}{
"success": false,
"message": "Missing Authentication Token"
}{
"success": false,
"message": "Not found"
}{
"success": false,
"message": "Conflict"
}{
"success": false,
"message": "Invalid column type: <Invalid column type>. Allowed: ID, TEXT, NUMBER, LIST, STATUS, CONNECTION, DATE, DATETIME, LOOKUP_REFERENCE, LOOKUP, QUANTITY, QUANTITY_LEFT, QUANTITY_CONSUMED, PARENT, CHILDREN, CHECKBOX, ATTACHED_FILES, IMAGE_COL, LABSPACES, LAST_MODIFIED, EXISTING_MANIFEST, PROTOCOLS, EXPERIMENTS, CREATED_BY, DATE_CREATED"
}{
"success": false,
"message": "Operation failed"
}