SweetConnect LogoSweetConnect
ApiDocuments

Retrieve documents by asset ID

Fetches all documents associated with the given asset ID, including recursive relationships within the production line. Returns all documents from machines below this machine in hierarchy.

Access restricted to roles:

  • admin
  • manufacturer-admin
  • manufacturer-user
  • producer-admin
  • producer-user
GET
/v1/documents
AuthorizationBearer <token>

In: header

Query Parameters

page?number

The page number to retrieve

Default1
Range1 <= value
limit?number

The number of items per page

Default10
Range1 <= value <= 50
searchByName?string

Case-insensitive partial match on document name

Length3 <= length <= 255
sortByName?string

Sort by document name

Value in"asc" | "desc"
sortByCategory?string

Sort by category code

Value in"asc" | "desc"
sortByUpdatedAt?string

Sort by last modification date

Value in"asc" | "desc"
filterByCategory?array<string>

Include only documents matching these category codes

filterByFileType?array<string>

Include only documents matching these MIME types

filterByLanguage?array<string>

Include only documents matching these ISO 639-1 language codes. Use 'none' for documents without language

supplier?boolean

Filter by supplier document flag. If omitted, returns all documents. If true, returns only supplier documents. If false, returns only non-supplier documents.

filterBySupplier?array<string>

Include only documents matching these supplier names

assetId*array<string>

Asset IDs (UUIDs) for document retrieval

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://test.sweetconnect.io/api/storage/v1/documents?assetId=0223327b-9270-4478-b11a-597b8885440d%2C51df6794-32c2-40dc-9f9b-43a1c9bd914d%2Cfafd7a56-d339-43b4-b3c0-9e987bb778c7"
{
  "data": [
    {
      "id": "a3f2b65e-4f22-4f45-80c4-9e547a8f5e6a",
      "filename": "document.pdf",
      "displayname": "Manual 2025",
      "ownerId": "d1f2g3h4-i5j6-k7l8-m9n0",
      "organizationId": "d1f2g3h4-i5j6-k7l8-m9n0",
      "manufacturerId": "d1f2g3h4-i5j6-k7l8-m9n0",
      "mimetype": "application/pdf",
      "category": {
        "id": "AA",
        "languageCode": "en",
        "name": "Electronics"
      },
      "languages": [
        "de",
        "fr"
      ],
      "updatedAt": "2025-02-27T12:00:00.000Z",
      "updatedBy": "user-1234abcd",
      "createdBy": "user-5678efgh",
      "createdAt": "2025-01-15T09:30:00.000Z",
      "supplierDocument": false,
      "supplierName": "Amcor",
      "aiInjected": "uninjected",
      "aiInjectedUpdatedAt": "2025-02-27T14:30:00.000Z"
    }
  ],
  "meta": {
    "page": 1,
    "offset": 0,
    "limit": 10,
    "totalItems": 100,
    "totalPages": 10,
    "hasNextPage": true,
    "hasPreviousPage": false
  }
}
{
  "errors": [
    {
      "errorCode": "BadRequest",
      "message": "The request payload is invalid.",
      "extension": {}
    }
  ]
}
{
  "errors": [
    {
      "errorCode": "Unauthorized",
      "message": "Authentication is required to access this resource.",
      "extension": {}
    }
  ]
}
{
  "errors": [
    {
      "errorCode": "NoPermission",
      "message": "You do not have permission to access this resource.",
      "extension": {}
    }
  ]
}
{
  "errors": [
    {
      "errorCode": "NotFound",
      "message": "The requested resource was not found.",
      "extension": {}
    }
  ]
}
{
  "errors": [
    {
      "errorCode": "InternalServerError",
      "message": "An unexpected internal server error occurred.",
      "extension": {}
    }
  ]
}