pepijn Posted September 16, 2013 Report Posted September 16, 2013 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 Quote
pepijn Posted September 16, 2013 Author Report Posted September 16, 2013 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. Quote
Cody Posted September 19, 2013 Report Posted September 19, 2013 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. Michael 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.