Create a Refresh Intent

Request to create a Refresh Intent

To request an on demand update of a Link, you need to make a request to the Refresh Intent resource.

curl --request POST "https://api.fintoc.com/v1/refresh_intents?link_token=link_000000000_token_00000000" \
-- header 'Authorization: sk_live_0000000000000000' \
-- header 'Content-Type: application/json'
const fetch = require('node-fetch');

fetch('https://api.fintoc.com/v1/refresh_intents?link_token=link_000000000_token_00000000', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
      'Authorization': 'sk_live_000000000000'
    },
  },
)
import requests

headers = {
  'Accept': 'application/json', 'Authorization': 'sk_live_000000000000'
}

r = requests.post(
  'https://api.fintoc.com/v1/refresh_intents?link_token=link_000000000_token_00000000',
  headers=headers
)
require 'net/http'
require 'uri'
require 'json'

uri = URI("https://api.fintoc.com/v1/refresh_intents?link_token=link_000000000_token_00000000")

header = {
  Accept: 'application/json', Authorization: 'sk_live_000000000000'
}

http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Post.new(uri.request_uri, header)

response = http.request(request)

Response when creating a Refresh Intent

The response to the request above returns the Refresh Intent object, that looks something like this:

{
    "id": "ri_ml4K3O4RSvALRjnV",
    "requires_mfa": null,
    "object": "refresh_intent",
    "refreshed_object": "link",
    "refreshed_object_id": "link_000000000",
    "status": "created",
    "created_at": "2021-12-07T20:40:53.513Z",
    "type": "only_last"
}

The id of the response is what you should use to request the details of the Refresh Intent.

If the requires_mfa field is null, you can wait until a refresh_intent.succeeded event gets notified through a webhook. Otherwise, you must open the widget so that the user can introduce their second factor authentication. If this is the case, then the response would look like this:

{
    "id": "ri_ml4K3O4RSvALRjnV",
    "requires_mfa": {
        "widget_token": "ri_ml4K3O4RSvALRjnV_sec_29K7Ar45AiSFnSgLgDx7nGHX"
    },
    "object": "refresh_intent",
    "refreshed_object": "link",
    "refreshed_object_id": "link_000000000",
    "status": "created",
    "created_at": "2021-12-07T20:40:53.513Z",
    "type": "only_last"
}

Here, the requires_mfa field corresponds to an object, which has a widget_token field that you must use when opening the widget.


Did this page help you?