Hi all,
I am trying to allow users to connect to my company bunq account so that we can use their information in our app by making calls with our company API context. I am using the PHP SDK for this.
Now I'm trying to figure out how exactly to do this. We want to redirect users from our own app to the bunq app to authorize the request. So here's what I came up with:
Backend:
We create and store our own API key/context.POST: DRAFT-SHARE-INVITE-BANK [Question 1]Retrieve the draft share invite id.GET: DRAFT-SHARE-INVITE-BANKRetrieve the draft share url and return it to our app. Also retrieve (and temporarily store) the share invite bank response id.
App:
Open share URL.Send message to backend once completed. [Question 2]
Backend:
GET: SHARE-INVITE-BANK-RESPONSE [Question 3]Retrieve the status of the request, and if accepted, the monetary account id.Make calls with our company API context and retrieve the info of the shared account.
Now these are my questions:
How should the expiration date be formatted?How do we know in the frontend what happened to a request after we send a user to the bunq app? Can we somehow listen to "accept" or "decline" events, or something similar? In this case we are working with iOS.How do we get the ID of the bank account that was linked? The SHARE-INVITE-BANK-RESPONSE request not only requires an itemID (which is the ID returned by the DRAFT-SHARE-INVITE-BANK request I assume), but also a user ID. Which user ID is this? Our company's or our user's? If it's the latter, then how can we know this ID and access the endpoint if we only have our company API context?If anything in the above flow is incorrect, then feel free to point it out as well.
Thanks for any help!