# Resend MFA code POST https://api-sandbox.payabli.com/api/User/resendmfa/{usrname}/{Entry}/{EntryType} Resends the MFA code to the user via the selected MFA mode (email or SMS). Reference: https://docs.payabli.com/developers/api-reference/user/resend-mcode ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: Resend MFA code version: endpoint_user.ResendMFACode paths: /User/resendmfa/{usrname}/{Entry}/{EntryType}: post: operationId: resend-mfa-code summary: Resend MFA code description: >- Resends the MFA code to the user via the selected MFA mode (email or SMS). tags: - - subpackage_user parameters: - name: usrname in: path description: ' ' required: true schema: type: string - name: Entry in: path description: ' ' required: true schema: type: string - name: EntryType in: path description: ' ' required: true schema: type: integer - name: requestToken in: header required: true schema: type: string responses: '200': description: Success content: application/json: schema: $ref: '#/components/schemas/type_:PayabliApiResponseMfaBasic' '400': description: Bad request/ invalid data content: {} '401': description: Unauthorized request. content: {} '500': description: Internal API Error content: {} '503': description: Database connection error content: {} components: schemas: type_:IsSuccess: type: boolean type_:Mfa: type: boolean type_:MfaValidationCode: type: string type_:ResponseText: type: string type_:PayabliApiResponseMfaBasic: type: object properties: isSuccess: $ref: '#/components/schemas/type_:IsSuccess' mfa: $ref: '#/components/schemas/type_:Mfa' mfaMode: type: string description: The mode of multi-factor authentication used. mfaValidationCode: $ref: '#/components/schemas/type_:MfaValidationCode' responseData: type: string description: Data returned by the response, masked for security. responseText: $ref: '#/components/schemas/type_:ResponseText' required: - responseText ``` ## SDK Code Examples ```typescript import { PayabliClient, PayabliEnvironment } from "@payabli/sdk-node"; async function main() { const client = new PayabliClient({ environment: PayabliEnvironment.Sandbox, apiKey: "YOUR_API_KEY_HERE", }); await client.user.resendMfaCode("Entry", 1, "usrname"); } main(); ``` ```python from payabli import payabli from payabli.environment import payabliEnvironment client = payabli( environment=payabliEnvironment.SANDBOX, api_key="YOUR_API_KEY_HERE" ) client.user.resend_mfa_code( entry="Entry", entry_type=1, usrname="usrname" ) ``` ```csharp using PayabliApi; using System.Threading.Tasks; namespace Usage; public class Example { public async Task Do() { var client = new PayabliApiClient( apiKey: "YOUR_API_KEY_HERE", clientOptions: new ClientOptions { BaseUrl = PayabliApiEnvironment.Sandbox } ); await client.User.ResendMfaCodeAsync( "usrname", "Entry", 1 ); } } ``` ```go package example import ( client "github.com/payabli/sdk-go/v/client" option "github.com/payabli/sdk-go/v/option" payabli "github.com/payabli/sdk-go/v" context "context" ) func do() { client := client.NewClient( option.WithBaseURL( payabli.Environments.Sandbox, ), option.WithApiKey( "YOUR_API_KEY_HERE", ), ) client.User.ResendMfaCode( context.TODO(), "Entry", 1, "usrname", ) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://api-sandbox.payabli.com/api/User/resendmfa/usrname/Entry/1") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["requestToken"] = '' response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api-sandbox.payabli.com/api/User/resendmfa/usrname/Entry/1") .header("requestToken", "") .asString(); ``` ```php request('POST', 'https://api-sandbox.payabli.com/api/User/resendmfa/usrname/Entry/1', [ 'headers' => [ 'requestToken' => '', ], ]); echo $response->getBody(); ``` ```swift import Foundation let headers = ["requestToken": ""] let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/User/resendmfa/usrname/Entry/1")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```