I have an API Call, which I’m using in an API WOrkflow
I believe is working perfectly. When run, I can see the data from the API call, and as part of my workflow actions, include the requested data in an email.
It seems, however, that cannot pass data from the API call to update a data entry OR do a search for a database entry using data from the API call as a constraint.
Unfortunately cannot share the editor at this time however I can share screenshots. Better yet, we can do a quick appear.in call whenever its convenient for you.
It looks like the thing you’re modifying in Step 2 is based off the unique id constraint, but you’re saying the unique ID of the Offer should = “tx_ref” from your API call. Is this accurate? Would that tx_ref be saved previously with the Offer unique id?
You should also check on your privacy rules on the Offer type and check your authentication/privacy settings on the API Endpoint (Data > Privacy > Offer). It might be that the endpoint isn’t authorized to search Offers.
The API is for a payment processor (here in Nigeria) and I passed on the unique ID of my ‘Offer’ thing into as the tx_ref field. So yes this is accurate.
Regarding the privacy roles (Data > Privacy > Offer), I don’t have anything defined, meaning it is visible by everyone.
In Settings > API, do I need to select things as to expose their Data API?
I tried what you suggested but made no head way. Like I mentioned in my last post. the tx-ref has been saved with the unique ID of the Offer type. so that part is correct. You can see below a copy of the email that I generate for the API cal which has the info included
Regarding the privacy settings, I did try to create settings for that but still it didn’t work. Not sure what else to do at this point. Below are the two ways I tried to define the roles:
Don’t know if anyone else has any pointers. I’ve tried almost every iteration I can think of to configure the API settings (exposing data types) as well as Data privacy settings in order to modify data types, and still I have no luck.
Can someone explain to me know how the " Use field display instead of ID for key names" checkbox can affect how data is exposed?
Also when is it necessary to set the roles? if the information needed is from data from an API, is that considered to be using a token with administrative access?
To be sure that this is nothing to do with privacy settings, you should tick the ignore privacy settings checkbox on your endpoint.
Also, to be clear, what I think Gaby was asking earlier was whether or not you had previously sent the offer’s unique id to RavePay as the tx_ref. It would be good to see a screenshot of the debugger showing that the tx_ref returned by the API call is indeed the same as the unique id of the offer found by the search.
One other thing to try, when you create the offer, could you set its txRef to its unique id then. Then for your search, instead of testing the returned tx_ref from the API call against the unique_id, you could test it against txRef. This is just in case Bubble is protective of unique_ids in some way.
Finally, even though I don’t think it matters too much, it is a little odd that you’re sorting the Offers search by modified date. There should be only one item with that unique id anyway, so no sort should be required.
Glad you figured it out. Bubble is great! Having tried lots of other no/low-code platforms in the past, I can confidently say Bubble is the most robust. It’s not without its quirks of course but it largely works - for my needs anyway.