APIs & Integrations

SLangdon
Member

POST /filemanager/api/v3/files/upload returning 405 Method Not Allowed

SOLVE

Hello! I have been integrated with the /filemanager/api/v3/files/upload for several months now successfully in a nodejs server.  However, around 10am yesterday the endpoint started responding with a 405 Method Not Allowed.  I have confirmed that the integration is still POSTing.  Were there changes to this endpoint that I should be aware of? Thanks.  The implementation is as follows.

 

const uploadUrl = `${HUBSPOT_FILE_API_URL}/upload?hapikey=${this._apiKey}`
const uploadedFiles = []

for (const file of files) {
const form = new FormData()

const fileOptions = {
access: 'PUBLIC_INDEXABLE',
overwrite: true,
}
form.append('file', file.buffer, {
contentType: file.mimetype,
filename: file.originalname,
})
form.append('options', JSON.stringify(fileOptions))
form.append('folderPath', `files/${name}`)

const response = await this._axios.post<HubspotUploadResponse>(
uploadUrl,
form,
{
headers: { ...form.getHeaders() },
},
)

 

I've also attempted to upload via the node sample code.  With that integration, I'm recieving a 301.

0 Upvotes
1 Accepted solution
dennisedson
Solution
HubSpot Product Team
HubSpot Product Team

POST /filemanager/api/v3/files/upload returning 405 Method Not Allowed

SOLVE

Hi @SLangdon 

What is the full url that you are hitting (minus the api key)

Make sure that you are using https and not http.

View solution in original post

0 Upvotes
3 Replies 3
SLangdon
Member

POST /filemanager/api/v3/files/upload returning 405 Method Not Allowed

SOLVE

Thank you so much! 

dennisedson
Solution
HubSpot Product Team
HubSpot Product Team

POST /filemanager/api/v3/files/upload returning 405 Method Not Allowed

SOLVE

Hi @SLangdon 

What is the full url that you are hitting (minus the api key)

Make sure that you are using https and not http.

0 Upvotes
SLangdon
Member

POST /filemanager/api/v3/files/upload returning 405 Method Not Allowed

SOLVE

The full URL is indeed http: `http://api.hubapi.com/filemanager/api/v3/files`.  I'll try again with https