Exchange share token
POST /v1 /share-sessionsv3.0.0-next.9
Trade a public share token for a short-lived document session JWT.
Unauthenticated, but requires a browser Origin header, checked against the grant allowlist. Unknown, revoked, and disabled tokens are indistinguishable (404). Passphrase-protected grants return 422 SharePasswordRequired until `password` is supplied. Mounted only when the deployment can sign (HS256 mode).
Request body#
application/jsonSharesExchangeRequestrequiredshareTokenstringrequiredpasswordstringA complete body with every required field. Strings stand in for your own values.
{
"shareToken": "shareToken"
}SDK examples#
The selected SDK is remembered across the API reference. Values are examples; replace them with identifiers and input from your application.
import { CloudPDFClient } from "@cloudpdf/sdk";
const client = new CloudPDFClient({
baseUrl: "https://yourhost.com/path/to/api",
token: "<token>",
});
await client.shares.exchange({
shareToken: "shareToken"
});Responses#
200OK
application/jsonSharesExchange200ResponsetokenstringdocIdstringlayerNamestringexpiresAtnumber400Bad request
application/jsonSharesExchange400Responseerrorobjectcodestringmessagestring403Forbidden
application/jsonSharesExchange403Responseerrorobjectcodestringmessagestring404Not found
application/jsonSharesExchange404Responseerrorobjectcodestringmessagestring410Gone
application/jsonSharesExchange410Responseerrorobjectcodestringmessagestring422Unprocessable
application/jsonSharesExchange422ResponseerrorobjectcodestringmessagestringdefaultError
application/jsonAdminErrorPayloaderrorobjectcodestringmessagestring