Integrating Google Drive, but not able retrieve content from Drive

Hi, I'm integrating Google Drive and I have connected the user account. Using the Find Files API I'm able to get the list of files with IDs, so we know API is working. But I'm not able to figure out which API to use to download or get content from PDF files on drive. The Parse API is returning Failed to execute action error. Tried it from the dashboard and Python API (without LLM), getting the same response.
8 Replies
Soham
Soham4mo ago
Hey! We will be adding this soon in next 24 hours. Also to make sure you don't get struck in cases like this we provide something called custom action -https://docs.composio.dev/patterns/actions/custom_actions We allow you to create your custom action like following
@action(toolname="googledrive", requires=["requests"])
def my_custom_action(auth: dict, custom_param: dict) -> str:
"""
Demonstrates making authenticated requests to the provider API

:param custom_param: Custom endpoint parameters
:param auth: Authentication dictionary provided by Composio
:return info: Response from the custom API endpoint
"""

# fetch authentication headers
headers = auth["headers"]
query_params = auth["query_params"]
base_url = auth["base_url"]

custom_endpoint_url = "/my_custom_endpoint?"

# add query params to the url
for key, value in query_params.items():
custom_endpoint_url += f"&{key}={value}"

response = requests.get(f"{base_url}{custom_endpoint_url}", headers=headers)

return str(response)
@action(toolname="googledrive", requires=["requests"])
def my_custom_action(auth: dict, custom_param: dict) -> str:
"""
Demonstrates making authenticated requests to the provider API

:param custom_param: Custom endpoint parameters
:param auth: Authentication dictionary provided by Composio
:return info: Response from the custom API endpoint
"""

# fetch authentication headers
headers = auth["headers"]
query_params = auth["query_params"]
base_url = auth["base_url"]

custom_endpoint_url = "/my_custom_endpoint?"

# add query params to the url
for key, value in query_params.items():
custom_endpoint_url += f"&{key}={value}"

response = requests.get(f"{base_url}{custom_endpoint_url}", headers=headers)

return str(response)
metropolitan-bronze
metropolitan-bronzeOP4mo ago
Thanks @Soham, Ill wait for the feature release. In cases if API is not available only then I would prefer Custom Action. But yes, this gives us the capability to expand the use cases.
jolly-crimson
jolly-crimson4mo ago
this is very interesting as we experience the same
metropolitan-bronze
metropolitan-bronzeOP3mo ago
Hi @Soham and team, any update on this issue? And can you share more details about the proposed fix? Is it a new API to fetch documents or will the Parse API be fixed?
Soham
Soham3mo ago
Hey, we are adding a endpoint to download file locally. The problem is though gooel drive download is little complicated so figuring out right way to navigate it.
metropolitan-bronze
metropolitan-bronzeOP3mo ago
Bumping this up. Hi @Soham @Karthikeya, Is there any update on this issue? Its one of the basic use cases for connecting Google Drive. If there some work done and its not production ready, can you share it with me? It will give us a head start to implement custom actions.
optimistic-gold
optimistic-gold3mo ago
hey @gemtushar - checking with the team. let me get back on this quickly.
metropolitan-bronze
metropolitan-bronzeOP3mo ago
@Karthikeya Any update on this? It would be great if you could share a draft custom action to download a file from Google Drive.

Did you find this page helpful?