Folder MetaData [UPDATE] Method (PATCH)

Folder Media [UPDATE] method is used to add/edit folder metadata.

Additional Request Parameters.

  • folder_id: unique identifier of the target folder (in the request headline);
  • Mandatory metadata entries and values in "entry":"value" format (in the request body).

Request Examples.

Example of running the Folder MetaData [UPDATE] method in Postman:

Examples of PATCH request syntax using Folder MetaData [UPDATE] method with following parameters:

  • Folder ID “4dfa27bb-1b89-46ab-b488-faf87046471b”;
  • Adding metadata:
    • Entry "test1", value "appended_value_5";
    • Entry "test2", value "modified_value_2";
    • Entry "test3", value "01238823";
    • Entry "test4", value "123124241";

HTTP

Bash

Python

php

Java


PATCH /api/folders/4dfa27bb-1b89-46ab-b488-faf87046471b/meta_data/ HTTP/1.1
Host: api-d.oz-services.ru
X-Forensic-Access-Token: 0ccbdb4627c9d07c6c5b8f6e6cca44b5f8cb0c54ad7659098fa336240d494b0f9035e14bc42fc461224a9719f105e41026fed0f6f14188d9107b8c3d697a0cb1
Content-Type: application/json
User-Agent: PostmanRuntime/7.15.2
Accept: */*
Cache-Control: no-cache
Postman-Token: 3822d50c-d853-429d-b520-420457a0da20,960e1cf6-5545-4080-afc2-377accccc32c
Host: api-d.oz-services.ru
Accept-Encoding: gzip, deflate
Content-Length: 111
Connection: keep-alive
cache-control: no-cache

{
  "test1": "appended_value_5",
  "test2": "modified_value_2",
  "test3": "01238823",
  "test4": "123124241"
}


curl -X PATCH \
  https://api-d.oz-services.ru/api/folders/4dfa27bb-1b89-46ab-b488-faf87046471b/meta_data/ \
  -H 'Accept: */*' \
  -H 'Accept-Encoding: gzip, deflate' \
  -H 'Cache-Control: no-cache' \
  -H 'Connection: keep-alive' \
  -H 'Content-Length: 111' \
  -H 'Content-Type: application/json' \
  -H 'Host: api-d.oz-services.ru' \
  -H 'Postman-Token: 3822d50c-d853-429d-b520-420457a0da20,6e035a57-5cd6-4065-a686-fba5e4a9f8ae' \
  -H 'User-Agent: PostmanRuntime/7.15.2' \
  -H 'X-Forensic-Access-Token: 0ccbdb4627c9d07c6c5b8f6e6cca44b5f8cb0c54ad7659098fa336240d494b0f9035e14bc42fc461224a9719f105e41026fed0f6f14188d9107b8c3d697a0cb1' \
  -H 'cache-control: no-cache' \
  -d '{
  "test1": "appended_value_5",
  "test2": "modified_value_2",
  "test3": "01238823",
  "test4": "123124241"
}'


import requests

url = "https://api-d.oz-services.ru/api/folders/4dfa27bb-1b89-46ab-b488-faf87046471b/meta_data/"

payload = "{\n  \"test1\": \"appended_value_5\",\n  \"test2\": \"modified_value_2\",\n  \"test3\": \"01238823\",\n  \"test4\": \"123124241\"\n}"
headers = {
    'X-Forensic-Access-Token': "0ccbdb4627c9d07c6c5b8f6e6cca44b5f8cb0c54ad7659098fa336240d494b0f9035e14bc42fc461224a9719f105e41026fed0f6f14188d9107b8c3d697a0cb1",
    'Content-Type': "application/json",
    'User-Agent': "PostmanRuntime/7.15.2",
    'Accept': "*/*",
    'Cache-Control': "no-cache",
    'Postman-Token': "3822d50c-d853-429d-b520-420457a0da20,4450f17a-6981-415a-b73c-3cc5c6558a1a",
    'Host': "api-d.oz-services.ru",
    'Accept-Encoding': "gzip, deflate",
    'Content-Length': "111",
    'Connection': "keep-alive",
    'cache-control': "no-cache"
    }

response = requests.request("PATCH", url, data=payload, headers=headers)

print(response.text)


setUrl('https://api-d.oz-services.ru/api/folders/4dfa27bb-1b89-46ab-b488-faf87046471b/meta_data/');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);

$request->setHeaders(array(
  'cache-control' => 'no-cache',
  'Connection' => 'keep-alive',
  'Content-Length' => '111',
  'Accept-Encoding' => 'gzip, deflate',
  'Host' => 'api-d.oz-services.ru',
  'Postman-Token' => '3822d50c-d853-429d-b520-420457a0da20,165bd42c-6a40-4b9a-aeb2-8c7163cad2ff',
  'Cache-Control' => 'no-cache',
  'Accept' => '*/*',
  'User-Agent' => 'PostmanRuntime/7.15.2',
  'Content-Type' => 'application/json',
  'X-Forensic-Access-Token' => '0ccbdb4627c9d07c6c5b8f6e6cca44b5f8cb0c54ad7659098fa336240d494b0f9035e14bc42fc461224a9719f105e41026fed0f6f14188d9107b8c3d697a0cb1'
));

$request->setBody('{
  "test1": "appended_value_5",
  "test2": "modified_value_2",
  "test3": "01238823",
  "test4": "123124241"
}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}


OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n  \"test1\": \"appended_value_5\",\n  \"test2\": \"modified_value_2\",\n  \"test3\": \"01238823\",\n  \"test4\": \"123124241\"\n}");
Request request = new Request.Builder()
  .url("https://api-d.oz-services.ru/api/folders/4dfa27bb-1b89-46ab-b488-faf87046471b/meta_data/")
  .patch(body)
  .addHeader("X-Forensic-Access-Token", "0ccbdb4627c9d07c6c5b8f6e6cca44b5f8cb0c54ad7659098fa336240d494b0f9035e14bc42fc461224a9719f105e41026fed0f6f14188d9107b8c3d697a0cb1")
  .addHeader("Content-Type", "application/json")
  .addHeader("User-Agent", "PostmanRuntime/7.15.2")
  .addHeader("Accept", "*/*")
  .addHeader("Cache-Control", "no-cache")
  .addHeader("Postman-Token", "3822d50c-d853-429d-b520-420457a0da20,a8e83d1e-2aa5-4599-8d58-e88457efb10a")
  .addHeader("Host", "api-d.oz-services.ru")
  .addHeader("Accept-Encoding", "gzip, deflate")
  .addHeader("Content-Length", "111")
  .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 MetaData [UPDATE] method with similar settings:

JSON


{
    "iin": "test11234567",
    "test1": "appended_value_5",
    "test2": "modified_value_2",
    "test3": "01238823",
    "test4": "123124241"
}

Details of JSON Response.

Response after a successful accomplishment of the method contains all current metadata entries for the folder in "entry":"value” format.