Zum Hauptinhalt springen
PUT
/
files
/
v3
/
files
/
{fileId}
Substituir arquivo
curl --request PUT \
  --url https://api.hubapi.com/files/v3/files/{fileId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --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
}
Produtos suportados
Requer um dos seguintes produtos ou superior.
Marketing HubMarketing HubGrátis
Sales HubSales HubGrátis
Service HubService HubGrátis
Content HubContent HubStarter

Escopos Necessários

Esta API requer um dos seguintes escopos:
  • files

Authorizations

Authorization
string
header
required

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

Path Parameters

fileId
string
required

O ID do arquivo desejado.

Body

multipart/form-data
file
file

File data that will replace existing file in the file manager.

charsetHunch
string

Character set of given file data.

options
string

JSON string representing FileReplaceOptions. Includes options to set the access and expiresAt properties, which will automatically update when the file is replaced.

Response

successful operation

File

access
enum<string>
required

Acesso ao arquivo. Pode ser 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

Hora de criação do objeto de arquivo.

archived
boolean
required

Se o arquivo foi excluído.

id
string
required

O ID do arquivo.

updatedAt
string<date-time>
required

A data e hora da última atualização do arquivo.

extension
string

A extensão do arquivo. Por exemplo: .jpg, .png, .gif, .pdf etc.

parentFolderId
string

O ID da pasta em que o arquivo se encontra.

sourceGroup
string

The group from which the file originated.

fileMd5
string

O hash MD5 do arquivo.

encoding
string

A codificação do arquivo.

type
string

O tipo do arquivo. Pode ser IMG, DOCUMENT, AUDIO, MOVIE ou OTHER.

isUsableInContent
boolean

Anteriormente, era "archived". Indica se o arquivo deve ser usado ao criar conteúdo novo, como páginas da web.

url
string

O URL do arquivo fornecido. Esse URL pode mudar dependendo das configurações de domínio da conta. Usará o domínio de hospedagem de arquivo selecionado.

expiresAt
integer

The timestamp indicating when the file will expire.

archivedAt
string<date-time>

Hora de exclusão do objeto de arquivo.

path
string

O caminho do arquivo no gerenciador de arquivos.

size
integer

O tamanho do arquivo em bytes.

name
string

O nome do arquivo.

width
integer

Para arquivos de imagem e vídeo, a largura do conteúdo.

defaultHostingUrl
string

O URL de hospedagem padrão do arquivo. Usará um dos URLs fornecidos pela HubSpot para atender o arquivo.

height
integer

Para arquivos de imagem e vídeo, a altura do conteúdo.

I