Folder [ADD] method (POST)
Folder [ADD] method is used to create folders in the system, add files to folders, assign tags to files and metadata to folders.
Additional Request Parameters.
All parameters for this method are optional and can be added to the request body. All parameters are mandatory.
- photo1…photoN – picture files to be added to the folder (in the request body);
- video1…videoN – video files to be added to the folder (in the request body);
- payload – variable that contains tags and metadata (In the request body.)
Structure of “payload” variable.
The variable is described in JSON format.
Block "folder:meta_data" contains folder metadata; entries and their values can be of any kind as long as the format “entry”: "value” is maintained.
Block "media:tags" contains tags of files stored in the folder. Files stored in the system must have correct tags to be analyzed correctly. Possible values of tags in the system.
Request Examples.
Example of running the Folder [ADD] method in Postman:


Examples of POST request syntax using Folder [ADD] method with following parameters:
- Add 2 photo and 2 video files to the folder;
- Add entry "test" with the value "test11234567” to metadata;
- Add entry "test" with the value "test11234567” to metadata;
- Add tag "photo_selfie” to file photo2;
- Add tags "video_selfie", "video_selfie_zoom_in", "orientation_portrait” to file video1;
- Add tags "video_selfie", "video_selfie_zoom_out", "orientation_portrait” to file video2.
HTTP
Bash
Python
php
Java
POST /api/folders/ HTTP/1.1
Host: youradress.ru
X-Forensic-Access-Token: 0ccbdb4627c9d07c6c5b8f6e6cca44b5f8cb0c54ad7659098fa336240d494b0f9035e14bc42fc461224a9719f105e41026fed0f6f14188d9107b8c3d697a0cb1
User-Agent: PostmanRuntime/7.15.2
Accept: */*
Cache-Control: no-cache
Postman-Token: c6d49ae7-7e7c-4fc1-87fa-6eb621db96fe,5b6365b1-fe86-45e4-9a83-624edd41e799
Host: youradress.ru
Accept-Encoding: gzip, deflate
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Length: 12292189
Connection: keep-alive
cache-control: no-cache
Content-Disposition: form-data; name="photo1"; filename="/X:/1.jpg
------WebKitFormBoundary7MA4YWxkTrZu0gW--,
Content-Disposition: form-data; name="photo1"; filename="/X:/1.jpg
------WebKitFormBoundary7MA4YWxkTrZu0gW--
Content-Disposition: form-data; name="photo2"; filename="/X:/2.jpg
------WebKitFormBoundary7MA4YWxkTrZu0gW--,
Content-Disposition: form-data; name="photo1"; filename="/X:/1.jpg
------WebKitFormBoundary7MA4YWxkTrZu0gW--
Content-Disposition: form-data; name="photo2"; filename="/X:/2.jpg
------WebKitFormBoundary7MA4YWxkTrZu0gW--
Content-Disposition: form-data; name="video1"; filename="/X:/372d54ce-80f4-4d2e-a3c3-708f6162e599.mp4
------WebKitFormBoundary7MA4YWxkTrZu0gW--,
Content-Disposition: form-data; name="photo1"; filename="/X:/1.jpg
------WebKitFormBoundary7MA4YWxkTrZu0gW--
Content-Disposition: form-data; name="photo2"; filename="/X:/2.jpg
------WebKitFormBoundary7MA4YWxkTrZu0gW--
Content-Disposition: form-data; name="video1"; filename="/X:/372d54ce-80f4-4d2e-a3c3-708f6162e599.mp4
------WebKitFormBoundary7MA4YWxkTrZu0gW--
Content-Disposition: form-data; name="payload"
{
"folder:meta_data": {
"test": "test11234567"
},
"media:tags": {
"video1": [
"video_selfie",
"video_selfie_zoom_in",
"orientation_portrait"
],
"video2": [
"video_selfie",
"video_selfie_zoom_out",
"orientation_portrait"
],
"photo1": [
"photo_id"
],
"photo2": [
"photo_selfie"
]
}
}
------WebKitFormBoundary7MA4YWxkTrZu0gW--,
Content-Disposition: form-data; name="photo1"; filename="/X:/1.jpg
------WebKitFormBoundary7MA4YWxkTrZu0gW--
Content-Disposition: form-data; name="photo2"; filename="/X:/2.jpg
------WebKitFormBoundary7MA4YWxkTrZu0gW--
Content-Disposition: form-data; name="video1"; filename="/X:/372d54ce-80f4-4d2e-a3c3-708f6162e599.mp4
------WebKitFormBoundary7MA4YWxkTrZu0gW--
Content-Disposition: form-data; name="payload"
{
"folder:meta_data": {
"test": "test11234567"
},
"media:tags": {
"video1": [
"video_selfie",
"video_selfie_zoom_in",
"orientation_portrait"
],
"video2": [
"video_selfie",
"video_selfie_zoom_out",
"orientation_portrait"
],
"photo1": [
"photo_id"
],
"photo2": [
"photo_selfie"
]
}
}
------WebKitFormBoundary7MA4YWxkTrZu0gW--
Content-Disposition: form-data; name="video2"; filename="/X:/2c2177a1-ed2b-4443-b2c7-e489ab205fd4.mp4
------WebKitFormBoundary7MA4YWxkTrZu0gW--
curl -X POST \
https://youradress.ru/api/folders/ \
-H 'Accept: */*' \
-H 'Accept-Encoding: gzip, deflate' \
-H 'Cache-Control: no-cache' \
-H 'Connection: keep-alive' \
-H 'Content-Length: 12292189' \
-H 'Content-Type: multipart/form-data; boundary=--------------------------871104747068739662264204' \
-H 'Host: youradress.ru' \
-H 'Postman-Token: c6d49ae7-7e7c-4fc1-87fa-6eb621db96fe,de42f6de-d236-4df5-bbfc-965b04c73b9f' \
-H 'User-Agent: PostmanRuntime/7.15.2' \
-H 'X-Forensic-Access-Token: 0ccbdb4627c9d07c6c5b8f6e6cca44b5f8cb0c54ad7659098fa336240d494b0f9035e14bc42fc461224a9719f105e41026fed0f6f14188d9107b8c3d697a0cb1' \
-H 'cache-control: no-cache' \
-H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
-F 'photo1=@/X:/1.jpg' \
-F 'photo2=@/X:/2.jpg' \
-F 'video1=@/X:/372d54ce-80f4-4d2e-a3c3-708f6162e599.mp4' \
-F 'payload={
"folder:meta_data": {
"test": "test11234567"
},
"media:tags": {
"video1": [
"video_selfie",
"video_selfie_zoom_in",
"orientation_portrait"
],
"video2": [
"video_selfie",
"video_selfie_zoom_out",
"orientation_portrait"
],
"photo1": [
"photo_id"
],
"photo2": [
"photo_selfie"
]
}
}' \
-F 'video2=@/X:/2c2177a1-ed2b-4443-b2c7-e489ab205fd4.mp4'
import requests
url = "https://youradress.ru/api/folders/"
payload = "------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"photo1\"; filename=\"1.jpg\"\r\nContent-Type: image/jpeg\r\n\r\n\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"photo2\"; filename=\"2.jpg\"\r\nContent-Type: image/jpeg\r\n\r\n\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"video1\"; filename=\"372d54ce-80f4-4d2e-a3c3-708f6162e599.mp4\"\r\nContent-Type: video/mp4\r\n\r\n\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"payload\"\r\n\r\n{\n \"folder:meta_data\": {\n \"test\": \"test11234567\"\n },\n \"media:tags\": {\n \"video1\": [\n \"video_selfie\",\n \"video_selfie_zoom_in\",\n \"orientation_portrait\"\n ],\n\t \"video2\": [\n \"video_selfie\",\n \"video_selfie_zoom_out\",\n \"orientation_portrait\"\n ],\n \"photo1\": [\n \"photo_id\"\n ],\n \"photo2\": [\n \"photo_selfie\"\n ]\n }\n}\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"video2\"; filename=\"2c2177a1-ed2b-4443-b2c7-e489ab205fd4.mp4\"\r\nContent-Type: video/mp4\r\n\r\n\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW--"
headers = {
'content-type': "multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW",
'X-Forensic-Access-Token': "0ccbdb4627c9d07c6c5b8f6e6cca44b5f8cb0c54ad7659098fa336240d494b0f9035e14bc42fc461224a9719f105e41026fed0f6f14188d9107b8c3d697a0cb1",
'User-Agent': "PostmanRuntime/7.15.2",
'Accept': "*/*",
'Cache-Control': "no-cache",
'Postman-Token': "c6d49ae7-7e7c-4fc1-87fa-6eb621db96fe,59850a03-3261-4dd3-8fdb-550985ba5530",
'Host': "youradress.ru",
'Accept-Encoding': "gzip, deflate",
'Content-Type': "multipart/form-data; boundary=--------------------------871104747068739662264204",
'Content-Length': "12292189",
'Connection': "keep-alive",
'cache-control': "no-cache"
}
response = requests.request("POST", url, data=payload, headers=headers)
print(response.text)
setUrl('https://youradress.ru/api/folders/');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders(array(
'cache-control' => 'no-cache',
'Connection' => 'keep-alive',
'Content-Length' => '12292189',
'Content-Type' => 'multipart/form-data; boundary=--------------------------871104747068739662264204',
'Accept-Encoding' => 'gzip, deflate',
'Host' => 'youradress.ru',
'Postman-Token' => 'c6d49ae7-7e7c-4fc1-87fa-6eb621db96fe,965a0a32-6e92-4e34-97dc-b92648ef4371',
'Cache-Control' => 'no-cache',
'Accept' => '*/*',
'User-Agent' => 'PostmanRuntime/7.15.2',
'X-Forensic-Access-Token' => '0ccbdb4627c9d07c6c5b8f6e6cca44b5f8cb0c54ad7659098fa336240d494b0f9035e14bc42fc461224a9719f105e41026fed0f6f14188d9107b8c3d697a0cb1',
'content-type' => 'multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW'
));
$request->setBody('------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="photo1"; filename="1.jpg"
Content-Type: image/jpeg
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="photo2"; filename="2.jpg"
Content-Type: image/jpeg
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="video1"; filename="372d54ce-80f4-4d2e-a3c3-708f6162e599.mp4"
Content-Type: video/mp4
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="payload"
{
"folder:meta_data": {
"test": "test11234567"
},
"media:tags": {
"video1": [
"video_selfie",
"video_selfie_zoom_in",
"orientation_portrait"
],
"video2": [
"video_selfie",
"video_selfie_zoom_out",
"orientation_portrait"
],
"photo1": [
"photo_id"
],
"photo2": [
"photo_selfie"
]
}
}
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="video2"; filename="2c2177a1-ed2b-4443-b2c7-e489ab205fd4.mp4"
Content-Type: video/mp4
------WebKitFormBoundary7MA4YWxkTrZu0gW--');
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW");
RequestBody body = RequestBody.create(mediaType, "------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"photo1\"; filename=\"1.jpg\"\r\nContent-Type: image/jpeg\r\n\r\n\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"photo2\"; filename=\"2.jpg\"\r\nContent-Type: image/jpeg\r\n\r\n\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"video1\"; filename=\"372d54ce-80f4-4d2e-a3c3-708f6162e599.mp4\"\r\nContent-Type: video/mp4\r\n\r\n\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"payload\"\r\n\r\n{\n \"folder:meta_data\": {\n \"test\": \"test11234567\"\n },\n \"media:tags\": {\n \"video1\": [\n \"video_selfie\",\n \"video_selfie_zoom_in\",\n \"orientation_portrait\"\n ],\n\t \"video2\": [\n \"video_selfie\",\n \"video_selfie_zoom_out\",\n \"orientation_portrait\"\n ],\n \"photo1\": [\n \"photo_id\"\n ],\n \"photo2\": [\n \"photo_selfie\"\n ]\n }\n}\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"video2\"; filename=\"2c2177a1-ed2b-4443-b2c7-e489ab205fd4.mp4\"\r\nContent-Type: video/mp4\r\n\r\n\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW--");
Request request = new Request.Builder()
.url("https://youradress.ru/api/folders/")
.post(body)
.addHeader("content-type", "multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW")
.addHeader("X-Forensic-Access-Token", "0ccbdb4627c9d07c6c5b8f6e6cca44b5f8cb0c54ad7659098fa336240d494b0f9035e14bc42fc461224a9719f105e41026fed0f6f14188d9107b8c3d697a0cb1")
.addHeader("User-Agent", "PostmanRuntime/7.15.2")
.addHeader("Accept", "*/*")
.addHeader("Cache-Control", "no-cache")
.addHeader("Postman-Token", "c6d49ae7-7e7c-4fc1-87fa-6eb621db96fe,fcc497bb-c480-4661-9a0a-00073d2a8ee6")
.addHeader("Host", "youradress.ru")
.addHeader("Accept-Encoding", "gzip, deflate")
.addHeader("Content-Type", "multipart/form-data; boundary=--------------------------871104747068739662264204")
.addHeader("Content-Length", "12292189")
.addHeader("Connection", "keep-alive")
.addHeader("cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
Example of JSON Response
Example of the system's JSON response to calling Folder [ADD] method with similar parameters:
JSON
{
"time_created": 1579853333,
"time_updated": 1579853333,
"meta_data": {
"test": "test11234567"
},
"folder_id": "f5fea1c1-5797-487a-b0f5-673eea2f8a79",
"resolution_time": null,
"resolution_status": "INITIAL",
"resolution_endpoint": null,
"resolution_state_hash": "007c5bbe5beaab65",
"resolution_comment": null,
"resolution_suggest": null,
"resolution_author_id": null,
"is_archive": false,
"media": [
{
"time_created": 1579853333,
"time_updated": 1579853333,
"meta_data": {},
"media_id": "47e235cc-8844-4716-9c3d-2e37764fe15f",
"media_type": "IMAGE_FOLDER",
"info": {
"thumb": {
"md5": "933fa1f5dd44d2c43f75e8044d4fa7a1",
"size": 17070,
"width": 300,
"height": 280,
"mime-type": "image/jpeg"
},
"original": {
"md5": "54b5d75d01488817bf041a5273de4585",
"size": 50971,
"width": 445,
"height": 416,
"mime-type": "image/jpeg"
}
},
"tags": [
"photo_selfie"
],
"original_name": "2.jpg",
"image_id": "47e235cc-8844-4716-9c3d-2e37764fe15f",
"original_url": "http://youradress.ru/static/f5fea1c1-5797-487a-b0f5-673eea2f8a79/47e235cc-8844-4716-9c3d-2e37764fe15f.jpeg",
"thumb_url": "http://youradress.ru/static/f5fea1c1-5797-487a-b0f5-673eea2f8a79/47e235cc-8844-4716-9c3d-2e37764fe15f_thumb.jpeg"
},
{
"time_created": 1579853333,
"time_updated": 1579853333,
"meta_data": {},
"media_id": "f35716ed-7abf-4198-8146-229eb4f2ad25",
"media_type": "IMAGE_FOLDER",
"info": {
"thumb": {
"md5": "1827f89da365f01a24deb0329d231f80",
"size": 18261,
"width": 300,
"height": 300,
"mime-type": "image/jpeg"
},
"original": {
"md5": "9b1393886e54d93e1303ff284ae4dedf",
"size": 147204,
"width": 492,
"height": 492,
"mime-type": "image/jpeg"
}
},
"tags": [
"photo_id"
],
"original_name": "1.jpg",
"image_id": "f35716ed-7abf-4198-8146-229eb4f2ad25",
"original_url": "http://youradress.ru/static/f5fea1c1-5797-487a-b0f5-673eea2f8a79/f35716ed-7abf-4198-8146-229eb4f2ad25.jpeg",
"thumb_url": "http://youradress.ru/static/f5fea1c1-5797-487a-b0f5-673eea2f8a79/f35716ed-7abf-4198-8146-229eb4f2ad25_thumb.jpeg"
},
{
"time_created": 1579853333,
"time_updated": 1579853333,
"meta_data": {},
"media_id": "4ad2ef2b-24ab-44ee-ae50-17d41bce6927",
"media_type": "VIDEO_FOLDER",
"info": {
"thumb": {
"md5": "65c26e859cd0ab26858c59ac68d27956",
"size": 18510,
"width": 225,
"height": 300,
"mime-type": "image/jpeg"
},
"video": {
"FPS": 30.0,
"md5": "aff630574ccfaf1eba06aaf44c9b12ca",
"size": 5969474,
"width": 800,
"height": 600,
"duration": 4.84,
"mime-type": "video/mp4"
},
"preview": {
"FPS": 30.0,
"md5": "aff630574ccfaf1eba06aaf44c9b12ca",
"size": 5969474,
"width": 800,
"height": 600,
"duration": 4.84,
"mime-type": "video/mp4"
}
},
"tags": [
"video_selfie",
"video_selfie_zoom_out",
"orientation_portrait"
],
"original_name": "2c2177a1-ed2b-4443-b2c7-e489ab205fd4.mp4",
"video_id": "4ad2ef2b-24ab-44ee-ae50-17d41bce6927",
"video_url": "http://youradress.ru/static/f5fea1c1-5797-487a-b0f5-673eea2f8a79/4ad2ef2b-24ab-44ee-ae50-17d41bce6927.mp4",
"thumb_url": "http://youradress.ru/static/f5fea1c1-5797-487a-b0f5-673eea2f8a79/4ad2ef2b-24ab-44ee-ae50-17d41bce6927_thumb.jpg",
"preview_url": "http://youradress.ru/static/f5fea1c1-5797-487a-b0f5-673eea2f8a79/4ad2ef2b-24ab-44ee-ae50-17d41bce6927.mp4"
},
{
"time_created": 1579853333,
"time_updated": 1579853333,
"meta_data": {},
"media_id": "015dfea0-6109-4bcd-93c0-4d1953e77d99",
"media_type": "VIDEO_FOLDER",
"info": {
"thumb": {
"md5": "3a344bc524b988c9d3a6dafd1e0ada4f",
"size": 18740,
"width": 225,
"height": 300,
"mime-type": "image/jpeg"
},
"video": {
"FPS": 30.0,
"md5": "2b90287b90e84ce1417f86d0081c4d79",
"size": 6123340,
"width": 800,
"height": 600,
"duration": 4.92,
"mime-type": "video/mp4"
},
"preview": {
"FPS": 30.0,
"md5": "2b90287b90e84ce1417f86d0081c4d79",
"size": 6123340,
"width": 800,
"height": 600,
"duration": 4.92,
"mime-type": "video/mp4"
}
},
"tags": [
"video_selfie",
"video_selfie_zoom_in",
"orientation_portrait"
],
"original_name": "372d54ce-80f4-4d2e-a3c3-708f6162e599.mp4",
"video_id": "015dfea0-6109-4bcd-93c0-4d1953e77d99",
"video_url": "http://youradress.ru/static/f5fea1c1-5797-487a-b0f5-673eea2f8a79/015dfea0-6109-4bcd-93c0-4d1953e77d99.mp4",
"thumb_url": "http://youradress.ru/static/f5fea1c1-5797-487a-b0f5-673eea2f8a79/015dfea0-6109-4bcd-93c0-4d1953e77d99_thumb.jpg",
"preview_url": "http://youradress.ru/static/f5fea1c1-5797-487a-b0f5-673eea2f8a79/015dfea0-6109-4bcd-93c0-4d1953e77d99.mp4"
}
]
}
Details of JSON Response.
First block of the response (strings 2–15) contains the main information on the folder.
Block "media" (strings 21–166) contains information on files stored in the folder.