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 'charsetHunch=<string>' \
  --form 'fileName=<string>' \
  --form 'folderId=<string>' \
  --form 'folderPath=<string>' \
  --form 'options=<string>' \
  --form file=@example-file
{
  "access": "HIDDEN_INDEXABLE",
  "archived": true,
  "archivedAt": "2023-11-07T05:31:56Z",
  "createdAt": "2023-11-07T05:31:56Z",
  "defaultHostingUrl": "<string>",
  "encoding": "<string>",
  "expiresAt": 123,
  "extension": "<string>",
  "fileMd5": "<string>",
  "height": 123,
  "id": "<string>",
  "isUsableInContent": true,
  "name": "<string>",
  "parentFolderId": "<string>",
  "path": "<string>",
  "size": 123,
  "sourceGroup": "<string>",
  "type": "<string>",
  "updatedAt": "2023-11-07T05:31:56Z",
  "url": "<string>",
  "width": 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
charsetHunch
string

Character set of the uploaded file.

file
file

File to be uploaded.

fileName
string

Desired name for the uploaded file.

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.

options
string

JSON string representing FileUploadOptions.

Response

successful operation

File

access
enum<string>
required

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

Verfügbare Optionen:
HIDDEN_INDEXABLE,
HIDDEN_NOT_INDEXABLE,
HIDDEN_PRIVATE,
HIDDEN_SENSITIVE,
PRIVATE,
PUBLIC_INDEXABLE,
PUBLIC_NOT_INDEXABLE,
SENSITIVE
archived
boolean
required

Ob die Datei gelöscht wird.

createdAt
string<date-time>
required

Zeitpunkt der Erstellung des Dateiobjekts.

id
string
required

Datei-ID.

updatedAt
string<date-time>
required

Zeitstempel der letzten Aktualisierung der Datei.

archivedAt
string<date-time>

Zeitpunkt der Löschung des Dateiobjekts.

defaultHostingUrl
string

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

encoding
string

Codierung der Datei.

expiresAt
integer
extension
string

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

fileMd5
string

Der MD5-Hash der Datei.

height
integer

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

isUsableInContent
boolean

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

name
string

Name der Datei.

parentFolderId
string

ID des Ordners, in dem sich die Datei befindet.

path
string

Pfad der Datei im Datei-Manager.

size
integer

Größe der Datei in Bytes.

sourceGroup
string
type
string

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

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.

width
integer

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