> ## Documentation Index
> Fetch the complete documentation index at: https://docs.plato.ae/llms.txt
> Use this file to discover all available pages before exploring further.

# المرفقات

> قم بتحميل الملفات لرسائل Connect360 وقراءة أصول المرفقات الخاصة.

استخدم المرفقات عندما تحتاج رسالة الدردشة إلى صورة أو ملف PDF أو إيصال أو ملف آخر.

## تحميل المرفقات

```text theme={null}
POST /api/v1/connect/attachments
```

يجب أن يكون الطلب `multipart/form-data`.

## مثال

```bash theme={null}
curl "https://api.plato.ae/api/v1/connect/attachments" \
  -X POST \
  -H "Authorization: Bearer $PLATO_API_KEY" \
  -F "files=@receipt.pdf"
```

تحميل ما يصل إلى 5 ملفات لكل طلب.

يمكن أن يصل حجم كل ملف إلى 25 ميغابايت.

## إجابة

```json theme={null}
{
  "files": [
    {
      "id": "file_123",
      "name": "receipt.pdf",
      "s3Key": "workspace/path/receipt.pdf",
      "type": "application/pdf",
      "url": "https://app.plato.ae/api/assets/workspace%2Fpath%2Freceipt.pdf"
    }
  ]
}
```

احتفظ بـ `id` و`s3Key` اللذين تم إرجاعهما حتى يمكن ربط الأصل الذي تم تحميله بسير عمل Connect360 ذي الصلة.

## تحميل مرفق خاص

```text theme={null}
GET /api/v1/connect/assets/[...key]
```

استخدم `s3Key` التي تم إرجاعها بواسطة استجابة التحميل.

```bash theme={null}
curl "https://api.plato.ae/api/v1/connect/assets/workspace/path/receipt.pdf" \
  -H "Authorization: Bearer $PLATO_API_KEY" \
  --output receipt.pdf
```

يجب أن ينتمي المفتاح API إلى نفس مساحة العمل التي ينتمي إليها الملف.

## الأذونات

يتطلب التحميل:

```text theme={null}
connect360:conversation:engage
```

يتطلب التنزيل إما:

```text theme={null}
connect360:conversation:read
```

أو:

```text theme={null}
connect360:conversation:engage
```

## ملحوظات

* تتم تسوية أسماء الملفات قبل التحميل.
* يتم تخزين الملفات التي تم تحميلها في مجلد Connect360 في Drive.
* قد يشير URL الذي تم إرجاعه إلى مسار أصول خاصة. احتفظ بمفتاح API على الخادم عند جلب الملفات الخاصة.
