Help with GET reports API call

Hi all, I’m using GrampsWeb on 6.0.6 with Gramps Web API 3.5.0.

I currently use the getMetadata API to get metadata using python.

I’m now attempting to use the getAllReports API to get details on reports but I am getting a 401 error:

{‘message’: “Missing JWT in headers or query_string (Missing Authorization Header; Missing ‘jwt’ query paramater)”}

My script is below, with the token redacted

headers={'accept': 'application/json', 'Authorization': 'Bearer <token>'}
link='https://gramps.malakan.co.uk/api/reports?include_help=false'
resp = requests.get(f"{link}", headers=headers, timeout=10)

The token works fine for getting the metadata but not with the reports. What am I doing wrong, do I need to submit the token differently for reports?

This should return 308 because you’re missing the trailing slash. Not sure our API docs are correct on trailing slashes, would be worth reviewing.

Thank you David, I had tried with the trailing slash but perhaps my token expired and I missed it.

Working now, thank you so much!

I’d also like to use the API to generate reports, on the API doc page I see two similar ones, postReportFile and getReportFile. Which do I need to use, I assume post, and is there documentation for the data input?

For anyone that finds this - the correct url was https://gramps.malakan.co.uk/api/reports/?include_help=false