Batches 👑

Batch operations are used to make multiple one type operations with one request.

This endpoint is only available for our GURU clients only 👑

Currently, the following operations can be executed in batches :

  • Bulk Cashback

  • Bulk Redeem

  • Bulk Balance Inquiry

Each batch is limited to a max of 1000 entries per batch.

Using the batch API is simple as it provides unified interfaces to execute any of the above supported operations. It can be used to run async batches and track them in your system.

To start a batch operation, you need to start a batch request via the Start Batch API. You can then keep checking the status of a batch operation started via its Batch ID. The status of the batch can be one of the following

Once the batch status is finished, you will be able to check the batch operation outcome including total processed, total failed, and return body object if any.

Available Endpoints

POST- Start Batch Operation

https://api.gameball.co/api/v3.0/integrations/batch

This API call is used to efficiently perform multiple operations within a single HTTP request, Instead of sending individual requests for each operation.

Request

Body

{
   "method":"POST",
   "operation":"cashback",
   "params":{},
   "body":{
[
   {
      "playerUniqueId":"Player1",
      "transactionId":"tra_156473",
      "transactionTime":"2021-07-25T14:22:42.097Z",
      "amount":100
   }
]
}

Response

Usage Example

curl -X POST -H 'apiKey: 807b041b7d35425988e354e1f6bce186' \
       -H 'secretKey: klmb041b7d354259l3u4ft35e1q2r3703'
       -d '{
            "method":"POST",
            "operation":"cashback",
            "params":{
               "name":"mike"
            },
            "body":{}
         }'
 -v -i 'https://api.gameball.co/api/v3.0/integrations/batch'

GET- Get Batch Operation

https://api.gameball.co/api/v3.0/integrations/batch/:batchId

This API call is used to fetch the results and status of a batch operation.

Request

Header

Path Parameters

Response

Body

{
   "method":"POST",
   "operation":"cashback",
   "errorCount":0,
   "totalCount":100,
   "finishedCount":60,
   "startedAt":"2012-12-30 16:50:11",
   "createdAt":"2012-12-30 16:50:11",
   "status":"Running",
   "response":{}
}

Usage Example

curl -X GET -H 'apiKey: 807b041b7d35425988e354e1f6bce186' \
       -H 'secretKey: klmb041b7d354259l3u4ft35e1q2r3703'
 -v -i 'https://api.gameball.co/api/v3.0/integrations/batch/213'

DELETE- Stop Batch Operation

https://api.gameball.co/api/v3.0/integrations/batch/:batchId

This API call is to halt the execution of a running batch operation.

Request

Header

Path Parameters

Usage Example

curl -X DELETE -H 'apiKey: 807b041b7d35425988e354e1f6bce186' \
       -H 'secretKey: klmb041b7d354259l3u4ft35e1q2r3703'
 -v -i 'https://api.gameball.co/api/v3.0/integrations/batch/213'

Last updated