FIRST-Tech-Challenge / scorekeeper

FIRST Tech Challenge Live Scorekeeper Software
91 stars 21 forks source link

retrieving schedule doesn't work #777

Closed qweztech closed 3 weeks ago

qweztech commented 3 weeks ago

I'm using Python 3.12.3 on Ubuntu Linux 24.04.1 LTS. I have a valid API key.

I'm trying to retrieve the schedule from an FTC event.

When I use python package 'requests' and the URL 'https://ftc-api.firstinspires.org/v2.0/2024/schedule/USTXNSM1' I get an empty response string ('').

To verify it works, I run the same request with the URL 'https://ftc-api.firstinspires.org/v2.0/2024/rankings/USTXNSM1' to get rankings, and it returns a valid response status of 200 with rankings data.

The code I'm running for bot the successful and unsuccessful requests is:

def get_info(self,url):
    key_str = self.encode_key()

    payload={}
    headers = {
        'Authorization': 'Basic ' + key_str,
        'If-Modified-Since': ''
    }

    # Grab some data
    response = requests.request("GET", self.url, headers=headers, data=payload)
tvbarnette999 commented 3 weeks ago

You need to add either a teamNumber or tournamentLevel query parameter. Try: https://ftc-api.firstinspires.org/v2.0/2024/schedule/USTXNSM1?tournamentLevel=qual

Event Schedule Endpoint Documentation

qweztech commented 3 weeks ago

Thank you, I apologize, I need to read the doc’s more closely

Joe Varnell

Super Nerd

FIRST ® Technical Advisor

FIRST ® Senior Mentor Emeritus

FIRST ® in Texas Key Volunteer

More than Robots

From: Thomas Barnette @.> Sent: Sunday, November 10, 2024 12:55 PM To: FIRST-Tech-Challenge/scorekeeper @.> Cc: qweztech @.>; Author @.> Subject: Re: [FIRST-Tech-Challenge/scorekeeper] retrieving schedule doesn't work (Issue #777)

You need to add either a teamNumber or tournamentLevel query parameter. Try: https://ftc-api.firstinspires.org/v2.0/2024/schedule/USTXNSM1?tournamentLevel=qual

Event Schedule Endpoint Documentation https://ftc-events.firstinspires.org/api-docs/index.html#tag/Schedule/paths/~1v2.0~1%7Bseason%7D~1schedule~1%7BeventCode%7D/get

— Reply to this email directly, view it on GitHub https://github.com/FIRST-Tech-Challenge/scorekeeper/issues/777#issuecomment-2466845377 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AIEVONCVNAWJMXQXVOSOSXTZ76TW3AVCNFSM6AAAAABRQM7GNCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINRWHA2DKMZXG4 . You are receiving this because you authored the thread. https://github.com/notifications/beacon/AIEVONAQ45KYDO57XLSGTUTZ76TW3A5CNFSM6AAAAABRQM7GNCWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTUTBEJMC.gif Message ID: @. @.> >

rachmo commented 3 weeks ago

Thanks Joe! Since it sounds like this will solve your problem, I'll go ahead and close this issue.

Please feel free to reopen or open a new issue if you're still experiencing a problem.