Method: Figo#sync_url

Defined in:
lib/synchronization_status/api_call.rb

#sync_url(redirect_uri, state, if_not_synced_since = 0) ⇒ String

Retrieve the URL a user should open in the web browser to start the synchronization process.

Parameters:

  • redirect_uri (String)

    the user will be redirected to this URL after the process completes

  • state (String)

    this string will be passed on through the complete synchronization process and to the redirect target at the end. It should be used to validated the authenticity of the call to the redirect URL

  • if_not_synced_since (Integer) (defaults to: 0)

    if this parameter is set, only those accounts will be synchronized, which have not been synchronized within the specified number of minutes.

Returns:

  • (String)

    the URL to be opened by the user.



23
24
25
26
# File 'lib/synchronization_status/api_call.rb', line 23

def sync_url(redirect_uri, state, if_not_synced_since = 0)
  response = query_api "/rest/sync", {"redirect_uri" => redirect_uri, "state" => state, "if_not_synced_since" => if_not_synced_since}, "POST"
  return "https://#{$api_endpoint}/task/start?id=#{response["task_token"]}"
end