Trying to figure out how to read data from the FILE directory from a Model API.

sean.mcclure
sean.mcclure Member Posts: 2
edited November 2020 in Q&A

Trying to figure out how to read data from the FILE directory in a Domino Project, through a published Model API.

I am currently using the Domino API to make a request, since any python invoked by the model API is inside an executor at runtime, and thus doesn't have direct access to the FILE directory.

This is my code:


from domino import Domino

import requests

def fetch_file(filename):

headers = {'X-Domino-Api-Key': 'my_api_key'}

request = requests.get('https://domino.my_comp_url.com/v1/projects/my_username/project_name/data/' + filename + '.json', headers=headers, verify=False)

return(request)

But this doesn't work. Domino API seems to suggest using Blobs, but I would need the Blob ID and not sure where to find that.

Answers

This discussion has been closed.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!