Добавил обновление компаний и контактов

This commit is contained in:
Dmitry Dmitriev 2021-01-15 11:56:14 +03:00
parent df22cfb593
commit 2abc4d0947
2 changed files with 13 additions and 13 deletions

View file

@ -62,7 +62,7 @@ func (client *AmoClient) GetCompany(companyId string, query string) (*companies.
}
func (client *AmoClient) UpdateCompany(company *companies.Company) error {
return client.updateEntity("/api/v4/contacts", company.ID, company)
return client.updateEntity("/api/v4/companies", company.ID, company)
}
func (client *AmoClient) GetContact(contactId string, query string) (*contacts.Contact, error) {

View file

@ -4,18 +4,18 @@ import "github.com/qdimka/go-amo/models/common"
type Company struct {
ID int `json:"id"`
Name string `json:"name"`
ResponsibleUserID int `json:"responsible_user_id"`
GroupID int `json:"group_id"`
CreatedBy int `json:"created_by"`
UpdatedBy int `json:"updated_by"`
CreatedAt int `json:"created_at"`
UpdatedAt int `json:"updated_at"`
ClosestTaskAt interface{} `json:"closest_task_at"`
CustomFieldsValues []common.CustomFieldsValue `json:"custom_fields_values"`
AccountID int `json:"account_id"`
Links Links `json:"_links"`
Embedded Embedded `json:"_embedded"`
Name string `json:"name,omitempty"`
ResponsibleUserID int `json:"responsible_user_id,omitempty"`
GroupID int `json:"group_id,omitempty"`
CreatedBy int `json:"created_by,omitempty"`
UpdatedBy int `json:"updated_by,omitempty"`
CreatedAt int `json:"created_at,omitempty"`
UpdatedAt int `json:"updated_at,omitempty"`
ClosestTaskAt interface{} `json:"closest_task_at,omitempty"`
CustomFieldsValues []common.CustomFieldsValue `json:"custom_fields_values,omitempty"`
AccountID int `json:"account_id,omitempty"`
Links Links `json:"_links,omitempty"`
Embedded Embedded `json:"_embedded,omitempty"`
}
type Self struct {