File Handling
You can create, get, and delete files and attach them to messages and posts
File Model
Name | Data Type | Description |
|
| Root file key on cloud storage |
|
| HTTP link for file download |
|
| File type |
|
| Date/time when a file is uploaded |
|
| Date/time when a file is updated |
|
| Information about the file |
Create Files
Before you can attach files and images in messages, posts, user and community avatars, you need to create the file first using the createFile
method.
Requirements for Images:
Supported image types are JPG and PNG.
The maximum file size of the image is 1 GB.
Refer to the file model for the description of the response after a successful file creation. If an error is encountered while creating the file, it will return the following errors:
Get Files
You can get the file information using the getFile
method. Provide the fileId
of the file that you want to get. The fileId
is retrieved from the response after successfully creating the file.
If a file is successfully retrieved, the response will contain the file details. Refer to the file model description for the description of the response after a successful file query. If the file is not found, it will return the following error:
Delete File
To delete a file, use the deleteFile
method and pass the fileId
of the file that you want to delete as the parameter. The fileId
is retrieved from the response after successfully creating the file.
The response will return true
if the file deletion is successful.
Last updated