Site icon Filestack Blog

A Developer’s Guide to the Management API

Filestack Management API

You shouldn’t have to log into a dashboard to create a new app, rotate an API key, or check your usage. Manually managing infrastructure is a tedious distraction from building your actual product.

The Filestack Management API lets you script every part of your file infrastructure, so you can stop clicking and get back to coding.

What are Filestack Applications?

Filestack Applications are isolated environments for your projects. Each one gets its own API key, storage configurations, and security settings. This lets you manage multiple projects from a single account without getting them tangled up.

Using App Families for Shared Resources

Filestack takes flexibility a step further with the “Parent” plugin. Imagine you have a group of related applications that need to share resources. With this feature, instead of each app having rigid, individual limits, they can draw from a shared resource pool. This means if one app isn’t using all its allocated resources, another can tap into that surplus – making your file management more efficient and cost-effective.

Programmatic Control via the API

The real magic happens with the Management API. Instead of manually logging into the DevPortal every time you need to make changes, you can programmatically:

Filestack applications give you a flexible, powerful way to manage files across multiple projects, all from a single account, with granular control and efficiency.

Getting Started is Simple

Our API is designed with developers in mind. With clear documentation and straightforward endpoints, you’ll be up and running in no time. The base endpoint https://management.filestackapi.com/ is your gateway to powerful file management.

Authentication with JWT

We know security is crucial. That’s why our Management API uses JSON Web Tokens (JWT) for rock-solid authentication. By using your unique Client ID and API Secret, you can ensure that every request is verified and secure.

Core API Functions

The Management API serves as your comprehensive control center for Filestack applications, offering powerful management capabilities:

Manage applications

Create New Applications

Create a new application by sending an /apps request, optionally specifying the app name, URL, and the parent API key. You can also set limits for file creation, transformations, and transfer when parent_apikey is present.

This lets you dynamically spawn applications that are precisely tuned to your development ecosystem’s needs.

Get a list of your created applications

The Management API allows you to retrieve detailed information for each app, including:

Get, update, and delete a specific application

Retrieve specific application details using its API key. You can get its name, URL, creation date, and its storages.

Moreover, with the Management API, you can update and delete an application.

Manage Application Security

You can get, reset, enable, or disable your application secret key by sending requests to /apps/<apikey>/security.

By dynamically managing application secrets, teams can rapidly respond to potential security threats, rotate credentials, and ensure that only authorized services can interact with their Filestack applications.

Manage Application Storages

The Management API simplifies storage management by allowing you to add S3, Google Cloud, Azure, and Rackspace Storage Credentials. Additionally, you can use it to verify the correct setup of these storages.

This level of granular control empowers developers to create highly tailored file management solutions that adapt seamlessly to complex project requirements on the fly.

Manage Webhooks

Add webhooks by sending the URL and type to /apps/<apikey>/webhooks, which returns a JSON object containing the webhook ID. This ID can then be used to update or delete the webhook.

Additionally, you can retrieve a list of all defined webhooks to track your application’s event-driven integrations.

The webhook feature provides developers with a flexible mechanism to automate responses to file-related events, enabling real-time notifications and seamless workflow integrations across different services and platforms.

Application Analytics

The Filestack Management API offers powerful reporting options to help you gain insights into your file management activities:

Overview Report

Get a comprehensive snapshot of your application’s file operations for a specific time period. This report includes:

Example:

{
    "from_date": "2016-11-11T10:19:10",
    "to_date": "2016-11-29T10:19:10",
    "stats": {
        "transfer": 123456789,
        "creations": 12,
        "transformations": 20,
        "dialog_open": 7,
        "reads": 398
    }
}

Daily Breakdown Report

Track your file operations on a day-by-day basis, allowing you to identify trends and usage patterns over time.

Example:

{
    "from_date": "2016-11-11T10:19:10",
    "to_date": "2016-12-29T10:19:10",
    "daily_stats": [
        {
            "date": "2016-12-02",
            "stats": 
                {
                    "transfer": 304120,
                    "transformations": 2,
                    "dialog_open": 1,
                    "creations": 1,
                    "reads": 4
                 }
         },
         {
             "date": "2016-12-21",
             "stats": 
                 {
                    "transfer": 12113468,
                    "transformations": 2,
                    "dialog_open": 32,
                    "creations": 32,
                    "reads": 21
                  }
           },
         // Additional daily entries...

       ]
}

File Type Report

Understand your file composition with a breakdown of uploaded files by type:

Example:

{
    "from_date": "2016-11-11T10:19:10",
    "to_date": "2016-12-29T10:19:10",
    "stats": {
        "text": 12,
        "image": 321,
        "video": 0,
        "audio": 70,
        "pdf": 1,
        "other": 66
    }
}

Services Used Report

Identify how many files are being uploaded from various sources like:

{
    "from_date": "2016-11-11T10:19:10",
    "to_date": "2016-12-29T10:19:10",
    "stats": {
        "customsource": 0,
        "dropbox-storage": 0,
        "video": 0, "ftp": 0,
        "github": 0,
        "rackspace-storage": 0,
        "dropbox": 0,
        "filestack": 3,
        "box": 0,
        "twitter": 0,
        "instagram": 0,
        "amazon-storage": 0,
        "gmail": 0,
        "googledrive": 0,
        "url": 0,
        "evernote": 0,
        "webdav": 0,
        "clouddrive": 0,
        "flickr": 0,
        "facebook": 0,
        "picasa": 0,
        "imagesearch": 0,
        "onedrive": 0,
        "gcs-storage": 0,
        "azure-storage": 0,
        "imgur": 0}
}

These analytics provide granular insights into your file management, helping you optimize usage, track trends, and make data-driven decisions.

Add Custom Auth Keys

Some third-party services require authentication to access their resources. The Filestack Management API simplifies this process by allowing you to securely add authentication credentials for various services.

Using the endpoint apps/<apikey>/credentials/auth/<service>, you can programmatically send your client key and secret. This enables seamless integration with services that demand additional authentication, ensuring smooth file transfers and interactions across different platforms.

Key benefits:

Example services might include Dropbox, Google Drive, Evernote, or GitHub.

Custom S3 Source Configuration

The Management API provides comprehensive control over custom S3 source settings. You can:

By programmatically managing your S3 source configuration, you can seamlessly integrate custom storage solutions and ensure secure, reliable file management across different storage environments.

The key advantages include:

Manage Whitelist Domains

With Management API, you can add or remove domains to/from the whitelist. Additionally, get list of all whitelisted domains.

You can also block requests or traffic that do not have a known or specified origin (such as the HTTP ‘Origin’ header or ‘Referer’). This prevents anonymous or potentially malicious traffic from accessing certain resources.

Manage Whitelist Domains

The Management API provides robust domain whitelisting capabilities to enhance your application’s security. With simple API calls, you can:

By configuring domain whitelisting, you can:

Requests from non-whitelisted domains are automatically blocked, providing an additional layer of protection for your file management resources.

This feature gives you granular control over your application’s access, ensuring that only trusted domains can leverage your Filestack services.

Next Steps

Dive into the Filestack Management API and transform how you handle files. Take control of your applications, enhance security, and unlock unprecedented flexibility—all with a few API calls.

Get Started Now:

Simplify your file management. Supercharge your development workflow.

 

Exit mobile version