Skip to main content
Hosted Pages is available as a Beta version. Please contact your Customer Success Manager if you would like to access it.

Introduction

This tutorial explains how to use Yapily Hosted Pages to access data. Note: All requests made to the Yapily API require basic authentication.
1

Create hosted consent request

Make a request to POST /hosted/consent-requests, including the institution country code, redirect URL and user ID or application User ID.You must provide the institutionIdentifiers.institutionCountryCode field. This controls the country of the institution to access the account data.In addition, you can optionally provide the ID of a specific institution in institutionIdentifiers.institutionId field to only allow data access from this institution. This skips the bank selection screen in the hosted flow.You can optionally provide userSettings to set the user’s preferred language and location.
curl --location 'https://api.yapily.com/hosted/consent-requests' \
--header 'Content-Type: application/json;charset=UTF-8' \
--header 'Accept: application/json;charset=UTF-8' \
--header 'Authorization: Basic VXNlcm5hbWU6UGFzc3dvcmQ=' \
--data '{
	"redirectUrl": "https://tpp-application.com/",
	"institutionIdentifiers": {
		"institutionCountryCode": "GB"
	},
	"applicationUserId": "john.doe@company.com",
	"userSettings": {
		"language": "EN",
		"location": "GB"
	}
}'
Store the hostedUrl returned in the response to use in step 2.
2

Redirect the user to the hosted URL

Redirect the end user from your application to the Yapily Hosted Pages URL. This initiates the user journey for the account consent request.
3

End user completes the account consent flow

The end user follows the Yapily hosted screens to complete the account consent request.A typical journey includes bank selection, redirection to their chosen bank, account consent confirmation and redirection back to your application.See UI screens for more details.The user will be automatically redirected to the redirectUrl specified in the initial consent request in Step 1 once the consent flow is complete. We recommend you redirect the user back to your application to create a good user experience.The consentRequestId is returned as part of the redirectUrl. You can use this to check the status of the account consent in step 4.
4

Retrieve details of the account consent request

On an end user’s completion of the hosted pages flow, you should check the consent status to confirm the consent has initiated successfully before proceeding with any further actions.You can retrieve details of the account consent request using GET /hosted/consent-requests/ specifying the consentRequestId in the path.
curl --location 'https://api.yapily.com/hosted/consent-requests/consentRequestId' \
--header 'Accept: application/json;charset=UTF-8' \
--header 'Authorization: Basic VXNlcm5hbWU6UGFzc3dvcmQ'
5

Retrieve account information

Retrieve account information, specifying the consentToken in the header.