From c1f3644122c8ef7dbcaa92abd620fc994d1e1c20 Mon Sep 17 00:00:00 2001 From: Dmitry Dmitriev Date: Fri, 30 Oct 2020 17:02:56 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20?= =?UTF-8?q?=D1=84=D0=B0=D0=B9=D0=BB=D1=8B=20=D0=BF=D1=80=D0=BE=D0=B5=D0=BA?= =?UTF-8?q?=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/api.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/api/api.go b/api/api.go index 048caa0..aa08227 100644 --- a/api/api.go +++ b/api/api.go @@ -12,6 +12,8 @@ import ( type ClientOptions struct { Url string + ClientId string + ClientSecret string AccessToken string RefreshToken string } @@ -102,11 +104,11 @@ func (api *Client) doRequest(resourceUrl string, requestParams requestOptions, r func (api *Client) RefreshToken() (*map[string]interface{}, error) { result := new(map[string]interface{}) request := map[string]string{ - "client_id": "7c08f8a9-c49d-4378-890c-a6dba79f88f9", - "client_secret": "SDqfNBxxk98zq6CRjLN7tHeyVHS0EAwlQkirAx0i71s81N9fXGPlTlkoxIOZd6Rg", + "client_id": api.options.ClientId, + "client_secret": api.options.ClientSecret, "grant_type": "refresh_token", "refresh_token": api.options.RefreshToken, - "redirect_uri": "https://ddamosmartheadru.amocrm.ru", + "redirect_uri": api.options.Url, } err := api.doRequest("/oauth2/access_token", requestOptions{