OfficeGest
Attachments

Upload attachment

Uploads a file and creates an attachment record with optional entity association.

POST
/attachments
AuthorizationBearer <token>

In: header

filestring
descriptionstring

Attachment description

Lengthlength <= 255
entity_type?string

Entity type (C=Customer, F=Supplier, P=Prospect, R=Seller, E=Employee, T=Contact, Z=Common)

Value in"C" | "F" | "P" | "R" | "E" | "T" | "Z"
entity_id?integer

Entity ID

document_type?string

Document type code

Lengthlength <= 10
document_number?integer

Document number

article_id?string

Article code

Lengthlength <= 50
category_id?integer

Attachment category ID

plate?string

Vehicle plate

Lengthlength <= 20
process_code?string

Process code

Lengthlength <= 50
process_id?string

Workshop process ID

is_public?boolean

Whether the attachment is public, true/false or 1/0 (default: true)

Response Body

curl -X POST "https://og-tenant1.test:8003/api/v2/attachments" \
  -F file="string" \
  -F description="string"
{
  "data": {
    "id": 0,
    "description": "string",
    "show_name": "string",
    "file_type": "string",
    "file_size": 0,
    "entity_type": "string",
    "entity_id": 0,
    "document_type": "string",
    "document_number": 0,
    "article_id": "string",
    "category_id": 0,
    "plate": "string",
    "is_public": true,
    "date": "2019-08-24T14:15:22Z",
    "created_at": "2019-08-24T14:15:22Z",
    "url": "string"
  }
}
{
  "data": {
    "code": "VALIDATION_FAILED",
    "message": "The given data was invalid.",
    "errors": {
      "email": [
        "The email field is required."
      ]
    }
  },
  "meta": {
    "trace_id": "9f86d081884c7d659a2feaa0c55ad01568f3a1c2b4d5e"
  }
}
{
  "data": {
    "code": "VALIDATION_FAILED",
    "message": "The given data was invalid.",
    "errors": {
      "email": [
        "The email field is required."
      ]
    }
  },
  "meta": {
    "trace_id": "9f86d081884c7d659a2feaa0c55ad01568f3a1c2b4d5e"
  }
}
{
  "data": {
    "code": "VALIDATION_FAILED",
    "message": "The given data was invalid.",
    "errors": {
      "email": [
        "The email field is required."
      ]
    }
  },
  "meta": {
    "trace_id": "9f86d081884c7d659a2feaa0c55ad01568f3a1c2b4d5e"
  }
}
{
  "data": {
    "code": "VALIDATION_FAILED",
    "message": "The given data was invalid.",
    "errors": {
      "email": [
        "The email field is required."
      ]
    }
  },
  "meta": {
    "trace_id": "9f86d081884c7d659a2feaa0c55ad01568f3a1c2b4d5e"
  }
}