I went to https://console.cloud.google.com/ and enabled the google assistant API. After that I went to the credentials part, created a service account and downloaded the JSON file containing the login credentials. I have also generated an API key, but I cannot get the proper code to call the Google Assistant API from my PHP file on my local machine. Can anyone provide me with the code? You can also provide the code in node.js.
I tried some solutions which I obtained from ChatGPT and Google Bard, where I installed the google/apiclient library but whatever code I got from there gave me error.