[#397] Add client with password with API

Migrated from Redmine #397 | Author: Arthur Lima
Status: New | Priority: Immediate, there is BUG! | Created: 2019-07-02


There’s a way to create a new client using the API (method addClient) and create a password for the client?
I’m using the extra feature to clients have password, but I’m not finding a way to create a client with their password at the same time.

Redmine Admin wrote:

please call signUpClient($clientData)
where clientData should be

{
    name: "Frances T. Perez",
    phone: "+1502-810-4521",
    email: "FrancesTPerez@teleworm.us",
    address1: "3872 Earnhardt Drive",
    address2: "Louisville, KY 40219",
    city: Louisville,
    zip: 3872,
    password : 123456
 }

It will send email to client with his password

Arthur Lima wrote:

Do I use in url https://user-api.simplybook.me/admin? There’s nothing about it in API docs :frowning:

Redmine Admin wrote:

yes, this method is not in docs yet :slight_smile:

Arthur Lima wrote:

Okay! Thank you!!! \o \o

Arthur Lima wrote:

Now I’m having a method not found error :C

method: signUpClient
code: -32601
message: “Method not found”

Redmine Admin wrote:

Forgot to tell, it is in public API not admin

Arthur Lima wrote:

Yay! Now it’s working! Thank you very much.
There’s a date to update the docs?

Guillaume Cambon wrote:

Redmine Admin wrote:

please call signUpClient($clientData)
It will send email to client with his password

I got it working, thanks.

Is there a way to use this method without having an email sent to the newly created user?

Redmine Admin wrote:

the only way to do this is to alter your email settings in Email and SMS settings. But this will affect all bookings

Guillaume Cambon wrote:

Where do I find such settings? At path @/settings/templates@ I find options relatives to service subscriptions, comments, cancelling and so on… but nothing about actual registration.

Redmine Admin wrote:

Go to Settings → Email and SMS settings in admin interface of your company

Guillaume Cambon wrote:

Sorry, but this is already the screen I was looking at, and I can’t find such setting. Could you be more explicit?

Redmine Admin wrote:

oh.. sorry for misunderstanding. Yes, you are in the right place. It is impossible to turn off such emails unfortunately.

Guillaume Cambon wrote:

Thanks for clarifying :slight_smile:

How about proceeding in two steps:

  1. registering the user with a fake email address
  2. updating the user’s email address with the correct one?

That way, this email would still be sent, but the user would not receive it, right?

Redmine Admin wrote:

Well, you can try this workaround of course. But it is something which is NOT recommended by our dev team.

Guillaume Cambon wrote:

I will try thanks.

Another question - can I edit the body of that email?

Redmine Admin wrote:

Yes, it is last template on Email and SMS settings page called " New user login notification"