### List Users in Account (Go) Source: https://next.developer.frame.io/platform/api-reference/account-permissions/index Example of how to list users in a specific account using a direct HTTP GET request. ```APIDOC ## GET /v4/accounts/{account_id}/users ### Description Retrieves a list of users associated with a specific account. ### Method GET ### Endpoint /v4/accounts/{account_id}/users ### Parameters #### Path Parameters - **account_id** (string) - Required - The ID of the account. ### Request Example ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.frame.io/v4/accounts/079637b7-5488-408d-8b55-215e67a42f20/users" req, _ := http.NewRequest("GET", url, nil) res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ### Response #### Success Response (200) - **users** (array) - A list of user objects. #### Response Example ```json { "users": [ { "id": "user_id_1", "name": "John Doe", "email": "john.doe@example.com" } ] } ``` ``` -------------------------------- ### Fetch Folder Children with Media Links (Go) Source: https://next.developer.frame.io/platform/api-reference/folders/index This Go example illustrates fetching folder children with media links by making a direct HTTP GET request to the Frame.io API. It handles request creation, execution, and response body reading. ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.frame.io/v4/accounts/88895470-474d-444d-8ada-0e96d9ebbbd6/folders/219d3cdb-bdcc-43a6-90e0-b2271e361613/children?include=media_links" req, _ := http.NewRequest("GET", url, nil) res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` -------------------------------- ### Fetch File Metadata using Frame.io Client (Python) Source: https://next.developer.frame.io/platform/api-reference/metadata/show This Python example demonstrates how to instantiate the Frame.io client and call the metadata show method to get file metadata. It requires the 'frameio' library and specifies the base URL. ```python from frameio import Frameio client = Frameio( base_url="https://api.frame.io" ) client.metadata.show( account_id="e01731f4-50f2-4a87-901f-09e9b3216f20", file_id="708b277e-3e49-45a4-baf3-27a633dfd677" ) ``` -------------------------------- ### Fetch Comment Details via HTTP GET (Ruby) Source: https://next.developer.frame.io/platform/api-reference/comments/show Shows how to fetch comment details in Ruby using Net::HTTP. This example constructs a URI, sets up an HTTP connection with SSL, sends a GET request, and prints the response body. ```ruby require 'uri' require 'net/http' url = URI("https://api.frame.io/v4/accounts/4185f7a7-e7b4-4c95-9bfd-9ebd636885f4/comments/e6f4665e-98ef-43c8-9f04-2bab607b6e9b") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) response = http.request(request) puts response.read_body ``` -------------------------------- ### Fetch Folder Children with Media Links (Swift) Source: https://next.developer.frame.io/platform/api-reference/folders/index This Swift example shows how to fetch folder children, including media links, using URLSession and NSMutableURLRequest. It configures the request and initiates a data task to get the response. ```swift import Foundation let request = NSMutableURLRequest(url: NSURL(string: "https://api.frame.io/v4/accounts/88895470-474d-444d-8ada-0e96d9ebbbd6/folders/219d3cdb-bdcc-43a6-90e0-b2271e361613/children?include=media_links")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` -------------------------------- ### Fetch Account Users via HTTP Request (PHP) Source: https://next.developer.frame.io/platform/api-reference/account-permissions/index Shows a PHP example for fetching account users using the GuzzleHttp client. This code performs a GET request to the Frame.io API and echoes the response body. The GuzzleHttp library must be installed. ```php request('GET', 'https://api.frame.io/v4/accounts/079637b7-5488-408d-8b55-215e67a42f20/users'); echo $response->getBody(); ``` -------------------------------- ### Create Folder using Frame.io TypeScript SDK Source: https://next.developer.frame.io/platform/api-reference/folders/create This example demonstrates how to create a new folder within a specified account and parent folder using the official Frame.io TypeScript SDK. It requires the 'frameio' package to be installed and configured with appropriate authentication. ```typescript import { FrameioClient } from "frameio"; async function main() { const client = new FrameioClient({ environment: "https://api.frame.io", }); await client.folders.create("e921bf2c-e7ca-481e-ab9f-1938c53252aa", "7367a3e0-792e-4cc1-871e-4d27c40cf048", { data: { name: "Folder name", }, }); } main(); ``` -------------------------------- ### Fetch Folder Children with Media Links (PHP) Source: https://next.developer.frame.io/platform/api-reference/folders/index This PHP example utilizes the Guzzle HTTP client to perform a GET request to the Frame.io API for retrieving folder children and their media links. It then echoes the response body. ```php request('GET', 'https://api.frame.io/v4/accounts/88895470-474d-444d-8ada-0e96d9ebbbd6/folders/219d3cdb-bdcc-43a6-90e0-b2271e361613/children?include=media_links'); echo $response->getBody(); ``` -------------------------------- ### Fetch Account Users via HTTP Request (C#) Source: https://next.developer.frame.io/platform/api-reference/account-permissions/index An example in C# demonstrating how to fetch account users using the RestSharp library. It constructs a GET request to the Frame.io API and executes it, returning the response. ```csharp var client = new RestClient("https://api.frame.io/v4/accounts/079637b7-5488-408d-8b55-215e67a42f20/users"); var request = new RestRequest(Method.GET); IRestResponse response = client.Execute(request); ``` -------------------------------- ### Fetch Folder Information via HTTP Request (Ruby) Source: https://next.developer.frame.io/platform/api-reference/folders/show Provides a Ruby example for fetching folder details by making an HTTP GET request to the Frame.io API. This implementation uses Ruby's built-in Net::HTTP library. ```ruby require 'uri' require 'net/http' url = URI("https://api.frame.io/v4/accounts/9c00a2e6-02c1-4591-af0c-2e4d4ffd9687/folders/59dbd6d6-ba52-451f-95a5-69ba250567ca") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) response = http.request(request) puts response.read_body ``` -------------------------------- ### Fetch Account Users via HTTP Request (Go) Source: https://next.developer.frame.io/platform/api-reference/account-permissions/index Illustrates making a direct HTTP GET request to the Frame.io API to retrieve account users. This example uses Go's standard `net/http` package and requires an account ID. It prints the response status and body. ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.frame.io/v4/accounts/079637b7-5488-408d-8b55-215e67a42f20/users" req, _ := http.NewRequest("GET", url, nil) res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` -------------------------------- ### Fetch File Details with Media Links via C# RestSharp Source: https://next.developer.frame.io/platform/api-reference/files/show This C# code example shows how to fetch file details, including media links, using the RestSharp library. It constructs a GET request to the Frame.io API, including the necessary account and file IDs, and executes the request to retrieve the response. ```csharp var client = new RestClient("https://api.frame.io/v4/accounts/7e98f6a8-1b8c-4e1e-9c83-e0e3a7e35e5a/files/5a7f8e2b-3c4d-4e5f-8a9b-1c2d3e4f5a6b?include=media_links"); var request = new RestRequest(Method.GET); IRestResponse response = client.Execute(request); ``` -------------------------------- ### Fetch Account Users via HTTP Request (Java) Source: https://next.developer.frame.io/platform/api-reference/account-permissions/index Provides a Java example for fetching account users using the Unirest library. This snippet makes a GET request to the Frame.io API and returns the response body as a String. Ensure Unirest is added as a dependency. ```java HttpResponse response = Unirest.get("https://api.frame.io/v4/accounts/079637b7-5488-408d-8b55-215e67a42f20/users") .asString(); ``` -------------------------------- ### Fetch Accounts using Frame.io SDKs and HTTP Clients Source: https://next.developer.frame.io/platform/api-reference/accounts/index Examples show how to fetch account information from the Frame.io API. This typically involves initializing a client with API credentials or base URL and then calling an accounts index method or making a GET request to the /accounts endpoint. Dependencies include the respective SDKs or HTTP libraries for each language. ```typescript import { FrameioClient } from "frameio"; async function main() { const client = new FrameioClient({ environment: "https://api.frame.io", }); await client.accounts.index({}); } main(); ``` ```python from frameio import Frameio client = Frameio( base_url="https://api.frame.io" ) client.accounts.index() ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.frame.io/v4/accounts" req, _ := http.NewRequest("GET", url, nil) res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://api.frame.io/v4/accounts") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) response = http.request(request) puts response.read_body ``` ```java HttpResponse response = Unirest.get("https://api.frame.io/v4/accounts") .asString(); ``` ```php request('GET', 'https://api.frame.io/v4/accounts'); echo $response->getBody(); ``` ```csharp var client = new RestClient("https://api.frame.io/v4/accounts"); var request = new RestRequest(Method.GET); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let request = NSMutableURLRequest(url: NSURL(string: "https://api.frame.io/v4/accounts")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` -------------------------------- ### Fetch File Metadata using RestSharp (C#) Source: https://next.developer.frame.io/platform/api-reference/metadata/show This C# example demonstrates how to use the RestSharp library to execute a GET request to the Frame.io API for retrieving file metadata. It includes client setup and request execution. ```csharp var client = new RestClient("https://api.frame.io/v4/accounts/e01731f4-50f2-4a87-901f-09e9b3216f20/files/708b277e-3e49-45a4-baf3-27a633dfd677/metadata"); var request = new RestRequest(Method.GET); IRestResponse response = client.Execute(request); ``` -------------------------------- ### Fetch Folder Children with Media Links (Python) Source: https://next.developer.frame.io/platform/api-reference/folders/index This Python example shows how to retrieve children of a folder and include media links using the Frameio Python library. It requires initializing the client with the base URL. ```python from frameio import Frameio client = Frameio( base_url="https://api.frame.io" ) client.folders.index( account_id="88895470-474d-444d-8ada-0e96d9ebbbd6", folder_id="219d3cdb-bdcc-43a6-90e0-b2271e361613", include="media_links" ) ``` -------------------------------- ### Fetch Folder Information using Frame.io SDK (TypeScript) Source: https://next.developer.frame.io/platform/api-reference/folders/show Demonstrates how to initialize the Frame.io client and fetch folder details using the SDK in TypeScript. This requires the 'frameio' npm package and an environment configuration. ```typescript import { FrameioClient } from "frameio"; async function main() { const client = new FrameioClient({ environment: "https://api.frame.io", }); await client.folders.show("9c00a2e6-02c1-4591-af0c-2e4d4ffd9687", "59dbd6d6-ba52-451f-95a5-69ba250567ca", {}); } main(); ``` -------------------------------- ### Get Comment Details using URLSession (Swift) Source: https://next.developer.frame.io/platform/api-reference/comments/show Provides a Swift example for retrieving comment details using URLSession. This code constructs an NSMutableURLRequest for a GET request to the specified API endpoint and initiates a data task to fetch the response. ```swift import Foundation let request = NSMutableURLRequest(url: NSURL(string: "https://api.frame.io/v4/accounts/4185f7a7-e7b4-4c95-9bfd-9ebd636885f4/comments/e6f4665e-98ef-43c8-9f04-2bab607b6e9b")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` -------------------------------- ### Create File Metadata using Frame.io SDKs Source: https://next.developer.frame.io/platform/api-reference/files/create Demonstrates how to create file metadata using the Frame.io SDK in multiple languages. This involves initializing the client and calling the files.create method with account ID, folder ID, and file details. Ensure the SDK is installed and configured correctly. ```typescript import { FrameioClient } from "frameio"; async function main() { const client = new FrameioClient({ environment: "https://api.frame.io", }); await client.files.create("53dffbc2-07c1-4c06-90c6-9c128ea1decc", "a48d1abf-db86-488a-95f9-db5a6dfc269c", { data: { fileSize: 1137444, mediaType: "image/png", name: "asset.png", }, }); } main(); ``` ```python from frameio import Frameio client = Frameio( base_url="https://api.frame.io" ) client.files.create( account_id="53dffbc2-07c1-4c06-90c6-9c128ea1decc", folder_id="a48d1abf-db86-488a-95f9-db5a6dfc269c", data={ "file_size": 1137444, "media_type": "image/png", "name": "asset.png" } ) ``` -------------------------------- ### Create Folder using Go HTTP Client Source: https://next.developer.frame.io/platform/api-reference/folders/create This Go program demonstrates creating a folder via the Frame.io API using the standard `net/http` package. It constructs the request URL, sets the JSON payload, and sends a POST request. This approach is useful when a dedicated SDK is not available or preferred. ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.frame.io/v4/accounts/e921bf2c-e7ca-481e-ab9f-1938c53252aa/folders/7367a3e0-792e-4cc1-871e-4d27c40cf048/folders" payload := strings.NewReader("{\n \"data\": {\n \"name\": \"Folder name\"\n }\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` -------------------------------- ### Get Comment Details with Guzzle (PHP) Source: https://next.developer.frame.io/platform/api-reference/comments/show Illustrates how to retrieve comment details in PHP using the Guzzle HTTP client. This example initializes a Guzzle client and makes a GET request to the comments API endpoint, then echoes the response body. ```php request('GET', 'https://api.frame.io/v4/accounts/4185f7a7-e7b4-4c95-9bfd-9ebd636885f4/comments/e6f4665e-98ef-43c8-9f04-2bab607b6e9b'); echo $response->getBody(); ``` -------------------------------- ### Retrieve Comment Details via HTTP GET (Go) Source: https://next.developer.frame.io/platform/api-reference/comments/show Provides a Go example for retrieving comment details by making a direct HTTP GET request to the Frame.io API. This method constructs the URL with account and comment IDs and processes the response body. ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.frame.io/v4/accounts/4185f7a7-e7b4-4c95-9bfd-9ebd636885f4/comments/e6f4665e-98ef-43c8-9f04-2bab607b6e9b" req, _ := http.NewRequest("GET", url, nil) res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` -------------------------------- ### List Files in Frame.io Account and Folder (Multiple Languages) Source: https://next.developer.frame.io/platform/api-reference/files/list Demonstrates how to list files within a specified account and folder in Frame.io using different programming language SDKs and HTTP clients. These examples typically require authentication credentials and specify the account and folder IDs as parameters. ```typescript import { FrameioClient } from "frameio"; async function main() { const client = new FrameioClient({ environment: "https://api.frame.io", }); await client.files.list("e383d342-5a04-411c-a658-fa058ab939e8", "bfd6463f-0d95-432a-a02a-b11c9024eab3", {}); } main(); ``` ```python from frameio import Frameio client = Frameio( base_url="https://api.frame.io" ) client.files.list( account_id="e383d342-5a04-411c-a658-fa058ab939e8", folder_id="bfd6463f-0d95-432a-a02a-b11c9024eab3" ) ``` ```go package main import ( "fmt" "io" "net/http" ) func main() { url := "https://api.frame.io/v4/accounts/e383d342-5a04-411c-a658-fa058ab939e8/folders/bfd6463f-0d95-432a-a02a-b11c9024eab3/files" req, _ := http.NewRequest("GET", url, nil) res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://api.frame.io/v4/accounts/e383d342-5a04-411c-a658-fa058ab939e8/folders/bfd6463f-0d95-432a-a02a-b11c9024eab3/files") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) response = http.request(request) puts response.read_body ``` ```java HttpResponse response = Unirest.get("https://api.frame.io/v4/accounts/e383d342-5a04-411c-a658-fa058ab939e8/folders/bfd6463f-0d95-432a-a02a-b11c9024eab3/files") .asString(); ``` ```php request('GET', 'https://api.frame.io/v4/accounts/e383d342-5a04-411c-a658-fa058ab939e8/folders/bfd6463f-0d95-432a-a02a-b11c9024eab3/files'); echo $response->getBody(); ``` ```csharp var client = new RestClient("https://api.frame.io/v4/accounts/e383d342-5a04-411c-a658-fa058ab939e8/folders/bfd6463f-0d95-432a-a02a-b11c9024eab3/files"); var request = new RestRequest(Method.GET); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let request = NSMutableURLRequest(url: NSURL(string: "https://api.frame.io/v4/accounts/e383d342-5a04-411c-a658-fa058ab939e8/folders/bfd6463f-0d95-432a-a02a-b11c9024eab3/files")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` -------------------------------- ### Fetch Comments using Guzzle (PHP) Source: https://next.developer.frame.io/platform/api-reference/comments/index This PHP example utilizes the Guzzle HTTP client to send a GET request to the Frame.io API to retrieve comments. It then echoes the response body. ```php request('GET', 'https://api.frame.io/v4/accounts/88c8ffe8-2450-47ef-bd85-2549e080a62f/files/a96b29a6-4e65-4101-8616-b44e527d84b1/comments'); echo $response->getBody(); ``` -------------------------------- ### Fetch Folder Children with Media Links (TypeScript) Source: https://next.developer.frame.io/platform/api-reference/folders/index This example demonstrates how to fetch children of a specific folder, including associated media links, using the Frame.io TypeScript SDK. It requires the FrameioClient and specifies the environment and include parameter. ```typescript import { FrameioClient } from "frameio"; async function main() { const client = new FrameioClient({ environment: "https://api.frame.io", }); await client.folders.index("88895470-474d-444d-8ada-0e96d9ebbbd6", "219d3cdb-bdcc-43a6-90e0-b2271e361613", { include: "media_links", }); } main(); ``` -------------------------------- ### Fetch File Metadata using Guzzle (PHP) Source: https://next.developer.frame.io/platform/api-reference/metadata/show This PHP example uses the Guzzle HTTP client to make a GET request to the Frame.io API endpoint for file metadata and echoes the response body. ```php request('GET', 'https://api.frame.io/v4/accounts/e01731f4-50f2-4a87-901f-09e9b3216f20/files/708b277e-3e49-45a4-baf3-27a633dfd677/metadata'); echo $response->getBody(); ``` -------------------------------- ### Fetch File Metadata using Unirest (Java) Source: https://next.developer.frame.io/platform/api-reference/metadata/show This Java example utilizes the Unirest library to perform an HTTP GET request to fetch file metadata from the Frame.io API. It returns the response as a String. ```java HttpResponse response = Unirest.get("https://api.frame.io/v4/accounts/e01731f4-50f2-4a87-901f-09e9b3216f20/files/708b277e-3e49-45a4-baf3-27a633dfd677/metadata") .asString(); ``` -------------------------------- ### Fetch Folder Information using Frame.io SDK (Python) Source: https://next.developer.frame.io/platform/api-reference/folders/show Illustrates fetching folder details using the Frame.io Python SDK. It requires the 'frameio' library to be installed and configured with the base URL. ```python from frameio import Frameio client = Frameio( base_url="https://api.frame.io" ) client.folders.show( account_id="9c00a2e6-02c1-4591-af0c-2e4d4ffd9687", folder_id="59dbd6d6-ba52-451f-95a5-69ba250567ca" ) ``` -------------------------------- ### Fetch File Details with Media Links via HTTP GET Request Source: https://next.developer.frame.io/platform/api-reference/files/show This Go program demonstrates fetching file details, including media links, by making a direct HTTP GET request to the Frame.io API. It constructs the URL with account and file IDs and includes the `include=media_links` query parameter. The response body is then printed to the console. ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.frame.io/v4/accounts/7e98f6a8-1b8c-4e1e-9c83-e0e3a7e35e5a/files/5a7f8e2b-3c4d-4e5f-8a9b-1c2d3e4f5a6b?include=media_links" req, _ := http.NewRequest("GET", url, nil) res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` -------------------------------- ### Fetch Comments using URLSession (Swift) Source: https://next.developer.frame.io/platform/api-reference/comments/index This Swift example shows how to make an HTTP GET request to the Frame.io API to retrieve comments using `URLSession`. It handles potential errors and prints the HTTP response. ```swift import Foundation let request = NSMutableURLRequest(url: NSURL(string: "https://api.frame.io/v4/accounts/88c8ffe8-2450-47ef-bd85-2549e080a62f/files/a96b29a6-4e65-4101-8616-b44e527d84b1/comments")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` -------------------------------- ### Fetch Folder Children with Media Links (Ruby) Source: https://next.developer.frame.io/platform/api-reference/folders/index This Ruby script demonstrates how to fetch folder children, including media links, by making an HTTP GET request using the Net::HTTP library. It constructs the URL and processes the response. ```ruby require 'uri' require 'net/http' url = URI("https://api.frame.io/v4/accounts/88895470-474d-444d-8ada-0e96d9ebbbd6/folders/219d3cdb-bdcc-43a6-90e0-b2271e361613/children?include=media_links") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) response = http.request(request) puts response.read_body ``` -------------------------------- ### Fetch Folder Information via HTTP Request (PHP) Source: https://next.developer.frame.io/platform/api-reference/folders/show An example using the Guzzle HTTP client in PHP to retrieve folder details from the Frame.io API. This requires the GuzzleHttp package to be installed via Composer. ```php request('GET', 'https://api.frame.io/v4/accounts/9c00a2e6-02c1-4591-af0c-2e4d4ffd9687/folders/59dbd6d6-ba52-451f-95a5-69ba250567ca'); echo $response->getBody(); ``` -------------------------------- ### List Folders using Frame.io SDK Source: https://next.developer.frame.io/platform/api-reference/folders/list Demonstrates how to list subfolders within a specified account and folder using the Frame.io SDK. Requires an environment URL and authentication (implicitly handled by the client setup). ```typescript import { FrameioClient } from "frameio"; async function main() { const client = new FrameioClient({ environment: "https://api.frame.io", }); await client.folders.list("53254b83-e9d0-4519-91cc-3cc214f2ce2c", "0563b82e-80a8-4a68-bb74-5fda2bcc0994", {}); } main(); ``` ```python from frameio import Frameio client = Frameio( base_url="https://api.frame.io" ) client.folders.list( account_id="53254b83-e9d0-4519-91cc-3cc214f2ce2c", folder_id="0563b82e-80a8-4a68-bb74-5fda2bcc0994" ) ``` -------------------------------- ### POST Create folder Source: https://next.developer.frame.io/platform/api-reference/folders/show_explorer=true Creates a folder. ```APIDOC ## POST Create folder ### Description Creates a folder. ### Method POST ### Endpoint /folders ### Parameters #### Path Parameters - **param1** (type) - Required/Optional - Description #### Query Parameters - **param1** (type) - Required/Optional - Description #### Request Body - **field1** (type) - Required/Optional - Description ### Request Example ```json { "example": "request body" } ``` ### Response #### Success Response (200) - **field1** (type) - Description #### Response Example ```json { "example": "response body" } ``` ``` -------------------------------- ### Fetch File Metadata via URLSession (Swift) Source: https://next.developer.frame.io/platform/api-reference/metadata/show This Swift example uses URLSession to make an HTTP GET request to the Frame.io API for file metadata. It configures the request, initiates a data task, and handles the response. ```swift import Foundation let request = NSMutableURLRequest(url: NSURL(string: "https://api.frame.io/v4/accounts/e01731f4-50f2-4a87-901f-09e9b3216f20/files/708b277e-3e49-45a4-baf3-27a633dfd677/metadata")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` -------------------------------- ### Fetch Comments using Frame.io SDK (TypeScript) Source: https://next.developer.frame.io/platform/api-reference/comments/index This example shows how to initialize the Frame.io client in TypeScript and fetch comments for a given account and file ID. It requires the 'frameio' SDK. ```typescript import { FrameioClient } from "frameio"; async function main() { const client = new FrameioClient({ environment: "https://api.frame.io", }); await client.comments.index("88c8ffe8-2450-47ef-bd85-2549e080a62f", "a96b29a6-4e65-4101-8616-b44e527d84b1", {}); } main(); ``` -------------------------------- ### Fetch File Metadata via HTTP Request (Ruby) Source: https://next.developer.frame.io/platform/api-reference/metadata/show This Ruby example uses the `net/http` and `uri` libraries to send an HTTP GET request to the Frame.io API for file metadata. It handles SSL and reads the response body. ```ruby require 'uri' require 'net/http' url = URI("https://api.frame.io/v4/accounts/e01731f4-50f2-4a87-901f-09e9b3216f20/files/708b277e-3e49-45a4-baf3-27a633dfd677/metadata") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) response = http.request(request) puts response.read_body ``` -------------------------------- ### List Users in Account (Java) Source: https://next.developer.frame.io/platform/api-reference/account-permissions/index Example of how to list users in a specific account using Unirest for Java. ```APIDOC ## GET /v4/accounts/{account_id}/users ### Description Retrieves a list of users associated with a specific account. ### Method GET ### Endpoint /v4/accounts/{account_id}/users ### Parameters #### Path Parameters - **account_id** (string) - Required - The ID of the account. ### Request Example ```java HttpResponse response = Unirest.get("https://api.frame.io/v4/accounts/079637b7-5488-408d-8b55-215e67a42f20/users") .asString(); ``` ### Response #### Success Response (200) - **users** (array) - A list of user objects. #### Response Example ```json { "users": [ { "id": "user_id_1", "name": "John Doe", "email": "john.doe@example.com" } ] } ``` ``` -------------------------------- ### Fetch Folder Information via HTTP Request (Swift) Source: https://next.developer.frame.io/platform/api-reference/folders/show Demonstrates fetching folder details from the Frame.io API using Swift's URLSession for making an HTTP GET request. This example handles the asynchronous nature of network requests. ```swift import Foundation let request = NSMutableURLRequest(url: NSURL(string: "https://api.frame.io/v4/accounts/9c00a2e6-02c1-4591-af0c-2e4d4ffd9687/folders/59dbd6d6-ba52-451f-95a5-69ba250567ca")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` -------------------------------- ### Fetch File Details with Media Links via Frame.io SDK Source: https://next.developer.frame.io/platform/api-reference/files/show Demonstrates how to fetch detailed file information, including media links, using the Frame.io SDK. This function requires client initialization with API credentials and specifies the file and account IDs. It returns a promise that resolves with the file data. ```typescript import { FrameioClient } from "frameio"; async function main() { const client = new FrameioClient({ environment: "https://api.frame.io", }); await client.files.show("7e98f6a8-1b8c-4e1e-9c83-e0e3a7e35e5a", "5a7f8e2b-3c4d-4e5f-8a9b-1c2d3e4f5a6b", { include: "media_links", }); } main(); ``` -------------------------------- ### List Users in Account (Swift) Source: https://next.developer.frame.io/platform/api-reference/account-permissions/index Example of how to list users in a specific account using Swift's URLSession. ```APIDOC ## GET /v4/accounts/{account_id}/users ### Description Retrieves a list of users associated with a specific account. ### Method GET ### Endpoint /v4/accounts/{account_id}/users ### Parameters #### Path Parameters - **account_id** (string) - Required - The ID of the account. ### Request Example ```swift import Foundation let request = NSMutableURLRequest(url: NSURL(string: "https://api.frame.io/v4/accounts/079637b7-5488-408d-8b55-215e67a42f20/users")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` ### Response #### Success Response (200) - **users** (array) - A list of user objects. #### Response Example ```json { "users": [ { "id": "user_id_1", "name": "John Doe", "email": "john.doe@example.com" } ] } ``` ``` -------------------------------- ### Fetch File Details with Media Links via Frame.io Python SDK Source: https://next.developer.frame.io/platform/api-reference/files/show This Python code snippet shows how to retrieve file details, including media links, using the Frame.io Python SDK. It requires initializing the client with the base URL and then calling the `show` method on the `files` object with account and file IDs. ```python from frameio import Frameio client = Frameio( base_url="https://api.frame.io" ) client.files.show( account_id="7e98f6a8-1b8c-4e1e-9c83-e0e3a7e35e5a", file_id="5a7f8e2b-3c4d-4e5f-8a9b-1c2d3e4f5a6b", include="media_links" ) ```