Query API Sandbox

I have been testing the adhoc Query API endpoint and noticed that when I try to query by a batch number for batches that I've created I do not get back any results even though the gift batch was accepted and contained gifts. I have not run into this issue outside of sandbox, so am wondering if anyone else has experienced this issue?

Comments

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

    @Sam Eckmeier
    What do you mean by “gift batch was accepted”?

    Query API (or any SKY API endpoint listing gift) will ONLY return gifts that have been committed/approved into RE database. if you mean the gift is in a webview gift batch, but the gift batch is not approved yet, then you will not see them in results.

  • @Alex Wong
    Hey thanks for the response! What I meant was that I explicitly approved two gift batches that I created through the API and webview. However, I was not able to retrieve results when filtering by batch number for either gift batch. The strange thing is that when I execute the same adhoc query but filter by a batch number for an approved batch that I did not create, I get results. I have also tested the same adhoc query in our production environment and was able to pull gifts for an approved batch.

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

    @Sam Eckmeier
    Query is working properly, so the question is on your specific instance, what happened.

    That's hard to diagnose without knowing/seeing your data itself. Did you try to use Query in webview (not API) and do the same filtering and see if you see the gift?

  • @Alex Wong
    Yup, I tried the webview and was able to pull the expected records. I also executed a query by ID

    using the id of the query that I created in the webview, which also returned the correct results.

    I also noticed that when I execute an adhoc query without any filters, I receive a large list of gifts that excludes the ones from the batches I created.

    If it helps, here is the body of my adhoc query request:
    {output_format: "Json", formatting_mode: "UI", ux_mode: "Asynchronous", query: {type_id: 20, select_fields: [{query_field_id: 539}, {query_field_id: 5994}], filter_fields: [{query_field_id: 5994, filter_values: [MY_BATCH_NUMBER], operator: "Equals", left_parenthesis: false, right_parenthesis: false, compare_type: "None"}]}})

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

    @Sam Eckmeier
    if you got a saved query, go to the option tab and copy the query JSON to compare to your adhoc

    d2afbdc139c25411ad6c6a24ab35a0fc-huge-im
  • @Alex Wong
    That did the trick! Thank you. I was missing the constituent_filters.

Categories