DevHub API Documentation
  • Introduction
  • Authentication
  • Errors
  • Getting started guides
    • Business-focused Sites
    • Location-focused Sites
    • Location pages and store locator with custom theme
    • Site publishing with site builder access
  • Code examples
    • Python
    • PHP
    • Perl
  • Best practices
    • Our unique IDs, versus yours
    • State and country codes
  • Core Resources
    • Sites
    • Businesses
    • Locations
    • Domains
    • Proxies
  • Content Resources
    • Pages
    • Content
    • Images
    • Files
    • Modules
    • Plugins
    • Themes
  • Logging and analytics
    • Analytics
    • Contact Logs
  • Single Sign On (SSO)
    • Introduction
    • Assigning a site's user
  • Live Preview API
    • What is the Live Preview API?
  • Advanced
    • Domain aliases
    • Language codes
    • Projects
    • Site Check
    • Traces
    • Webmail
  • Local Storage API
    • What is the Local Storage API?
  • Headless CMS
    • Locations search
  • Visitor Localization SDK
    • Visitor Localization SDK
Powered by GitBook
On this page
  • List files
  • Response
  • Full URI of files
  • Upload a new file (via base64)
  • Parameters
  • Response

Was this helpful?

  1. Content Resources

Files

PreviousImagesNextModules

Last updated 6 years ago

Was this helpful?

Covered in this doc:

List files

List all files uploaded within a Site

GET /api/v2/files/

Response

{
  "meta": {
    "limit": 20,
    "next": "/api/v2/files/?limit=20&offset=20",
    "offset": 0,
    "previous": null,
    "total_count": 5
  },
  "objects": [
    {
      "added": "2014-07-18T12:05:44",
      "checksum": "c8aaa5d3656fd6967b4826a14d3c86ef",
      "filename": "chart-copy.pdf",
      "filesize": 54226,
      "id": 13,
      "mimetype": "application/pdf",
      "modified": "2014-07-18T12:05:44",
      "path": null,
      "resource_uri": "/api/v2/files/13/",
      "site_id": 1556341,
      "upload_source": "builder",
      "user_id": 322,
      "whitelabel_id": 10
    },
    ...
  ]
}

Full URI of files

Any files file is available publicly using the filename parameter from the response and prefixing it with the frontend hostname of your API instance or path to a hosted site

Example:

http://yourprivatelabel.cloudfrontend.net/files/chart-copy.pdf

Upload a new file (via base64)

POST /api/v2/files/

Parameters

Name

Type

Description

upload

object

required

Example

{
  "upload": {
    "name": "chart-copy.pdf",
    "file": "iVBORw0KGgoAAAANSUhEUgAAASAAAABsCAIAAABFDPh0AAAAGXRFWHRTb2Z0d2F..."
  }
}

Response

A status code of 201 created is returned on a successful creation and contains the created files object as JSON.

List files
Upload a new files (via base64)