0

I was successful in publishing (POST) a JSON file in Zapier and creating a Storage for it. However, I´d like to access the JSON in Zapier Storage using a Python code run locally. I am able to access the storage with Python3, see that is something written there, but I cannot access the JSON contents.

import urllib
import json
import codecs

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

access_token = "password"

def GetStorage(page_id, access_token):
    url = 'https://hooks.zapier.com/url/'
    response = urllib.request.urlopen(url)
    data = json.load(reader(response))
return data

a=GetStorage(url, access_token)
print(a)

All I get is:

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

When in fact I need:

{'Name':'value',
  'Address': 'value'
}

Any ideas ?

razimbres
  • 4,715
  • 5
  • 23
  • 50

1 Answers1

3

David here, from the Zapier Platform team.

You're close! hooks.zapier.com is the url we use for incoming webhooks, so we always reply with a 200 and the response body you're seeing.

Instead, use store.zapier.com. You'll also want to make sure to include your secret. A full request URL will look like:

https://store.zapier.com/api/records?secret=test

which will return arbitrary json data:

{
  "name": "david",
  "job": "programmer"
}

The full docs are in json here: https://store.zapier.com/

xavdid
  • 5,092
  • 3
  • 20
  • 32