Reveal an API secret
const url = 'https://api.siprtc.io/v1/Accounts/example/ApiCredentials/Reveal';const options = { method: 'POST', headers: {Authorization: 'Basic <credentials>', 'Content-Type': 'application/json'}, body: '{"which":"primary"}'};
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.siprtc.io/v1/Accounts/example/ApiCredentials/Reveal \ --header 'Authorization: Basic <credentials>' \ --header 'Content-Type: application/json' \ --data '{ "which": "primary" }'Returns the primary secret (the default) or the secondary secret in full. The body is optional. Every reveal is logged with the account and the caller.
Only the account itself may call this: {auth_id} must be the Auth ID you authenticate with (a parent cannot manage a sub-account’s credentials, 403), and agent, supervisor and member accounts have no API credentials to manage (403). Replies carry Cache-Control: no-store.
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”Your Auth ID.
Request Body
Section titled “ Request Body ”Which secret to return.
object
Which secret to return: primary (default) or secondary.
Example
primaryResponses
Section titled “ Responses ”The secret.
object
The secret asked for.
object
The secret, 40 characters. Use it as the Basic-auth password.
Always “success”.
Example
{ "data": { "secret": "EXAMPLESECRET000000000000000000000000000" }, "status": "success"}The body is not JSON, or which is neither primary nor secondary.
object
The underlying error text. Only some 400 responses of the tenant list carry it.
What went wrong, in English.
Always “failed”.
Example
{ "error": "sql: connection is already closed", "message": "Account Details not found", "status": "failed"}Authentication failed: wrong or missing credentials, a disabled account, or an {auth_id} that is neither you nor your direct sub-account.
Example generated
example{auth_id} is not the authenticated account, or the account has no API credentials to manage.
object
The underlying error text. Only some 400 responses of the tenant list carry it.
What went wrong, in English.
Always “failed”.
Example
{ "error": "sql: connection is already closed", "message": "Account Details not found", "status": "failed"}There is no secondary secret, or the account was not found.
object
The underlying error text. Only some 400 responses of the tenant list carry it.
What went wrong, in English.
Always “failed”.
Example
{ "error": "sql: connection is already closed", "message": "Account Details not found", "status": "failed"}The secret could not be read.
object
The underlying error text. Only some 400 responses of the tenant list carry it.
What went wrong, in English.
Always “failed”.
Example
{ "error": "sql: connection is already closed", "message": "Account Details not found", "status": "failed"}