Share Documents
Overview
The "Share Documents" API allows you to share the files you upload with others and set permissions for them to view or modify the data. This interface returns an access address, which can be sent to others, allowing them to access the document directly without the need to log in.
Request
POST https://api.docai.pro/api/document/share/v2/generateShareUrl
Request Body
Name | Type | Mandatory | Description |
---|---|---|---|
fileId | string | true | Unique identifier for uploaded files |
modelId | string | true | The unique identifier of the model |
permission | object | true | The permissions you want to grant the other party: View or Edit |
effectiveMinutes | integer | true | Link validity duration in minutes, starting from the link generation time. After this duration, the link will not be accessible |
Response Body
Name | Type | Mandatory | Description |
---|---|---|---|
expireTime | long | true | Timestamp of expiration time. After this time, the link will not be accessible |
sharedUrl | string | true | System-generated link address that can be opened directly in a browser without logging in |
Example request
curl -i -X POST https://api.docai.pro/api/document/share/v2/generateShareUrl \
-H "Content-Type: multipart/form-data" \
-H "Authorization: Bearer $DOCAI_API_KEY" \
-d '{"fileId":"2305111656594417165004800","modelId":"Your model Id","permission":"View","effectiveMinutes":60}'
Example response
{
"code": 200,
"message": null,
"costTime": null,
"data": {
"expireTime": "1695376670000",
"sharedUrl": "https://"
},
"requestId": "da69edd3cb1d47b4a68db9303d280000",
"currentTimeMillis": 1696859401185
}