Documentation
¶
Index ¶
- func MultiValuesString(s ...string) string
- type Account
- type AccountCustomField
- type AuthResponse
- type CSValue
- type Client
- func (c *Client) AddCompany(comp Company) (int, error)
- func (c *Client) AddContact(contact Contact) (int, error)
- func (c *Client) AddNote(note Note) (int, error)
- func (c *Client) AddTask(task Task) (int, error)
- func (c *Client) Authorize(userLogin, userHash string) (*AuthResponse, error)
- func (c *Client) DoGet(url string, result interface{}) error
- func (c *Client) DoPost(url string, data interface{}) (*http.Response, error)
- func (c *Client) DoPostWithReturnID(url string, data interface{}) (int, error)
- func (c *Client) GetAccount(freeUsers bool, with []string) (Account, error)
- func (c *Client) SetURL(url string, addValues map[string]string) string
- type Company
- type CompanyAction
- type Contact
- type ContactAction
- type CustomField
- type Note
- type NoteAction
- type RateLimiter
- type Task
- type TaskAction
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MultiValuesString ¶
Separates strings values with comma
Types ¶
type Account ¶
type Account struct {
ID int `json:"id"`
Name string `json:"name"`
Subdomain string `json:"subdomain"`
Currency string `json:"currency"`
Timezone string `json:"timezone"`
TimezoneOffset string `json:"timezoneoffset"`
Language string `json:"language"`
CurrentUser int `json:"current_user"`
Embedded struct {
Users map[string]User
CustomFields struct {
Contacts map[string]AccountCustomField `json:"contacts"`
Leads map[string]AccountCustomField `json:"leads"`
Companies map[string]AccountCustomField `json:"companies"`
} `json:"custom_fields"`
} `json:"_embedded"`
}
Account an information on the authorized account.
type AccountCustomField ¶
type AccountCustomField struct {
ID int `json:"id"`
Name string `json:"name"`
FieldType int `json:"field_type"`
Sort int `json:"sort"`
IsMultiple bool `json:"is_multiple"`
IsSystem bool `json:"is_system"`
IsEditable bool `json:"is_editable"`
IsRequired bool `json:"is_required"`
IsDeletable bool `json:"is_deletable"`
IsVisible bool `json:"is_visible"`
Enums map[string]string `json:"enums"`
}
type AuthResponse ¶
type AuthResponse struct {
Response struct {
Auth bool `json:"auth"`
Accounts []struct {
ID string `json:"id"`
Name string `json:"name"`
Subdomain string `json:"subdomain"`
Language string `json:"language"`
Timezone string `json:"timezone"`
} `json:"accounts"`
ServerTime int `json:"server_time"`
} `json:"response"`
}
AuthResponse information about Amo' user and account.
type Client ¶
type Client struct {
Timezone string
// contains filtered or unexported fields
}
Client AmoCRM API Client
func NewClient ¶
func NewClient(accountWebAddress string, rateLimiter RateLimiter) (*Client, error)
NewClient creates and initializes AmoCRM API. accountWebAddress is your AmoCRM account address like https://your-account.amocrm.com
func (*Client) Authorize ¶
func (c *Client) Authorize(userLogin, userHash string) (*AuthResponse, error)
Authorize In case of successful authorization, this method returns the user’s session ID, which must be used while accessing to other API methods. Saves user's login and hash into the client for next usage.
func (*Client) DoPostWithReturnID ¶
Post with return ID on new entity
func (*Client) GetAccount ¶
type Company ¶
type Company struct {
Name string `json:"name,omitempty"`
CreatedAt int `json:"created_at,omitempty"`
UpdatedAt int `json:"updated_at,omitempty"`
ResponsibleUserID int `json:"responsible_user_id,omitempty"`
CreatedBy int `json:"created_by,omitempty"`
Tags string `json:"tags,omitempty"`
LeadsID string `json:"leads_id,omitempty"`
CustomersID string `json:"customers_id,omitempty"`
ContactsID string `json:"contacts_id,omitempty"`
CustomFields []CustomField `json:"custom_fields,omitempty"`
}
type CompanyAction ¶
type CompanyAction struct {
Add []Company `json:"add,omitempty"`
}
type Contact ¶
type Contact struct {
Name string `json:"name,omitempty"`
CreatedAt int `json:"created_at,omitempty"`
UpdatedAt int `json:"updated_at,omitempty"`
ResponsibleUserID int `json:"responsible_user_id,omitempty"`
CreatedBy int `json:"created_by,omitempty"`
CompanyName string `json:"company_name,omitempty"`
Tags string `json:"tags,omitempty"`
LeadsID string `json:"leads_id,omitempty"`
CustomersID string `json:"customers_id,omitempty"`
CompanyID string `json:"company_id,omitempty"`
CustomFields []CustomField `json:"custom_fields,omitempty"`
}
type ContactAction ¶
type ContactAction struct {
Add []Contact `json:"add,omitempty"`
}
type CustomField ¶
type Note ¶
type Note struct {
ElementID int `json:"element_id,omitempty"`
ElementType int `json:"element_type,omitempty"`
Text string `json:"text,omitempty"`
NoteType int `json:"note_type,omitempty"`
CreatedAt int `json:"created_at,omitempty"`
UpdatedAt int `json:"updated_at,omitempty"`
ResponsibleUserID int `json:"responsible_user_id,omitempty"`
}
type NoteAction ¶
type NoteAction struct {
Add []Note `json:"add,omitempty"`
}
type RateLimiter ¶
type RateLimiter interface {
WaitForRequest()
}
type Task ¶
type Task struct {
ElementID int `json:"element_id,omitempty"`
ElementType int `json:"element_type,omitempty"`
CompleteTillAt int `json:"complete_till_at,omitempty"`
TaskType int `json:"task_type,omitempty"`
Text string `json:"text,omitempty"`
CreatedAt int `json:"created_at,omitempty"`
UpdatedAt int `json:"updated_at,omitempty"`
ResponsibleUserID int `json:"responsible_user_id,omitempty"`
IsCompleted bool `json:"is_completed,omitempty"`
CreatedBy int `json:"created_by,omitempty"`
}
type TaskAction ¶
type TaskAction struct {
Add []Task `json:"add,omitempty"`
}
type User ¶
type User struct {
ID int `json:"id"`
Name string `json:"name"`
LastName string `json:"last_name"`
Login string `json:"login"`
Language string `json:"language"`
GroupID int `json:"group_id"`
IsActive bool `json:"is_active"`
IsFree bool `json:"is_free"`
IsAdmin bool `json:"is_admin"`
Rights map[string]string `json:"rights,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.