BHTOM-Team / bhtom2

7 stars 2 forks source link

Photometry download broken from API #195

Closed wyrzykow closed 1 month ago

wyrzykow commented 2 months ago

Part of my script for photometry download:

request_body = {
          "name": "Gaia19axp"
    }

# Define headers
headers = {
    'accept': 'application/json',
    'Authorization': f'Token {auth_token}',  ## you can hard-code your token here as well
    'Content-Type': 'application/json',
    'X-CSRFToken': 'uUz2fRnXhPuvD9YuuiDW9cD1LsajeaQnE4hwtEAfR00SgV9bD5HCe5i8n4m4KcOr'
}
api_url =  "https://bh-tom2.astrolabs.pl/targets/download-photometry/"

# Send the POST request
response = requests.post(api_url, json=request_body, headers=headers)

from io import StringIO
df = pd.read_csv(StringIO(response.text), sep=';')

gives an error: {"Error ":"Something went wrong Field \'id\' expected a number but got \'Gaia19axp\'."}

URGENT fix needed to API or to my script :)