Move to Folder

Move Folder to another Folder

HTTP Request

POST https://api.formapi.io/api/v1/folders/<FOLDER_ID>/move

Authentication

You must send an Authorization header with the value Basic followed by base 64 encoded token_id:token_secret.

For example: Authorization: Basic dG9rZW5faWQ6dG9rZW5fc2VjcmV0Cg==

See the Authentication documentation for more information.

Parameters

The request body must be a JSON object with the following properties:

  • parent_folder_id (string, optional): The folder id to move the folder into. Omit this parameter to move to root folder

Example Response

{
  "id": "fld_000000000000000001",
  "name": "Folder 1",
  "path": "/Folder 2",
  "parent_folder_id": "fld_000000000000000002"
}

Example Code

import FormAPI from "formapi";

const config = new FormAPI.Configuration();
config.apiTokenId = "API_TOKEN_ID";
config.apiTokenSecret = "API_TOKEN_SECRET";
client = new FormAPI.Client(config);

var data = {
  "parent_folder_id": "fld_000000000000000002"
}

var folderId = "fld_000000000000000001";
client.moveFolderToFolder(folderId, data, function(error, folder, response) {
  if (error) {
    console.log(response.body);
    return
  } else {
    console.log(folder);
  }
});
require 'form_api'

ENV['FORMAPI_TOKEN_ID'] = "API_TOKEN_ID"
ENV['FORMAPI_TOKEN_SECRET'] = "API_TOKEN_SECRET"

FormAPI.configure do |c|
  c.username  = ENV['FORMAPI_TOKEN_ID']
  c.password  = ENV['FORMAPI_TOKEN_SECRET']
end

formapi = FormAPI::Client.new

folder_id = "fld_000000000000000001"

response = formapi.move_folder_to_folder(folder_id,
  parent_folder_id: "fld_000000000000000002"
)
puts response
import form_api

client = form_api.Client()
client.api_client.configuration.username = "API_TOKEN_ID"
client.api_client.configuration.password = "API_TOKEN_SECRET"

folder_id = 'fld_000000000000000001'
response = client.move_folder_to_folder(folder_id,
  {
    "parent_folder_id": "fld_000000000000000002"
  }
)

print(response)
<?php
$formapi = new FormAPI\Client();
$formapi->getConfig()->setUsername('YOUR_API_TOKEN_ID');
$formapi->getConfig()->setPassword('YOUR_API_TOKEN_SECRET');

$params = new FormAPI\Model\MoveFolderData([
  "parent_folder_id" => "fld_000000000000000002" 
]);

$folder_id = 'fld_000000000000000001';
$folder = $formapi->moveFolderToFolder($folder_id, $params);
echo $folder;
using System;
using System.Diagnostics;
using FormApi.Client.Api;
using FormApi.Client.Client;
using FormApi.Client.Model;

namespace Example
{
    public class FormAPIExample
    {
        public void main()
        {
          Configuration.Default.Username = "API_TOKEN_ID";
          Configuration.Default.Password = "API_TOKEN_SECRET";

          var apiInstance = new PDFApi();

          var moveFolderData = new MoveFolderData(
            parent_folder_id": "fld_000000000000000002"
          );

          var folderId = 'fld_000000000000000001';
          var response = apiInstance.MoveFolderToFolder(folderId, moveFolderData);
          Debug.WriteLine(response);
        }
    }
}

The following example waits for the PDF to be processed, then prints the download URL.

export API_TOKEN_ID="API_TOKEN_ID"
export API_TOKEN_SECRET="API_TOKEN_SECRET"

export FOLDER_ID="fld_000000000000000001"

move_folder() {
  curl -s "https://api.formapi.io/api/v1/folders/$FOLDER_ID/move" \
    -u "$API_TOKEN_ID:$API_TOKEN_SECRET" \
    -H "Content-Type: application/json" \
    -X POST \
    -d '{"parent_folder_id": "fld_000000000000000002"}'
}

RESPONSE=$(move_folder)
echo $RESPONSE

results matching ""

    No results matching ""