Download binary media files from Meta API

Do NOT use ChatGPT to write code. Full Stop. The explanation relies on a subtle distinction found in the nexus of mathematics, linguistic, and computer science, between the concept of syntactical well-formed statements, versus provable statements. For example the statement “This statement is false.” is syntactically well-formed, but is not provable. It cannot be assessed for truthfulness.

ChatGPT produces nearly syntactically well-formed statements using approximate stochastic production rules of a context free grammar. However, ChatGPT, or any other system built on computers, can emphatically NOT evaluate the truthfulness of the statements, nor have any guarantees of generating truthful statements. The argument proceeds by evaluating increasingly specific tests of truth:

  1. All programming, including that which went into developing and running ChatGTP, is done in formal computer languages which are “context free grammars”.
  2. The meaning of the phrase “context free grammar”, is that the process is abstracted away from tests of truthfulness against reality. Specifically, computers do not have a means of actively engaging in the observation of reality.
  3. Clearly, because ChatGPT runs on computers it cannot test for the truthfulness of it’s statements against reality. So that level of generality is a no go.
  4. So, we can try restricting this statement down to just asking ChatGPT, or any other program, to only generate mathematically truthful statements in some reasonable axioms of mathematics. However that was proven impossible, in the 1930s, in Gödel’s IncompletenessTheorems.
  5. Finally, we can try asking it to at most produce computer programs that are at least guaranteed to halt, and it turns out that is impossible as well, as was proven by Turing also in the 1930s, in his Halting Problem.

The meta-problem that we are faced with is that the data science industry has produced droves of brain dead and ignorant PhD researchers who have replaced actual wisdom and knowledge with cleverness and technical sophistry. Data science education focuses entirely on algorithms with utterly no reference to critical foundational theoretical work, nearly a century old now, that deeply disproves the idea that computer programs can form any sort of artificial intelligence, in the sense of assessing for truth against reality.

1 Like

If only everyone on the forum was as helpful as @aaronsheldon and @jonah.deleseleuc :roll_eyes: :roll_eyes: :roll_eyes: :roll_eyes: :roll_eyes: :roll_eyes: :roll_eyes: :roll_eyes: :roll_eyes: :roll_eyes: :roll_eyes: :roll_eyes: :roll_eyes: :roll_eyes:

Let’s see if we can solve this without them.

2 Likes

I didn’t mean it poorly, I just meant that they shouldn’t rely on copy pasted code to tackle the issue, and that if they had a more specific question, I could try answering as best I can :slight_smile:

What part of the “need help” category are you having trouble understanding :grinning:

1 Like

@pachocastillosr please did you figure out a way to get the file saved into bubble database? I’m having the very same issue :expressionless:

Unfortunately no

I have the same problem, how did I solve it?

I have solved this issue but the solution depends on your existing implementation.

Feel free to DM me.

1 Like

Can you explain how you solved this issue?

1 Like

@pachocastillosr : Thanks for your previous steps. I followed and it brought me this far where i also got stuck. Spent the last 2 days trying some workarounds and it finally worked.:

Here are the steps to save the media file.:

First retrieve media url using the api connector:

Second: download media url uring the media url you retrieved from the previous step:

Now you go to your webhook and save the file

You will get something like saved in you database:

1 Like

were you ever able to figure this out for audio? I’ve been trying for waaaay too long and still can’t figure it out.

@redvivi are you able to help me out here? I’m really struggling.

@fracs500 have you tested out your method with an audio file? I tried it, but for some reason I couldn’t get it to work for me, either.

Thanks for all the help here, everyone - I really want to be able to save these .ogg files and it’s just one of those things that’s a million times harder to do in Bubble than with other tools like Python, etc.

For audio it is necessary to follow the image above as well, just retrieve the “id” of the message, after this step continue with the download image.
You will receive the audio in ogg format in return.
Any questions put here so I can help you.

Thanks for the reply! The issue I’m having is that when I use the audio id and get the url for the media download and use it in a GET request API call, it doesn’t save the actual .ogg file since it doesn’t seem to like whatever the API is returning. It also won’t preview it properly when I initialize it in the API Connector.

Also, using the API call to get the media and saving it directly into a file field in my database like in the last example that @fracs500 showed us did actually save a file, but it’s not the actual audio file (that seems to be in Base64 when I open it in Postman, which works fine). It seems to be downloading the link to the media as a file and not the file itself.

I was going to attempt to make a javascript call inside of a plugin to see if that might work, bit ideally I don’t have to. If you have an example specifically for saving the audio that would be amazing. I’m not at my laptop now, but I can also send screenshots if what I’m seeing, but it’s basically the same issues that @pachocastillosr was running into.

I understood,
do the following:

1- When uploading the name put “.mp3” or “.ogg” at the end

2- save the result of the previous step in your bank with “https://” in front

Try it like this and tell me if you got it.

Awesome! I’ll check here in the next hour. In your example, is the API only sending back a binary file and I see that you’re able to save it as an .mp3? Is that supported along with the .ogg audio format?

Also, one more request if possible - can I please see a screenshot of your media download API call in Step 3 of your workforce?

Thanks again for all the help!

here it is

Sorry - I meant Bubble’s Step 3 (and your Step 2). The workflow that is “Download Media WhatsApp”. Can I please see that one, too?

Mine looks like this:

Hmmm, still not working and when I try to save that file after the media download API is called, it saves it like this in my database:

https://dafd75cb5f9ecf94744842ef37dfd849.cdn.bubble.io/f1682627761590x805220607392283600/798131984676762.ogg

Also, the file that is saved isn’t opening and seems to be in the wrong format. Here’s what it looks like in the file manager:

When I try to open it, here’s what opens (which tells me that it doesn’t know how to read it):

image

Thanks for the update and please let me know if there’s anything I’m missing here.

Also, is “arquivo_audio_2” a file type in your database?

image

Here

1 Like