Withdraw several share links
const url = 'https://api.pixonaut.app/v1/share-links/revoke';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"ids":["shl_9a8b7c6d5e4f3a2b1c0d9e8f","shl_1a2b3c4d5e6f7a8b9c0d1e2f"]}'};
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.pixonaut.app/v1/share-links/revoke \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "ids": [ "shl_9a8b7c6d5e4f3a2b1c0d9e8f", "shl_1a2b3c4d5e6f7a8b9c0d1e2f" ] }'Operation ID: shareLinks.revokeMany
With ids, withdraws up to 100 links and answers each revoked or not_found; a link the caller could not have handed out (to a connected store’s integration key, one its store did not hand out) is not_found, as DELETE /v1/share-links/{id} answers it. With createdByKeyId, withdraws every working link that api key or connected store handed out and answers how many, without revoking the key, which may hand out new ones. Each link withdrawn is audited as a single withdrawal is.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
The links to withdraw, at most 100.
object
The secret key or connected store whose working links to withdraw. The key keeps working, and may hand out new links.
Examples
Example
{ "ids": [ "shl_9a8b7c6d5e4f3a2b1c0d9e8f", "shl_1a2b3c4d5e6f7a8b9c0d1e2f" ]}Responses
Section titled “Responses”What was withdrawn
object
One entry per id asked for, in order, each once.
object
revoked: the link no longer works. not_found: no working link of that id the caller may manage — unknown, already withdrawn, or not theirs.
object
How many of the key’s working links were withdrawn.
Examples
Example
{ "results": [ { "id": "shl_9a8b7c6d5e4f3a2b1c0d9e8f", "outcome": "revoked" }, { "id": "shl_1a2b3c4d5e6f7a8b9c0d1e2f", "outcome": "not_found" } ]}Headers
Section titled “Headers”Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.
Refused: invalid_input
object
Examples
invalid_input
{ "error": "invalid_input"}Headers
Section titled “Headers”Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.
Refused: unauthorized
object
Examples
unauthorized
{ "error": "unauthorized"}Headers
Section titled “Headers”Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.
Refused: origin_forbidden, feature_disabled
object
The feature the tenant does not have. Always sent with feature_disabled.
Examples
feature_disabled
{ "error": "feature_disabled", "feature": "api"}origin_forbidden
{ "error": "origin_forbidden"}Headers
Section titled “Headers”Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.
Refused: payload_too_large
object
Always sent with payload_too_large.
Examples
payload_too_large
{ "error": "payload_too_large", "maxBytes": 0}Headers
Section titled “Headers”Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.
Refused: db_error. A request that failed unexpectedly answers as text instead.
object
Examples
db_error
{ "error": "db_error"}Headers
Section titled “Headers”Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.
Questions? Write to [email protected].