API Docs for: 0.9.9
Show:

CalloutVerification Class

Provides Verification using Callout.

Note: Do not instantiate Verification, rather use the createCalloutVerification() method in SinchClient. See the example below.

Constructor

CalloutVerification

(
  • sinch
  • number
  • [custom]
)

Parameters:

  • sinch SinchClient

    The parent object

  • number String

    The phone number to verify

  • [custom] String optional

    Custom string to pass to your backend through callback. Useful for identifying user session, or similar. Max size is 4 kbyte.

Example:

// Get verificationClient from sinchClient
var sinchClient = new SinchClient(...);
var verification = sinchClient.createCalloutVerification('+46123456789'); // Verification to telephone +46123456789

// Initiate verification, using promises 
verification.initiate().then(function() {
    // Handle successful verification
}).fail(function(error) {
    // Handle failed verification    
});

Item Index

Methods

Methods

initiate

(
  • success
  • fail
)
chainable

Initiate verification by callout to the phone number provided earlier. Returns promise which is resolved when verified or failed.

Parameters:

  • success Function

    Optional success callback, method also returns a promise for chaining

  • fail Function

    Optional fail callback, method also returns a promise for chaining

Returns:

promise Promise which resolves when verified, fail resolves with VerificationError

Example:

To be written..