Hi,
I need to make an API post to this endpoint to replace the app_user_id with the id of my current user.
I put the URL parameter in dynamic brackets, then in value I have to put something dynamic that I want to put in place of the URL parameter (between the brackets), ok.
But what do I type exactly, knowing that in this case I want to put the current user’s unique id.
I type “Current user’s unique id” or “Current_user’s_unique_id” or something else.
You cannot choose what the API (third party) accept as the ID. Let’s say you are calling Bubble API endpoint, you need to provide a Bubble ID, not your own custom ID. So if the third party doesn’t let you set the ID, you need to use this service ID, not Bubble ID. Let’s say that you create the user in this third party using API. The response will have this user ID. You need to store it in Bubble DB and use this field to call this API after.
ok but the problem is that I only receive data from revenue cat (user id generated by revenue cat), only via the webhook and therefore on the backend workflow and the data that is retrieved in the backend workflow is not attributable to a user in the database because this happens on the server side. In the end, my only problem is that I can’t retrieve the revenue cat data (id of the revenue cat user) in the workflow, because in the workflow you can assign data to the current user.
You will need to find a way to match user and revenue cat. Do you have API Doc link? Even if this happen server side, you need to find a way to link user to data received…
So actually, how do you create subscriber in revenue cat? Using API Connector? From what I understand, it’s more with revenuecat app. This i why you get the data in backend WF. There’s probably something that you can set from your request to this app that will help you link it to your Bubble user
Very simply.
I put the RC url in Appstore connect notification so that Apple transmits the data as soon as there is a payment, and thanks to the webhook from RC that I set up, I get all the user payment data in my workflow backend.
Look for something to send when you are requesting the payment. There’s probably a “custom” field that you can field with the user info (like with the product and amount info) that you push to Revenuecat and that will be included in webhook (or in a GET request about this transaction).
{
"event": {
"event_timestamp_ms": 1652796516000,
"product_id": "premium",
"period_type": "NORMAL",
"purchased_at_ms": 1652681048845,
"expiration_at_ms": 1655366648845,
"environment": "PRODUCTION",
"entitlement_id": "Premium1",
"entitlement_ids": [
"Premium1"
],
"presented_offering_id": "premium",
"transaction_id": "123456789012345",
"original_transaction_id": "123456789012345",
"is_family_share": false,
"country_code": "US",
"app_user_id": "1234567890",
"aliases": [
"$RCAnonymousID:8069238d6049ce87cc529853916d624c"
],
"original_app_user_id": "$RCAnonymousID:87c6049c58069238dce29853916d624c",
"auto_resume_at_ms": 1657951448845,
"currency": "USD",
"price": 0.0,
"price_in_purchased_currency": 0.0,
"subscriber_attributes": {
"$email": {
"updated_at_ms": 1662955084635,
"value": "firstlast@gmail.com"
}
},
"store": "PLAY_STORE",
"takehome_percentage": 0.85,
"offer_code": null,
"type": "SUBSCRIPTION_PAUSED",
"id": "12345678-1234-1234-1234-123456789012",
"app_id": "1234567890"
},
"api_version": "1.0"
In this payload, there's probably something you can send (original user ID? Aliases?) that could help you to match TX with User. OR If you are the one that create the TX ID, you could create a DB item with TX ID and User linked to this DB item. So when you receive the webhook, you can look for the TX ID created before and find the related USER.