How to retrieve JSON content from Zapier Storage using Python

I managed to store a JSON file in Zapier Storage using a POST request and everything worked fine. Now I want to fetch that JSON data using Python code that runs on my local machine.

I can connect to the storage and see there’s data there, but I’m only getting metadata instead of the actual JSON content I stored.

Here’s my current Python code:

import urllib.request
import json
import codecs

reader = codecs.getreader("utf-8")
api_key = "my_secret_key"

def FetchStorageData(storage_url, api_key):
    endpoint = 'https://hooks.zapier.com/storage/'
    req = urllib.request.urlopen(endpoint)
    result = json.load(reader(req))
    return result

response = FetchStorageData(endpoint, api_key)
print(response)

But instead of my actual JSON data, I only get this response:

{'attempt': '5a539a49-65eb-44f8-a30e-e171faf7a680',
 'id': '1b38d21a-0150-46df-98c1-490a0d04b565',
 'request_id': '5a539a49-65eb-44f8-a30e-e171faf7a680',
 'status': 'success'}

What I actually need to get is the stored JSON content like:

{'CustomerName': 'John Doe',
 'Location': 'New York'}

Any suggestions on how to fix this?

your missing the storage_url parameter in the actual request - you pass it to the function but then dont use it. also the endpoint should probably include your specific storage key/path, not just the base url. try something like endpoint + your_storage_key and add authentication headers with your api key

Looking at your code, the main issue is that you’re not authenticating properly with the API key and you’re missing the specific storage record ID in your request. The response you’re getting is just confirmation that the API call went through, not the actual stored data. You need to modify your request to include proper authentication headers and target the specific storage record. Try adding the X-Secret header with your API key and make sure you’re using the correct endpoint format that includes your storage record identifier. Also, you might want to use a GET request with proper headers instead of just urllib.request.urlopen without parameters. I had similar issues when I first started working with Zapier Storage API - the documentation isn’t super clear about the authentication requirements. Make sure your API key has the right permissions for reading storage data as well.

The problem is in your request method and URL construction. You’re using the base storage endpoint without specifying which data to retrieve, and urllib.request.urlopen defaults to GET but doesn’t include authentication. I ran into this exact issue last month when working with Zapier webhooks. You need to construct the full URL with your storage key and pass the secret key as a parameter or header. Try modifying your endpoint to include the specific storage path like https://hooks.zapier.com/storage/your-storage-key and add ?secret=your_api_key to the URL, or better yet use the requests library with proper header authentication. The metadata response you’re seeing usually indicates the API recognized your call but couldn’t locate the specific storage record you want to access.