Guy’s. I hope someone can help me with this. I am trying to do the following
Setup a slack trigger that triggers when someone uploads a file in a channel (works, no problem)
But then I try to get that file (usually a PDF) and get the text out of it, but here is the problem, I cannot access this file in Pipedream.
I tried to get it from url_private_download but- this requires you to be logged in and even though I would expect that the authentication would be inherited from the trigger, it wasn’t.
also:
I tried to do it ‘manually’ using a code block and the token to fetch it, like so (code below) But this gives HTML (most likely the ‘not found’ page) Can anyone help me with this? I have a deadline that low-code is perfect for and I really want this to work this way. Is it even possible? The 'get-file' action is no help at all.
Thank you so much!
def handler(pd: "pipedream"):
url = pd.steps["get_file"]["$return_value"]["file"]["url_private_download"]
print(url)
token = 'xoxe.xoxp-1-Mi0yLTU2Nzg3MzE1NDY0MzktNTcwNTkzNDgzNTY4MS02MDQ5NzAxODY2MTk3LTYwNDU5ODE5MDc2MjItNGQ1NTkwZjAxYjg4Yjk1NjJlNzM3MGI3MjRjZTE4MGQ2MmY*************'
headers = {'Authorization': 'Bearer %s' % token}
response = requests.post(url=url, headers=headers, timeout=120)
print(response.content)