J Holmes
J Holmes

Reputation: 1

Consumer API - Cards

I have completed the Build Your First Plugin tutorial and that’s all working fine. I have retrieved my account using the Consumer API with the Node.js Express app and from the command line with curl.

The Accounts API seems rather straightforward. Now I’m trying to determine how I go about retrieving the debit cards associated with my account?

I’m looking at the OpenAPI / Swagger stuff, but I’m not sure how to get Cards API to work exactly.

Accounts - From the Accounts API doc, I copied this userId, 01234567-abcd-4321-fedc-9876543210fa, to use in the Cards API.

Cards

The Cards API is used to perform actions related to credit/debit cards.

As you can see in this screenshot, I pasted the userId that I copied from the Accounts API doc.

Cards API screenshot - The response was a 401:

“Failed to determine Banno auth type”

I suspect this has something to do with selecting the proper OpenID scopes?

I clicked the lock icon next to the Basic Cards API Get button. I selected the two OpenID scopes that it showed as being required?

CardControls-ReadOnly

CardControls-ReadWrite

When I click the Authorize button it redirects to the digital.garden-fi.com site, but I don’t recall seeing a user name and password that I can use to test.

I obviously didn’t want to put my personal information into this site just to create an account to test with.

Garden test site

Upvotes: 0

Views: 282

Answers (1)

Jaime Lopez Jr.
Jaime Lopez Jr.

Reputation: 671

There are a few different things to unpack in your question, so I'll do my best to separate things out.

1) To use the Consumer API's Cards endpoints, you'll definitely need to use the correct OAuth scopes when beginning the authentication flow.

For example, for the GET ​/users​/{userId}​/cards endpoint, you'll need to use either the https://api.banno.com/consumer/auth/cardcontrols.readonly or https://api.banno.com/consumer/auth/cardcontrols.readwrite scope. You only need one of them, not both.

This is what you would need to use as a curl command in the Terminal, for example:

curl -X 'GET' \
'https://[CONSUMER_API_ENVIRONMENT]/a/consumer/api/v0/users/{userId}/cards' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer [YOUR_ACCESS_TOKEN]'

...where:

  • CONSUMER_API_ENVIRONMENT is specific to your financial institution and matches with Banno Online for your institution
  • userId is the ID for the User.
  • YOUR_ACCESS_TOKEN is your Access Token from the authentication flow (in JWT format)

Notably, you will need to user the userId for your user. Your question mentioned using 01234567-abcd-4321-fedc-9876543210fa, but from what I see that's not the ID of an actual user but is instead an example of how such an ID would be formatted. Apologies for the confusion.

2) The 'Interactive' API Reference

The 'interactive' API Reference that you're using is meant to be used with a demo financial institution that we have named Garden (https://www.garden-fi.com).

From what I can tell in your description, it sounds like you don't have a user nor API credentials for the Garden demo institution. Which is okay, because it's actually preferable for you to use a user and API credentials within your own financial institution.

Based on the fact that you've already gone through the Build Your First Plugin quickstart, it sounds like you've already got your own user and API credentials set up in your financial institution's Banno environment (which is actually ideal for what you're trying to do).

Again, apologies for the confusion.

Upvotes: 0

Related Questions