CSVBox import webhook (called by CSVBox, not the client)
The CSVBox sheet’s API destination, with Server Side Validation on. CSVBox posts the submitted rows here; this one call both validates and accepts. Sheet setup: chunk size of at least 1000 (the whole file in one request), Results Page set to not close on import complete, and resubmission of All Rows, so each row keeps its row_number.
*
-
- Any error: HTTP 211 with the errors as CSVBox cell errors (
row_id= CSVBoxrow_number,column= the sheet column). CSVBox shows the fail screen and takes the agent back to its grid to correct and resubmit. Nothing is written: no import, no athlete, no notification.
- Any error: HTTP 211 with the errors as CSVBox cell errors (
-
- No error: the rows are persisted as the session’s import and queued, then HTTP 200. A 200 means only that MOGL accepted the batch; completion is the import’s own terminal status.
-
- A repeated delivery under a session that was already accepted returns 200 with the same import and creates nothing.
- Required, matching athlete signup:
first_name,last_name(max 255),email,phone(10 digits, the athlete’s own),sport(name) orsport_category_id,school(name) oruniversity_id,graduation_year(4 digits),dob,gender(Male, Female or Prefer not to say),us_citizen(Y/N). Optional:hometown,jersey_no(max 10),height,weight,bio(max 5000),profile_photo_url. Other keys are ignored. - A bad required field is an error on its cell. A bad optional field never is: the file is accepted, that field is left empty, and the row’s
messagein the results says which fields were skipped and why (CSVBox has no warnings). profile_photo_url(http or https) is downloaded in the background after the athlete is added: JPEG, PNG or WebP, up to 25 MB, public addresses only. If it cannot be used, the athlete keeps no photo and the reason is added to the row’smessage. A photo the athlete already has is never replaced.- An email or phone that already belongs to a MOGL account is an error, never a link, with athlete signup’s own messages on the field that is taken:
Email already exists(email) andThis phone number is already being used by an existing user(phone). The agent invites existing athletes by email instead. A shared test phone is refused. An athlete already on this agent’s roster is not an error: they are not duplicated, only their empty fields are filled. An email or phone that repeats within the file is an error on every occurrence. A sport or school that does not match one of MOGL’s by name is an error on that cell:The sport "X" was not found.orThe school "X" was not found. - Every rule is checked again when each row is provisioned, since an account can change in between; such a row fails in the results and can be retried. More than 1000 rows, or a file that arrives in parts, is a table error. Rate limit 60/min.
Authorizations
The import_token from POST /agent/roster-imports/session. The client passes it to the CSVBox importer in request_headers, and CSVBox sends it on every delivery to the import webhook. Encrypted with this environment's app key; it names the agent, the session and the environment.
Body
CSVBox's JSON delivery: one object per row.
1000Becomes the row's row_number in the results.
1
CSVBox's import id; new on every resubmission. Not used as the idempotency key.
79418895
55
"MOGL Agent Roster Import - Development"
Rows in the whole file. Must equal the number of rows in this request, or the file is reported as arriving in parts.
1
"development"
"roster.csv"
From the importer's setUser; not trusted for authorization.
Response
Accepted and queued, or already accepted under this session