View a 2FA Message

Endpoint URL: {identityDomain} /config/i/flows/{flow} /locales/{locale} /2faMessages/{2faMessage}



Description

Returns the specified 2FA message.  Note that each 2FA message actually consists of three messages: an SMS message (used when 2FA access codes are sent via text messaging); a plain-text email message; and an HTML-formatted email message. All three messages types can be changed by calling this endpoint.


Respects the API Client Allow List:  No

URI Parameters


URI parameters that must be included in the request are listed in the following table:


Parameter

Type

Required

Description

{appId}

string


Yes

Unique identifier of the Identity Cloud application associated with the 2FA messages.


{flow}

string

Yes

Name of the flow containing the 2FA messages. Note that flow names are case-sensitive: if your flow is named standard then an error occurs if you list the flow as, say,  Standard.


{locale}

string

Yes

Locale of the flow (e.g., en-US) containing the 2FA messages. Similar to flow names, locales are also case-sensitive.


{message}

string

Yes

Name of the message to be retrieved. Allowed values are:


  • registrationVerification
  • resendVerification
  • secondFactor


API Client Permissions

The following table indicates the API clients that can (and the API clients that can't) be used to call this endpoint:

owner
access_issuer
direct_access
direct_read_access
login_client
Yes
No
Yes
No
No




Authentication


This endpoint requires Basic authentication. When configuring authentication, use your client ID as the username and your client secret as the password.



Sample Request (curl)


The following command returns information about the secondFactor 2FA message.

curl -L -X GET \
    'https://v1.api.us.janrain.com/config/79y4mqf2rt3bxs378kw5479xdu/flows/
standard/locales/en-US/2faMessages/secondFactor' \
    -H 'Authorization: Basic eTR4Zmc2ZjQ0bXNhYzN2ZXBqanZ4Z2d6dnQzZTNzazk6OT
VjY3hrN2N6YnZ1eng2ZHB0ZTVrOXA2ZGo1Ynpla3U='



Responses


200 OK


If your API call succeeds you’ll get back detailed information about the message:


{
    "sms": ": Your secure access code is . Do not share 
this code with anyone.  will never ask you for it.",
    "email": {
        "subject": " One Time Code",
        "textBody": ": Your secure access code is . Do not 
share this code with anyone.  will never ask you for it.",
        "htmlBody": ": Your secure access code is . Do not 
share this code with anyone.  will never ask you for it."
    },
    "_self": "/config/79y4mqf2rt3bxs378kw5479xdu/flows/standard/locales/
en-US/2faMessages/secondFactor"
}



Error Response Codes


The following table includes information about some of the other response codes that you might encounter when calling this endpoint.


Response Code

Description

404

Not Found. The specified message is not in the flow. Note that you can only add messages to the flow by calling the /config/{appId}/flows/{flow}/locales/{locale}/2faMessages endpoint, an endpoint which adds all three 2FA messages to the flow. That means that if any one of those three messages is missing, the odds strongly suggest that the other two messages are missing as well.