Zum Hauptinhalt springen
POST
/
files
/
v3
/
files
ファイルをアップロード
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
}
次のいずれかの製品またはそれ以上が必要です。
Marketing HubMarketing Hub -無料ツール
Sales HubSales Hub -無料ツール
Service HubService Hub -無料ツール
Content HubContent Hub -Starter
この API には、次のいずれかのスコープが必要です。
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

ファイルアクセス権。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

ファイルが削除されたかどうか。

createdAt
string<date-time>
required

ファイルオブジェクトの作成日時。

id
string
required

ファイルID。

updatedAt
string<date-time>
required

ファイルに対する最新の更新のタイムスタンプ。

archivedAt
string<date-time>

ファイルオブジェクトの削除日時。

defaultHostingUrl
string

ファイルのデフォルトのホスティングURL。ファイルを提供するためにHubSpotが指定したURLのいずれかが使用されます。

encoding
string

ファイルのエンコーディング。

expiresAt
integer
extension
string

ファイルの拡張子。例:.jpg、.png、.gif、.pdfなど。

fileMd5
string

ファイルのMD5ハッシュ。

height
integer

画像や動画ファイルのコンテンツの高さ。

isUsableInContent
boolean

以前の「archied」。ウェブページなどの新しいコンテンツを作成する際にこのファイルを使用する必要があるかどうかを示します。

name
string

ファイルの名前。

parentFolderId
string

ファイルがあるフォルダーのID。

path
string

ファイルマネージャーにおけるファイルのパス。

size
integer

ファイルのサイズ(バイト)。

sourceGroup
string
type
string

ファイルの種類。IMG、DOCUMENT、AUDIO、MOVIE、またはOTHERのいずれかになります。

url
string

指定されたファイルのURL。このURLはアカウントのドメイン設定に応じて変わる可能性があります。選択したファイル ホスティング ドメインが使用されます。

width
integer

画像や動画ファイルのコンテンツの幅。