Zum Hauptinhalt springen
POST
/
files
/
v3
/
files
Charger le fichier
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
}
Produits pris en charge
Exige l'un des produits suivants ou un produit supérieur.
Marketing HubMarketing HubGratuit
Sales HubSales HubGratuit
Service HubService HubGratuit
Content HubContent HubStarter

Portées requises

Cette API requiert l’une des portées suivantes :
  • 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

Accès au fichier. Peut être 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

Date de création de l'objet fichier.

archived
boolean
required

Si le fichier a été supprimé.

id
string
required

ID du fichier.

updatedAt
string<date-time>
required

Horodatage de la dernière mise à jour du fichier.

extension
string

Extension du fichier. Par exemple : .jpg, .png, .gif, .pdf, etc.

parentFolderId
string

ID du dossier dans lequel se trouve le fichier.

sourceGroup
string

The group from which the file originated.

fileMd5
string

Le hachage MD5 du fichier.

encoding
string

Encodage du fichier.

type
string

Type de fichier. Peut être IMG, DOCUMENT, AUDIO, MOVIE ou OTHER.

isUsableInContent
boolean

Précédemment « archivé ». Indique si le fichier doit être utilisé lors de la création de nouveaux contenus tels que des pages web.

url
string

URL du fichier donné. Cette URL peut changer en fonction des paramètres de domaine du compte. Le domaine d'hébergement de fichiers sélectionné sera utilisé.

expiresAt
integer

The timestamp indicating when the file will expire.

archivedAt
string<date-time>

Date de suppression de l'objet fichier.

path
string

Chemin d'accès du fichier dans le gestionnaire de fichiers.

size
integer

Taille du fichier en octets.

name
string

Nom du fichier.

width
integer

Pour les fichiers image et vidéo, la largeur du contenu.

defaultHostingUrl
string

URL d'hébergement par défaut du fichier. Cela utilisera l'une des URL fournies par HubSpot pour gérer le fichier.

height
integer

Pour les fichiers image et vidéo, la hauteur du contenu.

I