Get Info for a Directory

How do I get info about a single directory?

To get info about a single directory you have already created, use the /directories/[replace directory id here]/info endpoint.

The id is the unique id corresponding to your directory. Directories also have names, parent_directory_id, and created_at (a Unix timestamp of when it was created). If there is no parent directory, for example if the object is at your root, then parent_directory_id will be null. "contents" will be present if there are files or directories in this directory. The contents array will contain the ids of the files and directories.

The response will be a JSON object with the directory's info.

Example response:

    
{
	"success": true,
	"directory": {
		"id": "dmxp3",
		"created_at": 1686892114000,
		"name": "my_folder",
		"parent_directory_id": "dtz0m",
		"contents": ["hdr0", "hlq3"]
	}
}
    
    

Ruby code to get directory info:

      
require 'net/http'
require 'uri'

uri = URI.parse("https://api1.docalysis.com/api/v1/directories/[directory id]/info")
request = Net::HTTP::Get.new(uri)
request["Authorization"] = "Bearer your_api_key_here"

req_options = {
  use_ssl: true,
}

response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
  http.request(request)
end

puts response.body