unitedworldwrestling / arena-public

14 stars 5 forks source link

How to add weight category to athelete using API? #175

Closed antohasv closed 2 weeks ago

antohasv commented 2 weeks ago

Which application you are experiencing a problem with Arena

Describe the bug I'm trying to add Person to Event. In the interface I have the 3 fields: team, person, weight category. I can't find the API endpoint that can do the same action

csabavirag commented 2 weeks ago

Adding a fighter to an event requires the following steps (data relation is described in "Arena Training Series - REST API Interface" starting from 13:05):

  1. You must have a valid Person record
  2. After the Sport Event is created, a Weight Category and a SportEventTeam are added
    1. Create an Athlete, linking it to the Person via personId and their sportEventTeamId POST /api/json/athlete/{{sportEventId}} body: {"personId": "{{personId}}","sportEventTeamId": "{{sportEventTeamId}}"}
    2. Create a Fighter, referencing to the Athlete's athleteID as well as to WeightCategory via sportEventWeightCategoryId POST /api/json/fighter/{{athleteID}} body: {"sportEventWeightCategory": "{{sportEventWeightCategoryId}}"}