Attach File
Add a file from the specified upload session to the page. How to create a file upload session
Request
POST
https://api.wiki.yandex.net/v1/pages/{idx}/attachments
Path parameters
|
Name |
Description |
|
idx |
Type: integer |
Body
application/json
{
"upload_sessions": [
"example"
]
}
|
Name |
Description |
|
upload_sessions |
Type: string<uuid4>[] Example
|
Responses
200 OK
OK
Body
application/json
{
"results": [
{
"id": 0,
"name": "example",
"is_downloadable": true,
"download_url": "example",
"size": "example",
"description": "example",
"user": {
"id": 0,
"identity": null,
"username": "example",
"display_name": "example",
"is_dismissed": true,
"affiliation": "example"
},
"created_at": "2025-01-01T00:00:00Z",
"mimetype": "example",
"has_preview": true,
"check_status": "ready"
}
]
}
|
Name |
Description |
|
results |
Type: AttachmentSchema[] Example
|
UserIdentity
User identifier
|
Name |
Description |
|
cloud_uid |
Type: string User identifier in the cloud (for the external instance) Example: |
|
uid |
Type: string User identifier in Yandex (for the internal instance) Example: |
Example
{
"uid": "example",
"cloud_uid": "example"
}
UserSchema
Information about the user
|
Name |
Description |
|
affiliation |
Type: string User affiliation (for example, Example: |
|
display_name |
Type: string User display name Example: |
|
id |
Type: integer Internal user identifier |
|
is_dismissed |
Type: boolean The user has been dismissed |
|
username |
Type: string User login Example: |
|
identity |
All of 1 type
User identifier in the system Example
|
Example
{
"id": 0,
"identity": {
"uid": "example",
"cloud_uid": "example"
},
"username": "example",
"display_name": "example",
"is_dismissed": true,
"affiliation": "example"
}
FileCheckStatusType
Antivirus file check status:
check— the file is being checkedready— the file has been checked and is safedeleted— the file has been deletedinfected— a virus has been detectederror— an error occurred during the check
Type: string
Enum: check, ready, deleted, infected, error
AttachmentSchema
A file attached to the page
|
Name |
Description |
|
created_at |
Type: string<date-time> Date and time the file was uploaded Example: |
|
description |
Type: string File description Example: |
|
download_url |
Type: string File download URL Example: |
|
has_preview |
Type: boolean Whether a file preview is available |
|
id |
Type: integer Unique file identifier |
|
mimetype |
Type: string File MIME type Example: |
|
name |
Type: string File name Example: |
|
size |
Type: string File size Example: |
|
check_status |
All of 1 type
Antivirus file check status Default: |
|
is_downloadable |
Type: boolean Whether the file is available for download Default: |
|
user |
All of 1 type
The user who uploaded the file Example
|
Example
{
"id": 0,
"name": "example",
"is_downloadable": true,
"download_url": "example",
"size": "example",
"description": "example",
"user": {
"id": 0,
"identity": {
"uid": "example",
"cloud_uid": "example"
},
"username": "example",
"display_name": "example",
"is_dismissed": true,
"affiliation": "example"
},
"created_at": "2025-01-01T00:00:00Z",
"mimetype": "example",
"has_preview": true,
"check_status": "ready"
}