Overview
SearchForPlaysComplex returns plays that match supplied filter criteria.
The search criteria are supplied as XML, converted to Base64, and passed using the criteria query parameter.
All criteria must be satisfied for a play to be included in the response.
Valid play field keys can be retrieved using:
Thunder API – GetAllPlayFieldHeadings
Valid Game Property keys and supported operators can be retrieved using:
Thunder API – GetGamePropertyInfo
Endpoint
GET https://tclightningservices.xosdigital.com/Api/ThunderAPI/SearchForPlaysComplexAuthentication Headers
SearchForPlaysComplex requires API authentication headers.
For required authentication headers and how to generate the authorization value, see:
Thunder API – Authentication Headers
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
criteria |
string | Yes | Base64-encoded XML query string containing the play search criteria |
includeClips |
boolean | Yes | Includes clip/video information when true; returns play metadata only when false
|
Criteria XML Structure
The criteria parameter uses XML containing one or more criteria elements.
<criterias>
<criteria key='FIELD_KEY' op='OPERATOR' val='VALUE'/>
</criterias>Each criteria element defines one filter condition.
Criteria Attributes
| Attribute | Required | Description |
|---|---|---|
key |
Yes, unless gamepropertykey is used |
Thunder play field key to evaluate. Valid keys can be retrieved using GetAllPlayFieldHeadings. |
gamepropertykey |
Optional | Game Property key to evaluate instead of a play field. Valid Game Property keys can be retrieved using GetGamePropertyInfo. |
op |
Yes | Operator used to evaluate the value |
val |
Optional | Single value to compare against |
For multiple values, use nested value elements instead of the val attribute.
<criteria op='Equal' key='Football.Down'>
<value val='1'/>
<value val='3'/>
</criteria>Example Criteria
Example 1 – Search by Down, Game Key, and Game Date
<criterias>
<criteria op='Equal' key='Football.Down'>
<value val='1'/>
<value val='3'/>
</criteria>
<criteria op='Equal' key='Football.GSISGamekey' val='57242'/>
<criteria op='Is_In_Between' key='Football.GameDate'>
<value val='2017-09-01'/>
<value val='2017-10-01'/>
</criteria>
</criterias>Example 2 – Search by Game Property
<criterias>
<criteria op='Equal' key='Football.Down'>
<value val='1'/>
<value val='3'/>
</criteria>
<criteria op='Equal' gamepropertykey='GameType' val='Regular Season'/>
<criteria op='Equal' gamepropertykey='ScoutedTeamId' val='TEAM_GUID'/>
</criterias>Request Format
After creating the criteria XML:
- Convert the XML to Base64
- URL-encode the Base64 value
- Supply the value using the
criteriaquery parameter
https://tclightningservices.xosdigital.com/Api/ThunderAPI/SearchForPlaysComplex?criteria={BASE64_ENCODED_XML}&includeClips=falseincludeClips
includeClips controls whether clip/video information is included in the response.
| Value | Description |
|---|---|
true |
Includes clip/video information. This is slower. |
false |
Returns play metadata only. This is faster. |
Use includeClips=false when clip/video URLs are not required.
Response
The API returns an array of play objects.
Response content type:
application/jsonExample response structure:
[
{
"Id": "00000000-0000-0000-0000-000000000000",
"Name": "string",
"PlayFieldValues": {},
"Clips": [],
"ViewSequenceId": "string",
"ClipTypeId": "string",
"ViewList": [],
"DrawingList": {},
"EditPlayMetadatas": [],
"EditPlayId": "00000000-0000-0000-0000-000000000000",
"EditPlayIndex": 0,
"TCPlayType": 0
}
]Notes
- All criteria must be satisfied for a play to be returned.
- Decimal values are rounded to one decimal place before comparison.
-
Is_In_Betweenincludes values equal to the search limits. - Multiple values with
Equalreturn plays matching any supplied value.
For information on retrieving valid play field keys, see:
Thunder API – GetAllPlayFieldHeadings
For information on retrieving valid Game Property keys and supported operators, see:
Thunder API – GetGamePropertyInfo
Comments
0 comments
Please sign in to leave a comment.