Jump to content

Users, Clients, Contacts, Accounts?


pepijn

Recommended Posts

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

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

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...