First gift api method returning a null body when there's been a gift on that constituent

Hello,

I am implementing a system where we are listening for new gifts, and then handling times when it is their first gift. So I have set up the webhook to listen for gifts, and then I am GETting the first gift for the ID of the constituent in the payload for the event payload. If the gifts match I continue.

When I am GETting the first gift, there are times when the payload is just returning a null body. Over testing, I found that sometimes it would show up after 7 minutes so I put in a 10 minute delay before I try to get the first gift, but now I am still finding times when the body is null. I've tried waiting for up to 30 minutes and am still getting a null body.

Any ideas what could be going on?

Comments

  • Alex Wong
    Alex Wong Community All-Star
    Tenth Anniversary Kudos 5 Facilitator 4 bbcon 2025 Attendee Badge

    Hi, I have webhook on gift create as well, and have no need for waiting.

    To help further, please share your flow? How are you getting the first gift information?

    Alex

  • I'm using this method:

    constituent/v1/constituents/{constituentId}/givingsummary/first

    and it has worked in the past. It worked every time when running in my dev environment, but I saw it when testing in another environment, and now it is also happening in my dev environment. So all to say, it worked at one point.

    More generally, the flow follows this process:

    1 . Get a ping from the subscription that there has been a gift added.

    2 . Right now I delay because I thought I had to

    3 . I call out to a system to grab credentials

    4 . Authenticate

    5 . Grab the first gift using the method above

    6 . If the first gift ID matches the ID of the gift from the webhook, then I continue processing

    7 . And so on . .

    Hopefully that helps, and thanks in advance for your time in helping me address this issue!

  • Alex Wong
    Alex Wong Community All-Star
    Tenth Anniversary Kudos 5 Facilitator 4 bbcon 2025 Attendee Badge

    Hi,

    I'm not familiar with this particular API and if there's a delay in “calculating” the “first” gift. Hopefully a Blackbaud developer can answer that.

    However, you can approach this differently.

    Instead of calling the givingsummary/first API, call the Gift List API instead, providing the Constituent System Record ID and limit to 1 record sort by gift date.

    This should give you 1 gift record that is the first gift for you to compare to the gift created.

  • Oh awesome, that sounds plausible, I'll give that a shot! Thanks for the suggestion.

Categories