Twilio.Verify.V2.Service.Entity.FactorService (twilio_elixir v0.1.1)

Copy Markdown View Source

Service for Factor API operations.

Operations: list, create, fetch, update, delete

Summary

Functions

Retrieve a list of all Factors for an Entity.

Stream: Retrieve a list of all Factors for an Entity. (lazy auto-pagination).

Update a specific Factor. This endpoint can be used to Verify a Factor if passed an AuthPayload param.

Functions

create(client, service_sid, identity, params \\ %{}, opts \\ [])

@spec create(Twilio.Client.t(), String.t(), String.t(), map(), keyword()) ::
  {:ok, Twilio.Resources.Verify.V2.Service.Entity.Factor.t()}
  | {:ok, map(), map()}
  | :ok
  | {:error, Twilio.Error.t()}

Create a new Factor for the Entity

Operation: CreateNewFactor | Tags: VerifyV2NewFactor

Required Parameters

ParameterTypeDescription
FactorTypestringValues: push, totp, passkeys

credo:disable-for-next-line Credo.Check.Readability.MaxLineLength

| FriendlyName | string | The friendly name of this Factor. This can be any string up to 64 characters, meant for humans to distinguish between Factors. For factor_type push, this could be a device name. For factor_type totp, this value is used as the “account name” in constructing the binding.uri property. At the same time, we recommend avoiding providing PII. |

Optional Parameters

ParameterTypeDescription
Binding.AlgstringThe algorithm used when factor_type is push. Algorithm supported: ES256

credo:disable-for-next-line Credo.Check.Readability.MaxLineLength

| Binding.PublicKey | string | The Ecdsa public key in PKIX, ASN.1 DER format encoded in Base64. Required when factor_type is push |

credo:disable-for-next-line Credo.Check.Readability.MaxLineLength

Binding.SecretstringThe shared secret for TOTP factors encoded in Base32. This can be provided when creating the Factor, otherwise it will be generated. Used when factor_type is totp
Config.AlgstringValues: sha1, sha256, sha512

credo:disable-for-next-line Credo.Check.Readability.MaxLineLength

| Config.AppId | string | The ID that uniquely identifies your app in the Google or Apple store, such as com.example.myapp. It can be up to 100 characters long. Required when factor_type is push. |

credo:disable-for-next-line Credo.Check.Readability.MaxLineLength

Config.CodeLengthintegerNumber of digits for generated TOTP codes. Must be between 3 and 8, inclusive. The default value is defined at the service level in the property totp.code_length. If not configured defaults to 6. Used when factor_type is totp
Config.NotificationPlatformstringValues: apn, fcm, none

credo:disable-for-next-line Credo.Check.Readability.MaxLineLength

| Config.NotificationToken | string | For APN, the device token. For FCM, the registration token. It is used to send the push notifications. Must be between 32 and 255 characters long. Required when factor_type is push. |

credo:disable-for-next-line Credo.Check.Readability.MaxLineLength

| Config.SdkVersion | string | The Verify Push SDK version used to configure the factor Required when factor_type is push |

credo:disable-for-next-line Credo.Check.Readability.MaxLineLength

| Config.Skew | integer | The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. The default value is defined at the service level in the property totp.skew. If not configured defaults to 1. Used when factor_type is totp |

credo:disable-for-next-line Credo.Check.Readability.MaxLineLength

| Config.TimeStep | integer | Defines how often, in seconds, are TOTP codes generated. i.e, a new TOTP code is generated every time_step seconds. Must be between 20 and 60 seconds, inclusive. The default value is defined at the service level in the property totp.time_step. Defaults to 30 seconds if not configured. Used when factor_type is totp |

credo:disable-for-next-line Credo.Check.Readability.MaxLineLength

| Metadata | string | Custom metadata associated with the factor. This is added by the Device/SDK directly to allow for the inclusion of device information. It must be a stringified JSON with only strings values eg. {"os": "Android"}. Can be up to 1024 characters in length. |

delete(client, service_sid, identity, sid, opts \\ [])

@spec delete(Twilio.Client.t(), String.t(), String.t(), String.t(), keyword()) ::
  {:ok, map()} | {:ok, map(), map()} | :ok | {:error, Twilio.Error.t()}

Delete a specific Factor.

Operation: DeleteFactor | Tags: VerifyV2Factor

fetch(client, service_sid, identity, sid, opts \\ [])

@spec fetch(Twilio.Client.t(), String.t(), String.t(), String.t(), keyword()) ::
  {:ok, Twilio.Resources.Verify.V2.Service.Entity.Factor.t()}
  | {:ok, map(), map()}
  | :ok
  | {:error, Twilio.Error.t()}

Fetch a specific Factor.

Operation: FetchFactor | Tags: VerifyV2Factor

list(client, service_sid, identity, params \\ %{}, opts \\ [])

@spec list(Twilio.Client.t(), String.t(), String.t(), map(), keyword()) ::
  {:ok, Twilio.Page.t()}
  | {:ok, map(), map()}
  | :ok
  | {:error, Twilio.Error.t()}

Retrieve a list of all Factors for an Entity.

Operation: ListFactor | Tags: VerifyV2Factor

stream(client, service_sid, identity, params \\ %{}, opts \\ [])

@spec stream(Twilio.Client.t(), String.t(), String.t(), map(), keyword()) ::
  Enumerable.t()

Stream: Retrieve a list of all Factors for an Entity. (lazy auto-pagination).

update(client, service_sid, identity, sid, params \\ %{}, opts \\ [])

@spec update(Twilio.Client.t(), String.t(), String.t(), String.t(), map(), keyword()) ::
  {:ok, Twilio.Resources.Verify.V2.Service.Entity.Factor.t()}
  | {:ok, map(), map()}
  | :ok
  | {:error, Twilio.Error.t()}

Update a specific Factor. This endpoint can be used to Verify a Factor if passed an AuthPayload param.

Operation: UpdateFactor | Tags: VerifyV2Factor

Optional Parameters

ParameterTypeDescription

credo:disable-for-next-line Credo.Check.Readability.MaxLineLength

AuthPayloadstringThe optional payload needed to verify the Factor for the first time. E.g. for a TOTP, the numeric code.
Config.AlgstringValues: sha1, sha256, sha512
Config.CodeLengthintegerNumber of digits for generated TOTP codes. Must be between 3 and 8, inclusive

credo:disable-for-next-line Credo.Check.Readability.MaxLineLength

| Config.NotificationPlatform | string | The transport technology used to generate the Notification Token. Can be apn, fcm or none. Required when factor_type is push. |

credo:disable-for-next-line Credo.Check.Readability.MaxLineLength

Config.NotificationTokenstringFor APN, the device token. For FCM, the registration token. It is used to send the push notifications. Required when factor_type is push. If specified, this value must be between 32 and 255 characters long.
Config.SdkVersionstringThe Verify Push SDK version used to configure the factor

credo:disable-for-next-line Credo.Check.Readability.MaxLineLength

| Config.Skew | integer | The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive |

credo:disable-for-next-line Credo.Check.Readability.MaxLineLength

Config.TimeStepintegerDefines how often, in seconds, are TOTP codes generated. i.e, a new TOTP code is generated every time_step seconds. Must be between 20 and 60 seconds, inclusive
FriendlyNamestringThe new friendly name of this Factor. It can be up to 64 characters.