Saltar al contingut principal
POST

Adjuntar un fitxer a un pressupost

Scope:sales:estimates.write
https://api.holded.com/api/v2/estimates/{estimateId}/attachments

Adjunta un fitxer a un pressupost. Envia el fitxer com a `multipart/form-data`.

Paràmetres

Paràmetres de ruta

estimateIdstringobligatori

ID del pressupost (ObjectId hexadecimal de 24 caràcters)

Cos de la petició

object
filestring<binary>

The file to attach

Petició

python
import requests

url = "https://api.holded.com/api/v2/estimates/{estimateId}/attachments"
headers = {
    "Authorization": "Bearer YOUR_API_KEY",
}

files = {"file": open("file.pdf", "rb")}
response = requests.post(url, headers=headers, files=files)
print(response.json())

Respostes

Resposta

json
{
  "id": "507f1f77bcf86cd799439011"
}

Respostes exitoses

201Fitxer adjuntapplication/json
object
idstring

Respostes d'error

400Sol·licitud incorrectaapplication/json
401API key no vàlida o no proporcionadaapplication/json
403Permisos insuficientsapplication/json
404Pressupost no trobatapplication/json
429Límit de sol·licituds exceditapplication/json