Why does `verificationReasons` return an empty response for unverified Cards?

  • 18 December 2020
  • 5 replies
  • 2 views

Userlevel 3
Can anyone tell me why `verificationReasons` from the cards endpoints (both https://api.getguru.com/api/v1/cards/some-card-id and https://api.getguru.com/api/v1/cards/slug) sometimes returns as an empty array for unverified cards? I have a script that checks for cards that are unverified due to being stale, usually referred to as "EXPIRED" in verificationReasons.
Checking for expired works fine for most cards, but there are some instances where an expired card doesn't have this designation. I assume the information is coming from somewhere since the web app is able to render these cards as expired despite the empty array, but I'm not sure how. Can anyone point me in the right direction? Thanks for any help!

Mary Houston 10 months ago

Hey Dillon! Any card which is past its verification interval since its last verification (lastVerified date field returned on the card) will have an `EXPIRED` reason in the `verificationReasons` array. If the card was updated or requested before expiration then you will see multiple reasons for verification in the array but if its just from being stale then it will only contain `EXPIRED`
Would you be able to provide some Card IDs or share the JSON responses of the cards that have empty arrays (you can DM me the card IDs/responses directly for privacy purposes)? That will help troubleshoot!
View original

5 replies

Userlevel 4
Badge
Hey Dillon! Any card which is past its verification interval since its last verification (lastVerified date field returned on the card) will have an `EXPIRED` reason in the `verificationReasons` array. If the card was updated or requested before expiration then you will see multiple reasons for verification in the array but if its just from being stale then it will only contain `EXPIRED`
Would you be able to provide some Card IDs or share the JSON responses of the cards that have empty arrays (you can DM me the card IDs/responses directly for privacy purposes)? That will help troubleshoot!
Userlevel 3
Thanks Mary! Sent you the info.
Userlevel 4
Badge
Hey @dillon! Our backend engineers did some digging and found that an empty array will ALWAYS mean the card is `expired` due to time (i.e. past verification date). So for your script, perhaps you can add the reference to the empty array as well?
Userlevel 3
Ok cool, so I should check for expired or an empty array in verificationReasons. Thanks for looking into this, @mhouston. Really appreciate it!
Userlevel 4
Badge
yes! it was a great question/find.

Reply