Zum Hauptinhalt springen
POST
/
files
/
v3
/
files
Datei hochladen
curl --request POST \
  --url https://api.hubapi.com/files/v3/files \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form 'folderId=<string>' \
  --form 'folderPath=<string>' \
  --form 'fileName=<string>' \
  --form 'charsetHunch=<string>' \
  --form 'options=<string>' \
  --form file=@example-file
{
  "extension": "<string>",
  "access": "PUBLIC_INDEXABLE",
  "parentFolderId": "<string>",
  "sourceGroup": "<string>",
  "fileMd5": "<string>",
  "encoding": "<string>",
  "type": "<string>",
  "isUsableInContent": true,
  "url": "<string>",
  "expiresAt": 123,
  "createdAt": "2023-11-07T05:31:56Z",
  "archivedAt": "2023-11-07T05:31:56Z",
  "path": "<string>",
  "archived": true,
  "size": 123,
  "name": "<string>",
  "width": 123,
  "id": "<string>",
  "defaultHostingUrl": "<string>",
  "updatedAt": "2023-11-07T05:31:56Z",
  "height": 123
}

Unterstützte Produkte

Erfordert eines der folgenden Produkte oder höher.
Marketing HubMarketing Hub -Kostenlos
Sales HubSales Hub -Kostenlos
Service HubService Hub -Kostenlos
Content HubContent Hub -Starter
Diese API erfordert einen der folgenden Bereiche:
files

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Body

multipart/form-data
file
file

File to be uploaded.

folderId
string

Either 'folderId' or 'folderPath' is required. folderId is the ID of the folder the file will be uploaded to.

folderPath
string

Either 'folderPath' or 'folderId' is required. This field represents the destination folder path for the uploaded file. If a path doesn't exist, the system will try to create one.

fileName
string

Desired name for the uploaded file.

charsetHunch
string

Character set of the uploaded file.

options
string

JSON string representing FileUploadOptions.

Response

successful operation

File

access
enum<string>
required

Dateizugriff. Zulässig: PUBLIC_INDEXABLE, PUBLIC_NOT_INDEXABLE, PRIVATE.

Available options:
PUBLIC_INDEXABLE,
PUBLIC_NOT_INDEXABLE,
HIDDEN_INDEXABLE,
HIDDEN_NOT_INDEXABLE,
HIDDEN_PRIVATE,
PRIVATE,
HIDDEN_SENSITIVE,
SENSITIVE
createdAt
string<date-time>
required

Zeitpunkt der Erstellung des Dateiobjekts.

archived
boolean
required

Ob die Datei gelöscht wird.

id
string
required

Datei-ID.

updatedAt
string<date-time>
required

Zeitstempel der letzten Aktualisierung der Datei.

extension
string

Dateierweiterung. Beispiel: JPG, PNG, GIF, PDF usw.

parentFolderId
string

ID des Ordners, in dem sich die Datei befindet.

sourceGroup
string
fileMd5
string

Der MD5-Hash der Datei.

encoding
string

Codierung der Datei.

type
string

Typ der Datei: IMG, DOCUMENT, AUDIO, MOVIE oder OTHER.

isUsableInContent
boolean

Zuvor „archived“. Gibt an, ob die Datei bei der Erstellung neuer Inhalte wie Webseiten verwendet werden soll.

url
string

URL der angegebenen Datei. Diese URL kann sich je nach den Domain-Einstellungen des Accounts ändern. Verwendet die ausgewählte Domain für das Dateihosting.

expiresAt
integer
archivedAt
string<date-time>

Zeitpunkt der Löschung des Dateiobjekts.

path
string

Pfad der Datei im Datei-Manager.

size
integer

Größe der Datei in Bytes.

name
string

Name der Datei.

width
integer

Für Bild- und Videodateien:. Die Breite des Contents.

defaultHostingUrl
string

Standard-Hosting-URL der Datei. Damit wird eine der von HubSpot bereitgestellten URLs für die Bereitstellung der Datei verwendet.

height
integer

Für Bild- und Videodateien:. Die Höhe des Contents.

I