You are on page 1of 8

API Swagger

Check my Bets: (will update once the sports API’s data will be fixed)

Endpoints :- bets
Type :- GET
Response :- {
"headers": [
{
"key": "userName",
"label": "User Name"
},
{
"key": "totalDeposited",
"label": "Total Deposited"
}
],
"rows": [
{
"userName": "jay",
"totalDeposited": 100
}
],
"totalRecords":50,
"page": 0,
"pageSize": 0,
"searchText": 0

}
Bet now flow

Endpoints :- betNow
Type :- post

Payload :-
{
contestID:1,
sportsID:12,
eventID:23,
Amount: 100,
paymentBy:’Paypal’
Currency: String(usd,inr etc)
}
Response :-

Status:201
{
message:’Bet successfully created’
}

Status:400
{
message:’No such event/contest/sports found’
}
Check my bet:

Endpoints :- checkBets
Type :- GET
Response :-{
"headers": [
{
"key": "bettingDate",
"label": "Betting Date"
},
{
"key": "matchDate",
"label": "Match Date"
},
{
"key": "gameType",
"label": "Game Type"
},
{
"key": "club",
"label": "Club"
},
{
"key": "matchTime",
"label": "Match Time"
},
{
"key": "location",
"label": "Location"
},
{
"key": "bettingAmount",
"label": "Betting Amount"
},
{
"key": "bettingStatus",
"label": "Betting Status"
},
{
"key": "paymentBy",
"label": "Payment By"
}
]
,
"rows": [
{
"bettingDate": "26/09/2023",
"matchDate": "30/09/2023",
"gameType": "Football",
"matchTime": "1:50 PM",
"bettingAmount": "$500",
"bettingStatus": "Active",
}
],
"totalRecords":50
}
Check My Bet By Id

Endpoints :- checkBetById/:id
Type :- get

response :-
{
"bettingDate": "2023-09-26",
"matchDate": "2023-09-30",
"gameType": "Football",
"club": "Español vs Real Madrid",
"matchTime": "1:50 PM",
"location": "Wembley Stadium",
"bettingAmount": "$500",
"bettingStatus": "Active",
"paymentBy": "Paypal"

}
status :-

Status:201
{
message:’Bet successfully created’
}

Status:400
{
message:’No such event/contest/sports found’
}
Money Module

1). Transaction History List:

Endpoints :- transactionHistory
Type :- GET
Response :- {
"headers": [
{
"key": "date",
"label": "Transaction Date"
},
{
"key": "receiverName",
"label": "Receiver Name"
},
{
"key": "amount",
"label": "Amount"
},
{
"key": "status",
"label": "Status"
}
],
"rows": [
{
"date": "jay",
"receiverName": 100,
“amount”: 100,
“status”: 1 | 2 | 3
}
],
"totalRecords":50,
"page": 0,
"pageSize": 0,
"searchText": 0

Note: here status value 1 - pending, 2- Completed, 3- Aborted


User Management

User List:
Endpoints :- userList/
Type :- GET

Response :- {
"headers": [
{
"key": "userID",
"label": "id"
},
{
"key": "firstName",
"label": "First Name"
},
{
"key": "lastName",
"label": "Last Name"
},
{
"key": "emailId",
"label": "Email Id"
},
{
"key": "status ",
"label": "Status"
}
],
"rows": [
{
"userID": "jay",
"receiverName": 100,
“amount”: 100,
“status”: 1 | 2
}
],
"totalRecords":50,
"page": 0,
"pageSize": 0,
"searchText": 0

}
Note status: 1- Active , 2-Suspended
Profile:

Endpoints :- userById/:id
Type :- GET
Response :- {
userID:number,
firstName:string,
lastName:string,
emailId:string,
address :string,
status:integer,
profilePic:base64String or formData
}
User Profile Actions

Update the user


Endpoints :- userById/:id
Type :- Put
payload :- {
userID:number,
firstName:string,
lastName:string,
emailId:string,
address :string,
status:integer,
profilePic:base64String or formData,
Action:1
}
Note here action 1-update 2-suspend
Delete or suspend the user
Endpoints :- deleteUser/:id
Type :- Delete
payload :- {
userID:number,
deletedByAdmin:string
}

You might also like