Data Gifting Manual
Before using Data Gifting API you will first need to obtain a security token.
To secure our API we use OAuth2 with password flow for all endpoints. Authorization header must always contain a Bearer token obtained using tokenURL.
Obtaining token URL for authorization
POST
http://api.centili.com/auth/realms/api/protocol/openid-connect/token
Parameters
Parameter | Description | Type |
---|---|---|
client_id | Name of the client | string |
grant_type | Name of the flow: 'password' when obtaining a token using username and password, 'refresh_token' when refreshing an existing token | string |
username | Your username, required when obtaining tokens via password flow. | string |
password | Your password, required when obtaining tokens via password flow. | string |
refresh_token | Your refresh token, required when obtaining tokens via refresh token flow. | string |
Once you have acquired the Bearer token you can use the following instructions to assign Data Gifting
Assigning data
api.centili.com/datagifting/v1/service/transaction
Host: api.centili.com:443
Content-Type: application/json
token: *Bearer token obtained using tokenURL*
{
"serviceKey": "3586a2363bcd51a2b3c4d5f34918263a",
"msisdn": "4366124567",
"clientId": "454585",
"amount": 500 //in MB
}
Once the data has been assigned you can use the following GET requests to check on the services, balance and transactions.
Get transactions
api.centili.com/datagifting/v1/transaction?serviceKey=3586a2363bcd51a2b3c4d5f34918263a&msisdn=4366124567
Get a list of all data transactions for the given service key and msisdn. MSISDN is not required, in which case all transactions associated with the service are returned.
Get Services
api.centili.com/datagifting/v1/services?merchantId=11111
Get all services and packages for the merchant. If invoked via API Gateway, merchantId is not passed, but is read from Keycloak token.
Get Balance
api.centili.com/datagifting/v1/services/balance?serviceKey=3586a2363bcd51a2b3c4d5f34918263a&operator=FR_ORANGE
Get current state of all Service data pools associated with the given service key and operator (totalAmount, assignedAmount, expirationDate).
Updated almost 4 years ago