Skip to main content

Element Events

The main way Method Elements communicates with your application is through HTTP redirects. Your application should intercept the redirects in order to react accordingly to state changes. Your app should listen to both general events and element specific events.

â„šī¸ HTTP redirects from Method Elements are in the following format:

methodelements://{event_source}?{event_data}

General Element Events​

Open​

The open event is triggered when an element has successfully launched. No data is passed at this time.

methodelements://general
?op=open
&element_type=link
Attributes​
NameTypeDescription
opstringThe operation type returned by the element.
element_typestringThe element type that returned this event. When the element is not known the type will be unknown

Error​

The error event is sent for any element that encounters any error while it's active.

methodelements://general
?op=error
&element_type=unknown
&type=INVALID_REQUEST
&sub_type=EXPIRED_TOKEN
&message=The public element token is no longer valid. Element tokens are short lived and can only be used once. Request a new element token and try your request again.
&code=400
Attributes​
NameTypeDescription
opstringThe operation type returned by the element.
element_typestringThe element type that returned this event. When the element is not known the type will be unknown
codeinteger, nullableThe status code of the request.
typestringA broad description of the error.
sub_typestringThe specific error type.
messagestringA human-readable message providing more details about the error.

Exit​

The exit event is the last event in the element flow, at this point your app should no longer present the Method Element. Exit is triggered after an error, a user requested exit or a successful element event.

methodelements://general
?op=exit
&element_type=link
Attributes​
NameTypeDescription
opstringThe operation type returned by the element.
element_typestringThe element type that returned this event. When the element is not known the type will be unknown

Success​

The success event is sent when the user has successfully linked their account to Method. This will return an array of accounts linked to be exchanged later.

methodelements://link
?op=success
&element_type=link
&accounts=%5B%7B%22public_account_token%22%3A%22
pk_acc_iZKeBTmnmw3aSGePcfdweUEJTBXwsfR4%22%2C%22
mask%22%3A%224127%22%7D%5D

when parsed, will would result in the following JSON

{
"accounts": [
{
"public_account_token": "pk_acc_iZKeBTmnmw3aSGePcfdweUEJTBXwsfR4",
"mask": "4127"
}
]
}
Attributes​
NameTypeDescription
opstringThe operation type returned by the element.
element_typestringThe element type that returned this event. When the element is not known the type will be unknown
accountsstringA URL-encoded JSON array with the list of connected public account tokens and their respective mask.
accounts[n].public_account_tokenstringOne of the public account tokens returned by the Link Element after successfully connecting.
accounts[n].maskstringThe last 4 digits of the account number of the connected account.

Auth Specific Element Events​

Success​

The success event is sent when the user has successfully verified their identity. This will return a connection ID which will be used to retrieve the created connection.

methodelements://auth
?op=success
&element_type=auth
&authenticated=true

when parsed, will would result in the following JSON

{
"authenticated": true
}
Attributes​
NameTypeDescription
opstringThe operation type returned by the element.
element_typestringThe element type that returned this event. When the element is not known the type will be unknown
cxn_idstringThe ID of the connection created.