Send a one-time code
const url = 'https://api-sandbox.trustink.io/participant/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/otp';const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
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-sandbox.trustink.io/participant/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/otp \ --header 'Authorization: Bearer <token>'Sends a six-digit code by the case’s multiFactorType, valid ten minutes; a new one replaces the previous. At most five an hour. See One-time codes.
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”The participant id: the path of the signing link, or participants[].id of the case.
Header Parameters
Section titled “Header Parameters”The otpSession of POST .../otp/verify. Needed for a case with multiFactorType: the document links, the signature and the signed document.
Deprecated: the case PIN, for a case created with pin and without multiFactorType.
Responses
Section titled “ Responses ”Where the code went, masked, and until when it works.
object
Example
{ "channel": "EMAIL"}The signing link is not valid: no or a forged token, another participant’s, or a link not active before the upload (the authorizer answers {message} only).
object
Examplegenerated
{ "code": "example", "message": "example"}No such participant or case.
Example
Case not foundNo code can be sent. code: OTP_NOT_REQUIRED, OTP_NO_DESTINATION.
object
Examplegenerated
{ "code": "example", "message": "example"}Nobody can sign the case any more (status says why), or a DONE case’s link has passed validUntil; senderName names who sent the request when the tenant gave a sender name. code: CASE_NOT_ACTIVE, LINK_EXPIRED.
object
Examplegenerated
{ "code": "example", "message": "example"}Five codes were sent in the last hour; retryAfterSeconds says when the next can go. code: OTP_RATE_LIMITED.
object
Examplegenerated
{ "code": "example", "message": "example"}The channel is not available yet. code: OTP_CHANNEL_UNAVAILABLE.
object
Examplegenerated
{ "code": "example", "message": "example"}default
Section titled “default”Something failed on the platform, or the request timed out (code TIMEOUT, 503); try again.
object
Examplegenerated
{ "code": "example", "message": "example"}