Skip to content

Instantly share code, notes, and snippets.

@vershimajr
Created August 31, 2019 02:49
Show Gist options
  • Save vershimajr/080725f0cdaac30c3f076b0d707eec13 to your computer and use it in GitHub Desktop.
Save vershimajr/080725f0cdaac30c3f076b0d707eec13 to your computer and use it in GitHub Desktop.
Post File To Temporal with Python
import requests
prod_pin_url = 'https://api.temporal.cloud/v2/ipfs/public/file/add'
headers = {'Cache-Control':'no-cache', 'Authorization':'Bearer '+'AUTH_TOKEN_STRING',}
files = {'file': open('FILENAME','rb')}
data = {'hold_time':'HOLD_TIME_INT'}
r = requests.post(prod_pin_url,headers=headers,files=files,data=data)
ipfs_hash = r.json()['response']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment