/stocks/material-types/folders
This endpoint allows the user to create a material type folder.
createMaterialTypeFolder
Content-Type: application/json
· Required fields: name
name
string
required
Name of the material type folder.
Example: Material Type Folder 1
code
string | null
Code of the material type folder. Not required in the endpoint request but will be generated internally since there cannot be a material type folder without a code. When sent, needs to be unique.
Example: MTF1
parent_id
string
ID of the parent material type folder
Example: 1
data
object
MaterialTypeFolder model structure details
id
string
read-only
ID of the Material Type Folder
type
string
read-only
Model type
stock-material-type-folder
attributes
object
material_type_folder_id
string
read-only
ID of the material type folder
Example: 1
parent_id
string
ID of the associated folder of the material type folder
Example: 1
name
string
Name of the material type folder
Example: Chemical
code
string
Code of the material type folder
Example: CH-00001
created_at
string (date-time)
Creation date
Example: 2021-01-01 00:00:00
updated_at
string (date-time)
Last update date
Example: 2021-01-01 00:00:00
deleted_at
string (date-time) | null
Deletion date
Example: 2021-01-01 00:00:00
status
string
error
error
object
http_code
integer
401
message
string
Example: Authentication token invalid.
more_info
string
status
string
error
error
object
http_code
integer
429
message
string
Example: Too Many Requests.
more_info
string
status
string
error
error
object
http_code
integer
500
message
string
Example: An error has occurred during the request.
more_info
string
curl -X POST \
'https://api.sandbox.infraspeak.com/v3/stocks/material-types/folders' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_API_TOKEN' \
-d '{
"name": "Material Type Folder 1",
"code": "MTF1",
"parent_id": "1"
}'
const response = await fetch('https://api.sandbox.infraspeak.com/v3/stocks/material-types/folders', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_TOKEN',
},
body: JSON.stringify({
"name": "Material Type Folder 1",
"code": "MTF1",
"parent_id": "1"
}),
});
const data = await response.json();
$response = Http::withHeaders([
'Accept' => 'application/json',
'Content-Type' => 'application/json',
])->withToken('YOUR_API_TOKEN')
->post('https://api.sandbox.infraspeak.com/v3/stocks/material-types/folders',
array (
'name' => 'Material Type Folder 1',
'code' => 'MTF1',
'parent_id' => '1',
)
);
import requests
response = requests.post(
'https://api.sandbox.infraspeak.com/v3/stocks/material-types/folders',
headers={
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_TOKEN',
},
json={
{
"name": "Material Type Folder 1",
"code": "MTF1",
"parent_id": "1"
}
},
)
data = response.json()