Attachment
This feature we allow user to upload attachment to application, Attachment file can be image, voice record, audio, video, pdf, plane text and so on.
Request
Section titled “Request”Namespace : /bot
Endpoint : /{{chatmeBotToken}}/upload
Request URL: baseURL/bot/{{chatmeBotToken}}/upload
Http method : POST
Auth required : YES
Note: Limit file size 20 MB
Data example
Content-Type: form-data
{ "body": { "attachment": "FDUk6wFVQAIiUWs.jpg", }}
Success Response
Section titled “Success Response”Content example
{ "data": { "user": "63f9863688beabe1106c5541", "url": "https://wrs.chat-me.chat/s3/chat-me/1974506", "originalName": "FDUk6wFVQAIiUWs.jpg", "fileType": "image/jpeg", "fileSize": "182926", "mimeType": "image/jpeg", "hasQrcode": false, "createdAt": "2023-02-21T09:25:48.785Z", "_id": "63f48e520d47825b4202318c", "__v": 0 }}
Error Codes
Section titled “Error Codes”Error Code | Message | Http Status Code |
---|---|---|
40012 | Invalid file content | 400 |
40013 | File upload error | 400 |
40015 | This attachment size is too large | 400 |