Create Share
POST
/v1/shares
const url = 'https://api.cloud.agentums.ru/v1/shares';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"expires_in_days":1,"kind":"folder","name":"","password":"example","resource_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","role":"viewer"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.cloud.agentums.ru/v1/shares \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "expires_in_days": 1, "kind": "folder", "name": "", "password": "example", "resource_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "role": "viewer" }'Создать ссылку на папку (kind=folder) или файл (kind=file). Токен — в ответе ОДИН раз.
Authorizations
Заголовок раздела «Authorizations»Request Bodyrequired
Заголовок раздела «Request Bodyrequired»Responses
Заголовок раздела «Responses»Successful Response
Media typeapplication/json
ShareLinkOut
object
access_count
Access Count
integer
created_at
required
Created At
string format: date-time
has_password
Has Password
boolean
id
required
Id
string format: uuid
kind
required
Kind
string
prefix
Prefix
string
resource_id
required
Resource Id
string format: uuid
resource_name
Resource Name
string
role
Role
string
upload_count
Upload Count
integer
url
Url
string
Example
{ "access_count": 0, "has_password": false, "kind": "folder", "prefix": "", "resource_name": "", "role": "viewer", "upload_count": 0, "url": ""}Validation Error
Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationErrorobject
ctx
Context
object
input
Input
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Examplegenerated
{ "detail": [ { "ctx": {}, "input": "example", "loc": [ "example" ], "msg": "example", "type": "example" } ]}