aboutsummaryrefslogtreecommitdiff
path: root/api.go
diff options
context:
space:
mode:
authorAlexander Kiryukhin <alexander@kiryukhin.su>2019-03-29 18:05:58 +0300
committerAlexander Kiryukhin <alexander@kiryukhin.su>2019-03-29 18:05:58 +0300
commit2182e3069d6bef955a0edd1876d41ba822e5a366 (patch)
tree703ce42c85b4bbafe00dbb1328eeadefbe245e9f /api.go
parent4f343e00669f96451bb5a11b7e83c7ecd8503e5a (diff)
Version on webhooks
Diffstat (limited to 'api.go')
-rw-r--r--api.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/api.go b/api.go
index 1ad4611..f3bc90e 100644
--- a/api.go
+++ b/api.go
@@ -308,7 +308,12 @@ func (a *Api) GetSubscriptions() (*GetSubscriptionsResult, error) {
return result, json.NewDecoder(body).Decode(result)
}
-func (a *Api) Subscribe(subscription *SubscriptionRequestBody) (*SimpleQueryResult, error) {
+func (a *Api) Subscribe(subscribeURL string, updateTypes []string) (*SimpleQueryResult, error) {
+ subscription := &SubscriptionRequestBody{
+ Url: subscribeURL,
+ UpdateTypes: updateTypes,
+ Version: a.version,
+ }
result := new(SimpleQueryResult)
values := url.Values{}
body, err := a.request(http.MethodPost, "subscriptions", values, subscription)