Skip to main content

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

NameTypeMandatoryDescription
fileIdstringtrueUnique identifier for uploaded files
modelIdstringtrueThe unique identifier of the model
permissionobjecttrueThe permissions you want to grant the other party: View or Edit
effectiveMinutesintegertrueLink validity duration in minutes, starting from the link generation time. After this duration, the link will not be accessible

Response Body

NameTypeMandatoryDescription
expireTimelongtrueTimestamp of expiration time. After this time, the link will not be accessible
sharedUrlstringtrueSystem-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
}