Mass Creation of Event Credits

38 views
Skip to first unread message

David Zemon

unread,
Mar 19, 2023, 3:00:22 PM3/19/23
to motorsportreg-api-developers
Our event chair decided it would be a great idea to reward our leadership by offering event credits to all leadership members for all events for the entire year.

I didn't like the idea creating a discount code to be shared among leadership as I feared the uncomfortable situation that could arise if a leadership member used that discount code for a spouse or family member. Some of those lines can get pretty fuzzy (if the spouse isn't an "official" leader but everyone knows they help out a bunch, should they get credit?), and I wanted to avoid that drama ever coming into question.

So that meant I needed to apply credits to specific users' accounts. But, as far as I am aware, there is no way to create bulk credits for users.
Thank goodness MSR has an API and I know how to make HTTP calls!

After way more work than I initially expected, I now have a Python application that takes in a variety of parameters (namely a list of members and events) and creates an MSR credit for every member/event combination. I've done my best to make this flexible and parameterized so that you might be able to use this same application for your own needs without modifying any of the files that are included in the Git repository (you will need to create one file, but it's ignored via .gitignore).

You can find the application and its readme here: https://github.com/DavidZemon/MotorsportReg-Credit-Creator

If you have questions, feel free to direct them here or to the issue tracker on GitHub.

Have a great Sunday all. I hope at least one of you lives where it's warm enough to go driving today!

Cheers,
David
Message has been deleted

David Zemon

unread,
Jul 25, 2023, 4:41:15 PM7/25/23
to motorsportreg-...@googlegroups.com
Blast from the past :)

  1. The only thing that really sticks out to me was having to grab UUIDs for every user and event. The only way I was able to do that was open the web page for each account profile and event settings and then extract the UUIDs for each from the URL. That was pretty cumbersome, and I don't recall if that was well-documented or not. I have a feeling that it took some guess-and-check to figure out what ID needed to be passed in.
    The docs that are out there are decent enough too, but something like an OpenAPI spec would have been even better, with sample invocations automagically generated for various tools.
    Wish I could remember exactly what took so long... everything I mentioned above was relatively small, I think. Sorry I can't be more specific.
    Honestly, for a website geared toward car folk and not developers, I was pleasantly surprised at how easy it was to use as a developer. I think I got the whole thing hammered out in a single afternoon and evening.
  2. No, seems either no one else had a need for this solution, or my solution was so perfect and so well documented that they never needed to reach out for help. We can probably both take an educated guess as to which of those is more likely :)

On Tue, Jul 25, 2023 at 2:28 PM 'Ian Burns' via motorsportreg-api-developers <motorsportreg-...@googlegroups.com> wrote:
Hi David,

Thank you so much for sharing this! We will absolutely take a look at the repo, and we'll keep this in mind if/when we need to implement something along these lines.

Just out of curiosity:
1. Did you run into any major issues while setting this up?
2. Has anyone reached out to you about using this? We're curious how many people might be interested in this type of feature.

--
You received this message because you are subscribed to a topic in the Google Groups "motorsportreg-api-developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/motorsportreg-api-developers/CF1xOYk3w18/unsubscribe.
To unsubscribe from this group and all its topics, send an email to motorsportreg-api-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/motorsportreg-api-developers/9bd42fc2-1640-4b47-b251-0b9ec9b2c341n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages