Using RevShare API
Prerequisites
An API key and relevant Account ID - to authorise the request
Requesting an API key
Contact your Genius CSM to obtain an API key from the Genius IT team.
Uploading data
Method: POST
Queues a valid set of data for upload in the RevShare database. Once the upload is accepted and response 200 is received, the upload will be queued for full validation by the solution. Final validation information can be received by submitting the GET request shown below.
API Endpoints
Mandatory query parameters
Parameter | Description | Value type |
---|---|---|
uploaded_by | Email address of the uploading client’s contact | string <email> Example: |
account_id | Account ID of the client | number Example: |
start_date | Start date of the uploaded data | string^\d\d\d\d-\d\d-\d\d$ (YYYY-MM-DD) Example: |
end_date | End date of the uploaded data | string^\d\d\d\d-\d\d-\d\d$ (YYYY-MM-DD) Example: |
provided_for | RevShare or NFL upload | string Enum: |
template | Account or Brand level NFL or Inplay (RevShare) upload | string Enum: |
reference
| Automated upload reference number or identifier. | string Example: This reference appears on emails sent to the admin contact of the client |
token | Client's Authentication Token | string Example: |
JSON body expected
You should preferably submit the JSON body with 1000 fixtures per request. A bigger amount of fixtures may cause the API to respond slower than expected. Calls with more than 5000 fixtures may not succeed.
Each fixture must be placed in a separate JSON object. You can expand the fields below to see a full list of properties that must be submitted per fixture.
Please note that the JSON object keys must be lowercase!
Response
The API returns a 200 response when the upload passes first-level validation (full validation is done later by the solution). In case the upload is successful, a JSON body is also returned in the request that also specifies the Upload ID. The Upload ID can later on be used to validate if the upload has any errors.
Email Notifications
The API does not send notifications to the RevShare InPlay or NFL contact in case the data uploaded has no errors. In case of errors, the API will notify the RevShare contact that there was an error. The errors will be sent via email for each chunk of data that is loaded. Genius is looking to change this behaviour to one email per upload.
Example Python Function to upload data
The example below uses Python to upload API data. What it does in short:
Ingests a CSV, lowercases all keys and converts it to JSON objects
Submits the data to the API via the upload_revshare_data function which users the requests module. The function takes care of splitting the list of JSON objects to chunks of 1000 (if more than 1000).
The function returns, via print statements, the response of the API
Getting the status of an upload
Method: GET
Returns the status of an upload that was done via the request above. Returns rich error information for smaller numbers of errors.
API Endpoints
Mandatory query parameters
Parameter | Description | Value type |
---|---|---|
token | Client's Authentication Token | string Example: |
Path parameters
Parameter | Description | Value type |
---|---|---|
{upload_uuid} | The upload_uuid that is returned by the POST/upload request. (See example responses above) | string <uuid> Example: |
Response
The response will return the upload_uuid, upload_ref and status of the upload. Errors will be summarised per error type in the response.
Downloading Usage
Method: GET
Returns a full set of usage data from the Genius Sports systems for the specific customer account. All data is returned in B2B upload format (Brands included).
API Endpoints
Mandatory query parameters
Parameter | Description | Value type |
---|---|---|
year | The year for the requested usage data | string Example: |
month
| The month for the requested usage data | string Example: |
limit | A limit for the result size. Defaults to 1000. Requesting more than a few thousand rows is not advised as the responses will get slower. | integer Example: |
token | Client's Authentication Token | string Example: |
Path parameters
Parameter | Description | Value type |
---|---|---|
{account_id} | The Account ID of the customer | string Example: |
Response
The API returns a 200 response when the usage data was successfully generated. The usage data is passed as a JSON in the body of the response. A “next” link is returned as part of the response that can be followed for the next page of results if multiple pages or results need to be served.
NB: usage_gameweek
is only returned for NFL fixtures.