invoiceninja / sdk-php

PHP wrapper for Invoice Ninja's REST API
https://www.invoiceninja.com
83 stars 42 forks source link

Create user via API #106

Closed danielspeicher closed 3 weeks ago

danielspeicher commented 3 weeks ago

Hello,

we are using this SDK and we need help:

We want to synchronize users from another backend system and we want to use the API via this SDK. How can we create a user?

We get an error message: Invalid password. We are using a valid API token, because to get a list of users works.

Thanks for your help.

turbo124 commented 3 weeks ago

Some routes are protected by password. To access that particular route you will need to add a header into the request as follows.

->addHeader(['X-API-PASSWORD' => 'your_password])

or

->addHeader(['X-API-PASSWORD-BASE64' => 'your base 64 encoded password']);
danielspeicher commented 3 weeks ago

Thank you. It works fine now!

hillelcoren commented 3 weeks ago

In the past we've found people who automate user management may be reselling the app, I suggest reviewing the license to ensure your use case is ok.

https://invoiceninja.github.io/en/legal/license/