leuchte / number26 Goto Github PK
View Code? Open in Web Editor NEWSimple PHP wrapper for the unofficial number26.eu api
License: MIT License
Simple PHP wrapper for the unofficial number26.eu api
License: MIT License
When I call the N26 API now, I get the error: mfa_required: MFA token is required from their API.
I noticed that when a API error is called, 'die' is called. I suggest we change this to throw an exception instead. But, would you know a workaround for this? I guess MFA is multi-factor authentication...
/app/vendor/leuchte/number26/src/Number26.php:111
Stopped working yesterday, did they change something?
Thanks for developing this
Best regards
Philipp
It's only partially connected with this repository, although it's always good to ask. I decided to create an issue instead of writing email, because those information might be useful for other people.
I'm thinking about writing ruby bindings for Number26 API, and I was wondering if it's legal to keep authorization key
(which is required to get personal token) inside own library.
DId you ask Number26 about that?
Since a few days, i cant get any Transactions with your code.
Quick heads up:
If you wish to retrieve a CSV report you must not send an 'Accept: application/json' header.
I helped this issue by uncommenting Number26.php:236
Maybe a switch in the getReport() method would be a cleaner solution though
Hi,
Sometimes the token becomes invalid but the cookie session is still here so your method isValidConnection() still returns true.
You should check in callApi if the apiResponse returns an error I think:
if(isset($this->apiResponse->error) AND $this->apiResponse->error == "invalid_token"){
//do something because session is not valid anymore
}
Best regards.
It looks like N26 changed its structure again, as I can't download the transactions anymore.
I used the example from the start page:
<?php
$n26 = new leuchte\Number26\Number26('[email protected]', 'mypassword');
// Get transactions
$transactions = $n26->getTransactions(['sort' => 'visibleTS', 'dir' => 'ASC', 'offset' => 0, 'limit' => 200]);
It looks like getting the oauth token fails, as the API result for that is a "HTTP/1.1 401 Unauthorized".
Maybe this is an alternative
https://n26.dashboard.sandbox.token.io/swagger
Hi !
Thank you for this great work !
I searched a long time to get my transactions from n26 with php.
And you project - It works !
Now I have so question to optimize the process.
I would like to this script every day once.
But how can realize the login automatically. I tested this code part:
<?
use leuchte\Number26\Number26;
require __DIR__ . '/vendor/autoload.php';
$n26 = new Number26('XXX', 'XXX');
$transactions = $n26->getTransactions(['sort' => 'visibleTS', 'dir' => 'ASC', 'offset' => 0, 'limit' => 20]);
echo '<pre>';
print_r($transactions);
echo '</pre>';
?>
This show me my transactions after I confirm the login with my n26 app on my smartphone.
Is there a way to login without the 2FA each time?
And how can I handle errors?
For example:
if login == OK > next
else > Show Error Message
if query transactions == OK > next
else > Show Error Message
Thank you very much !!
Hi.
I tried out the code and I was able to login and get all transactions or the latest one via: $n26->getTransactions(['sort' => 'visibleTS', 'dir' => 'ASC', 'offset' => 0, 'limit' => 1]);
Now, I can't initiate a transfer. If I try to send a euro with $n26->makeTransfer, it just simply does nothing.
I have tried echoing the result like this below:
echo $n26->makeTransfer('1.00', '1234', 'BSABESBBXXX', 'ES**00810309730001******', 'Alexa', 'blablabla');
And the result from the N26 API endpoint was the following:
<!doctype html><html lang="en"><head><title>HTTP Status 415 โ Unsupported Media Type</title><style type="text/css">h1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} h2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} h3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} body {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} b {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} p {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;} a {color:black;} a.name {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 415 โ Unsupported Media Type</h1></body></html>
I'm not sure why I'm getting 415 errors.
$spaces = $n26->getSpaces();
does not work but returns
{
+"status": 404,
+"userMessage": {#4630
+"title": "Error",
+"detail": "Not found",
},
+"title": "Error",
+"message": "Not found",
}
This is probably related to a change in the API. See the news stating:
"May 17, 2022: New Spaces endpoint /api/v3/spaces is live in the AIS Fallback Interface; old Spaces endpoint /api/spaces will be disabled from Aug 17th, 2022.":
Simply changing the url in the getSpaces function to '/api/v3/spaces/' does not work either. It responds with
{
+"title": "Error",
+"message": "Error",
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.