Jump to content

Users, Clients, Contacts, Accounts?


Recommended Posts

Posted

So I'm looking at the API to create and verify users/clients/contacts/accounts, and I'm at a loss which model/endpoint to use.

 

There are a few things I need to do.
For the purpose of this list, a client is someone who can log in and buy stuff, a contact is just a name and address attached to this client.

I'm not sure how this maps to the 4 concepts found in hte API.

  • Given a username and password, verify it is an existing client
  • Add contacts to a client
  • Add custom fields to this contact

 

Posted

So I figured Accounts are for credit card info, Users has an auth method for verification and I can add Contacts to Clients. So I'm getting there.

 

Now I tried to auth a user, but it's not working

 

$ php index.php api/users/auth.json -u apiuser -k key -m GET -p "username=user&password=password&type=any"
{"message":"An unexpected error occured.","response":"Internal error: Failed to retrieve the default value"}

[edit] ok, I had to use a nested array like vars[password].

 

Contacts also don't seem to support custom fields and I still don't get the relation between clients and users.

Posted

A user is a essentially a log in account. Any user type that can log into Blesta is a user (Staff, Clients, etc.).

 

A client is essentially two parts: A user and a contact. The client record simply associates the user and the contact together to produce the client. This type of contact is known as the primary contact. Clients can have any number of non-primary contacts, but only one primary contact.

 

Hopefully that sheds some light on the design.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...