Pocketm8
  1. Files
Pocketm8
  • Auth
    • User
      • Sign In
      • Reset Password
      • Send SMS Code
      • Verify Code
      • Verify Token
      • Verify Challenge
  • Profile
    • Get Profile
      GET
    • Update Profile
      PATCH
    • Update Email
      PUT
    • Update Phone
      PUT
    • Resend Code
      POST
    • Update Avatar
      POST
    • Verify Code
      POST
  • Users
    • Get Users
      GET
  • Contacts
    • Get Contact
      GET
    • Get Contacts
      GET
  • Tasks
    • Create Task
      POST
    • Delete Task
      DELETE
    • Update Task
      PUT
    • Update Task Status
      POST
    • Get Task
      GET
    • Get Tasks
      GET
  • Relations
    • Task Edit
      GET
    • File Edit
      GET
  • Files
    • Get File
    • Get Files
    • Upload File
    • Delete File
    • Update File
  • Avatars
    • Upload Avatar file
  • Integrations
    • Matrix
      • Files
        • Link File
          POST
        • Unlink File
          DELETE
  1. Files

Link File

Developing
POST
/integrations/matrix/files
Links a Matrix media resource to the Pocketm8 system. The resource will be available as a Pocketm8-managed file.

Request

Body Params application/json

Example
{
    "roomId": "!eWkZCSuHErqhmIdzsN:localhost",
    "eventId": "$MasgQC5nKXJ8mOLf9IJWmMReT0Q4uCbQbiaajxGzxgk",
    "userId": "01JYGG2NJSQVW20P0CGT1SR3Z7"
}

Request Code Samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://admin.letschat.ch/api/integrations/matrix/files' \
--header 'Content-Type: application/json' \
--data-raw '{
    "roomId": "!eWkZCSuHErqhmIdzsN:localhost",
    "eventId": "$MasgQC5nKXJ8mOLf9IJWmMReT0Q4uCbQbiaajxGzxgk",
    "userId": "01JYGG2NJSQVW20P0CGT1SR3Z7"
}'

Responses

🟢200Success
application/json
Body

Example
{
    "message": "FILE_LINKED_SUCCESSFULLY",
    "data": {
        "file": {
            "id": "01JZ5VP0BR2EEVC2207D4721VF",
            "eventId": "$MasgQC5nKXJ8mOLf9IJWmMReT0Q4uCbQbiaajxGzxgk",
            "name": "Zrzut ekranu 2025-07-2 o 11.28.57.png",
            "mimeType": "image/png",
            "meta": {
                "type": "m.room.message",
                "room_id": "!eWkZCSuHErqhmIdzsN:localhost",
                "sender": "@685a5e8c001afde9f025:localhost",
                "content": {
                    "body": "Zrzut ekranu 2025-07-2 o 11.28.57.png",
                    "info": {
                        "size": 100706,
                        "thumbnail_info": {
                            "w": 800,
                            "h": 282,
                            "mimetype": "image/png",
                            "size": 43692
                        },
                        "w": 1534,
                        "h": 542,
                        "xyz.amorgan.blurhash": "U1S$ox0000D~03xv%M%M00_0%KRS0N%L%Lxt",
                        "thumbnail_url": "mxc://localhost/ThECTSJxAnlhMrCSRUzghlMd"
                    },
                    "msgtype": "m.image",
                    "url": "mxc://localhost/jNnHyUyZJzDwBBpnRhOaHwaf",
                    "mimetype": "image/png"
                },
                "origin_server_ts": 1751453124206,
                "unsigned": {
                    "age": 16595694
                },
                "event_id": "$MasgQC5nKXJ8mOLf9IJWmMReT0Q4uCbQbiaajxGzxgk",
                "user_id": "@685a5e8c001afde9f025:localhost",
                "age": 16595694
            },
            "path": "mxc://localhost/jNnHyUyZJzDwBBpnRhOaHwaf",
            "ownerId": "01JYGG2NJSQVW20P0CGT1SR3Z7",
            "userId": "01JYGG2NJSQVW20P0CGT1SR3Z7",
            "createdAt": "2025-07-02T15:21:59.928Z",
            "updatedAt": "2025-07-02T15:21:59.928Z",
            "createdById": null,
            "updatedById": null,
            "categories": []
        }
    }
}
Modified at 2025-07-02 15:22:21
Previous
Upload Avatar file
Next
Unlink File
Built with