project chalmers-card-balance
Public REST API for checking account balance of Chalmers Student Union cards
johanwinther/chalmers-card-balance
Public REST API for checking account balance of Chalmers Student Union cards
- Tuesday, May 29, 2018
- by johanwinther
- Repository
- 0 Watchers
- 0 Stars
- 5 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 1 Forks
- 1 Open issues
- 4 Versions
- 0 % Grown
THIS HAS BEEN DEPRECATED SINCE THE SERVICE HAS ENABLED A CAPTCHA
chalmers-card-balance
Public REST API for checking account balance of Chalmers Student Union cards, (*1)
Installation
Add johanwinther/chalmers-card-balance
as a require dependency in your composer.json
file:, (*2)
composer require johanwinther/chalmers-card-balance
Rename .htaccess.tmp to .htaccess and set the RewriteBase to the absolute folder path of card.php., (*3)
API
Show Card Balance
Returns JSON data of card balance., (*4)
-
URL, (*5)
/<Card number>
, (*6)
-
Method:, (*7)
GET
, (*8)
-
URL Params, (*9)
Required:, (*10)
Card number
- 16-digit Student Union card number, (*11)
-
Data Params, (*12)
None, (*13)
-
Success Response:, (*14)
-
Code: 200
Content:
json
{
"cardHolder": "Emil Emilsson",
"cardNumber": "1111222233334444",
"cardBalance": {
"value": 200.01,
"currency": "kr"
}
}
-
Error Response:, (*15)
-
Code: 400 BAD REQUEST
Content:
``` json
{
"error": "Invalid card number: should be 16 digits."
}
**Explanation:** Request was not 16 digits.
OR
* **Code:** 404 NOT FOUND <br />
**Content:**
``` json
{
"error": "Invalid card number: card not found."
}
Explanation: Card is not registered in the system., (*16)
OR, (*17)
-
Code: 408 REQUEST TIMED OUT
Content:
json
{
"error": "Connection timed out."
}
Explanation: Could not load external service.
-
Sample Call:, (*18)
$.ajax({
url: "https://ftek.se/api/v1/1111222233334444",
dataType: "json",
type : "GET",
success : function(r) {
console.log(r);
}
});
dev-master
9999999-dev
Public REST API for checking account balance of Chalmers Student Union cards
Sources
Download
MIT
The Requires
by
Johan Winther
v1.2.0
1.2.0.0
Public REST API for checking account balance of Chalmers Student Union cards
Sources
Download
MIT
The Requires
by
Johan Winther
v1.1.0
1.1.0.0
API for fetching card balance of Student Union Card
Sources
Download
MIT
The Requires
by
Johan Winther
v1.0.0
1.0.0.0
API for fetching card balance of Student Union Card
Sources
Download
MIT
The Requires
by
Johan Winther