Bubble and moralis streams

I have been dealing with this issue for weeks now and have not found a solution. I discussed with Moralis support and they advised me to post it in the forum too.

I am trying to implement moralis streams with an app built using the no-code tool bubble. Here is a link to the app (you can find the moralis API in Plugins -> API connector and then expand Moralis). And here is a video of me trying to implement it. What I do is:

  1. Activate “Detect data”.
  2. In the API connector, initialize the call.
  3. In the “Detect data” I receive data and save it
  4. Then I add an address to the stream
  5. Repeat 2.
  6. In the “Detect data” I receive the new data and save it
  7. Errors appear in the moralis dashboard. According to support there is not webhook URL even if I do not ever change the URL in bubble and it works since it actually received initial data.

Do you have any idea why this might happen?

thanks

P.S: This is the body of the call:

{
    "webhookUrl": "https://experiments-senad.bubbleapps.io/version-test/api/1.1/wf/webhook-moralis/initialize",
    "description": "description00",
    "tag": "tag3",
    "demo": false,
    "topic0": [
        "Transfer(address,address,uint256)"
    ],
    "allAddresses": false,
    "includeNativeTxs": true,
    "includeContractLogs": false,
    "includeInternalTxs": false,
    "getNativeBalances": [],
    "triggers": [],
    "abi": [
        {
            "type": "event",
            "anonymous": false,
            "name": "Transfer",
            "inputs": [
                {
                    "type": "address",
                    "name": "from",
                    "indexed": true
                },
                {
                    "type": "address",
                    "name": "to",
                    "indexed": true
                },
                {
                    "type": "uint256",
                    "name": "tokenId",
                    "indexed": true
                }
            ]
        },
        {
            "type": "event",
            "anonymous": false,
            "name": "Approval",
            "inputs": [
                {
                    "type": "address",
                    "name": "owner",
                    "indexed": true
                },
                {
                    "type": "address",
                    "name": "approved",
                    "indexed": true
                },
                {
                    "type": "uint256",
                    "name": "tokenId",
                    "indexed": true
                }
            ]
        },
        {
            "type": "event",
            "anonymous": false,
            "name": "ApprovalForAll",
            "inputs": [
                {
                    "type": "address",
                    "name": "owner",
                    "indexed": true
                },
                {
                    "type": "address",
                    "name": "operator",
                    "indexed": true
                },
                {
                    "type": "bool",
                    "name": "approved"
                }
            ]
        }
    ],
    "advancedOptions": null,
    "chainIds": [
        "0x89",
        "0x13881"
    ]
}

Hello,
I get this error when I try to activate that stream:

{
  "message": "Could not POST to https://experiments-senad.bubbleapps.io/version-test/api/1.1/wf/webhook-moralis/initialize - Request failed with status code 404. Please check your webhook URL."
}

That is a test webhook request that is sent initially to check that webhook url works.

It looks like somehow you were able to activate the stream in the past because now you have webhook requests in history.

@cryptokid Thanks for the help. I am not really sure I understand you fully.
So, the URL works when I send the test webhook but not then after? do you have an idea why this might happen?

It doesn’t look like it works with the test webhook now. It should not return any error when I try to activate the stream if it would work with the test webhook request.

This stream shows an error now. But when I start with a new stream from scratch, it is Active but it produces errors as you can see from the video

what do you do when you start with a stream from scratch? what are the steps that you make?

you can pause current stream because it doesn’t work and it will consume your webhook requests

The ones you see in the video

  1. Create stream
  2. Get data in test webhook.
  3. Add address to stream
  4. Get data in webhook again because I cannot work with the new data format in bubble since it would take the one from the test webhook.
  5. Errors.

I do not change anything in the json once I create the stream

what do you mean with this?

the webhook url has to return 200 status code for the incoming requests including for the test webhook request

If I run the first test webhook and press save bubble wont recognize the fields of the API and wont be able to save in the database.

I watched the video now, you could test directly with postman too to make 2 type of requests to your webhook url, one with the test webhook request and one with a normal webhook request that has data, and for both of them the webhook url has to return status code 200. Now it looks like it is returning status code 404 for a post request with a test webhook.

you can use webhook.site initially to see how the webhook requests that you should receive look like.
just create a webhook url at webhook.site and use it while you test to see the data that it receives and then try to send the same data to your webhook url

I have used webhook.site before but I tried again. Here is what I did:

  1. I initialized using webhook.site
  2. Added address
  3. Reinitilized using bubble webhook url
  4. I receive test webhook data.

I mean that you can use webhook.site only to see the payload data that you should receive. Then you copy that data (2 type of requests, the test one and a normal one) and you send it to your webhook url (with postman or other similar service) and test it until you make it work without having to start a new stream.