youngguns-nl / moneybird_php_api

A PHP Library for the MoneyBird API
http://www.moneybird.nl
MIT License
37 stars 14 forks source link

Continuous error Authorization required #66

Closed joshuadegier closed 9 years ago

joshuadegier commented 9 years ago

Since I've changed my MB password I receive the error 'Authorization required' on every request. Can't seem to find out what the issue is or how to get this fixed. Any ideas?

Code I use is:

    $config = array(
            'clientname' => 'my-subdomain',
            'emailaddress' => 'my-email',
            'password' => 'my-password'
        );

        // Create a Transport
        $transport = new Moneybird\HttpClient();
        $transport->setAuth(
            $config['emailaddress'],
            $config['password']
        );

        $connector = new Moneybird\ApiConnector(
            $config['clientname'],
            $transport, 
            new Moneybird\XmlMapper() // create a mapper
        );

        // Invoice Service
        $invoiceDetails = array();
        $invoiceDetails['invoice_id'] = '2015-0001';

        $invoiceService = $connector->getService('Invoice');
        $invoice = $invoiceService->getByInvoiceId($invoiceDetails['invoice_id']);

The error occures when the 2nd line (getByInvoiceId) is called.

pluijm commented 9 years ago

Well, are you sure you've got the right password?

joshuadegier commented 9 years ago

Positive. Changed it a few times to test.

pluijm commented 9 years ago

Could you contact MB to verify they are seeing this auth errors too?

joshuadegier commented 9 years ago

Strange enough, the script seems to be working right now without any changes. I'm pretty sure it wasn't a caching issue, maybe a temporary error on the MB API's end? Anyway, thanks for the help I guess :-)