API Documentation

Version 1.0

MatchResource

POST /api/v1/matches

Request body

application/json

Responses

CodeContent TypeDescription
201application/jsonMatch created successfully

Curl

curl -is -X POST -H 'accept: application/json' -H 'content-type: application/json' --data '' 'http://crickam.com/api/v1/matches'

DELETE /api/v1/matches/{controlId}/events/{eventId}

Parameters

NameTypeDescription
controlIdpath - stringREQUIRED.
eventIdpath - stringREQUIRED.

Responses

CodeContent TypeDescription
200*/*Success

Curl

curl -is -X DELETE -H 'accept: */*' 'http://crickam.com/api/v1/matches/(controlId)/events/(eventId)'

GET /api/v1/matches/{id}

Parameters

NameTypeDescription
idpath - stringREQUIRED.

Responses

CodeContent TypeDescription
200*/*Success

Curl

curl -is -X GET -H 'accept: */*' 'http://crickam.com/api/v1/matches/(id)'

POST /api/v1/matches/{id}/events

Parameters

NameTypeDescription
idpath - stringREQUIRED.
expected-versionheader - stringREQUIRED. The eventID of the match state that the client is expecting to change

Request body

*/*

Responses

CodeContent TypeDescription
204The event was applied successfully
404*/*No match with that ID exists
409*/*The client was trying to update an old version of the match, so was rejected

Curl

curl -is -X POST -H 'expected-version: ' -H 'accept: */*' -H 'content-type: */*' --data '' 'http://crickam.com/api/v1/matches/(id)/events'

GET /api/v1/matches/{id}/subscribe

Parameters

NameTypeDescription
idpath - stringREQUIRED.

Responses

CodeContent TypeDescription
200text/event-streamSuccess

Curl

curl -is -X GET -H 'accept: text/event-stream' 'http://crickam.com/api/v1/matches/(id)/subscribe'

PlayerResource

GET /api/v1/players

Responses

CodeContent TypeDescription
200*/*Success

Curl

curl -is -X GET -H 'accept: */*' 'http://crickam.com/api/v1/players'

POST /api/v1/players

Request body

application/x-www-form-urlencoded
NameTypeDescription
genderobject
bowlingHandednessobject
fullNamestringREQUIRED.
battingHandednessobject
playingRoleobject

Responses

CodeContent TypeDescription
201application/jsonSuccess

Curl

curl -is -X POST -H 'accept: application/json' -H 'content-type: application/x-www-form-urlencoded' -d 'gender=' -d 'bowlingHandedness=' -d 'fullName=' -d 'battingHandedness=' -d 'playingRole=' 'http://crickam.com/api/v1/players'

GET /api/v1/players/{id}

Parameters

NameTypeDescription
idpath - stringREQUIRED.

Responses

CodeContent TypeDescription
200*/*Success

Curl

curl -is -X GET -H 'accept: */*' 'http://crickam.com/api/v1/players/(id)'

TeamResource

GET /api/v1/teams

Parameters

NameTypeDescription
shortNamequery - string

Responses

CodeContent TypeDescription
200*/*Success

Curl

curl -is -X GET -H 'accept: */*' 'http://crickam.com/api/v1/teams?shortName='

POST /api/v1/teams

Request body

application/json

Responses

CodeContent TypeDescription
201application/jsonSuccess

Curl

curl -is -X POST -H 'accept: application/json' -H 'content-type: application/json' --data '' 'http://crickam.com/api/v1/teams'

GET /api/v1/teams/{id}

Parameters

NameTypeDescription
idpath - stringREQUIRED.

Responses

CodeContent TypeDescription
200*/*Success

Curl

curl -is -X GET -H 'accept: */*' 'http://crickam.com/api/v1/teams/(id)'

TestSetupResource

POST /api/v1/test-setup

Request body

application/json

Responses

CodeContent TypeDescription
200application/jsonSuccess

Curl

curl -is -X POST -H 'accept: application/json' -H 'content-type: application/json' --data '' 'http://crickam.com/api/v1/test-setup'

POST /api/v1/test-setup/ensureUser

Request body

application/json

Responses

CodeContent TypeDescription
200*/*Success

Curl

curl -is -X POST -H 'accept: */*' -H 'content-type: application/json' --data '' 'http://crickam.com/api/v1/test-setup/ensureUser'

LineUpResource

GET /api/v1/lineUps

Responses

CodeContent TypeDescription
200*/*Success

Curl

curl -is -X GET -H 'accept: */*' 'http://crickam.com/api/v1/lineUps'

POST /api/v1/lineUps

Request body

application/x-www-form-urlencoded
NameTypeDescription
captainIdstringREQUIRED.
battingOrderarrayREQUIRED.
Default value: []
teamIdstringREQUIRED.
wicketKeeperIdstringREQUIRED.

Responses

CodeContent TypeDescription
201application/jsonSuccess

Curl

curl -is -X POST -H 'accept: application/json' -H 'content-type: application/x-www-form-urlencoded' -d 'captainId=' -d 'battingOrder=' -d 'teamId=' -d 'wicketKeeperId=' 'http://crickam.com/api/v1/lineUps'

GET /api/v1/lineUps/{id}

Parameters

NameTypeDescription
idpath - stringREQUIRED.

Responses

CodeContent TypeDescription
200*/*Success

Curl

curl -is -X GET -H 'accept: */*' 'http://crickam.com/api/v1/lineUps/(id)'

VenueResource

GET /api/v1/venues

Responses

CodeContent TypeDescription
200*/*Success

Curl

curl -is -X GET -H 'accept: */*' 'http://crickam.com/api/v1/venues'

POST /api/v1/venues

Request body

application/x-www-form-urlencoded
NameTypeDescription
citystring
namestringREQUIRED.
timeZoneobject
territorystring

Responses

CodeContent TypeDescription
201*/*Success

Curl

curl -is -X POST -H 'accept: */*' -H 'content-type: application/x-www-form-urlencoded' -d 'city=' -d 'name=' -d 'timeZone=' -d 'territory=' 'http://crickam.com/api/v1/venues'

GET /api/v1/venues/{id}

Parameters

NameTypeDescription
idpath - stringREQUIRED.

Responses

CodeContent TypeDescription
200*/*Success

Curl

curl -is -X GET -H 'accept: */*' 'http://crickam.com/api/v1/venues/(id)'