Jump to content

Making The Created Client Via Api Use Username As Login?


gutterboy

Recommended Posts

When I create clients via the API via the clients::create method and then go to edit them via the admin panel by default it seems they have "Use email as username" selected under the "Authentication" section even though I passed in a username and password - and if I check the users table in the database it shows the username I passed in the username field.

 

How can I get it to use the "specify a username" by default?

 

Thanks!

Link to comment
Share on other sites

have you passed the settiings with username_type ?

*  - settings An array of client settings including:
  *   - default_currency
  *   - language
  *   - username_type
  *   - tax_id
  *   - tax_exempt

the username_type accept (email/username) as value

 

Where do you see that? This is the docs I see for that method:

 

An array of client info including: - username The username for this user. Must be unique across all companies for this installation. - new_password The password for this user - confirm_password The password for this user - client_group_id The client group this user belongs to - status The status of this client ('active', 'inactive',' 'fraud') (optional, default active) - first_name The first name of this contact - last_name The last name of this contact - title The business title for this contact (optional) - company The company/organization this contact belongs to (optional) - email This contact's email address - address1 This contact's address (optional) - address2 This contact's address line two (optional) - city This contact's city (optional) - state The 3-character ISO 3166-2 subdivision code, requires country (optional) - zip The zip/postal code for this contact (optional) - country The 3-character ISO 3166-1 country code, required if state is given (optional) - numbers An array of number data including (optional): - number The phone number to add - type The type of phone number 'phone', 'fax' (optional, default 'phone') - location The location of this phone line 'home', 'work', 'mobile' (optional, default 'home') - custom An array of custom fields in key/value format where each key is the custom field ID and each value is the value - settings An array of client settings including: - default_currency - language - username_type - tax_id - tax_exempt - send_registration_email 'true' to send client welcome email (default), 'false' otherwise

 

 

http://source-docs.blesta.com/class-Clients.html

Link to comment
Share on other sites

in

 

 

An array of client info including: - username The username for this user. Must be unique across all companies for this installation. - new_password The password for this user - confirm_password The password for this user - client_group_id The client group this user belongs to - status The status of this client ('active', 'inactive',' 'fraud') (optional, default active) - first_name The first name of this contact - last_name The last name of this contact - title The business title for this contact (optional) - company The company/organization this contact belongs to (optional) - email This contact's email address - address1 This contact's address (optional) - address2 This contact's address line two (optional) - city This contact's city (optional) - state The 3-character ISO 3166-2 subdivision code, requires country (optional) - zip The zip/postal code for this contact (optional) - country The 3-character ISO 3166-1 country code, required if state is given (optional) - numbers An array of number data including (optional): - number The phone number to add - type The type of phone number 'phone', 'fax' (optional, default 'phone') - location The location of this phone line 'home', 'work', 'mobile' (optional, default 'home') - custom An array of custom fields in key/value format where each key is the custom field ID and each value is the value - settings An array of client settings including: - default_currency - language - username_type - tax_id - tax_exempt - send_registration_email 'true' to send client welcome email (default), 'false' otherwise

 

the default value for username_type is email .

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...