func (api *API) GetWebhook(addrHash hash.Hash, ID string) (*webhook.Type, error) {
	url := fmt.Sprintf("/account/%s/webhook/%s", addrHash.String(), ID)
	body, statusCode, err := api.Get(url)
	if err != nil {
		return nil, err
	}

	if statusCode < 200 || statusCode > 299 {
		return nil, errNoSuccess
	}

	if isErrorResponse(body) {
		return nil, GetErrorFromResponse(body)
	}

	// Parse body for webhook
	wh := &webhook.Type{}
	err = json.Unmarshal(body, &wh)
	if err != nil {
		return nil, err
	}

	return wh, nil
}
// GetWebhook gets a single webhook
GetWebhook gets a single webhook
// GetWebhook gets a single webhook
func (api *API) GetWebhook(addrHash hash.Hash, ID string) (*webhook.Type, error) {
	url := fmt.Sprintf("/account/%s/webhook/%s", addrHash.String(), ID)
	body, statusCode, err := api.Get(url)
	if err != nil {
		return nil, err
	}
	if statusCode < 200 || statusCode > 299 {
		return nil, errNoSuccess
	}
	if isErrorResponse(body) {
		return nil, GetErrorFromResponse(body)
	}
	wh := &webhook.Type{}
	err = json.Unmarshal(body, &wh)
	if err != nil {
		return nil, err
	}
	return wh, nil
}
func ( api * API ) GetWebhook ( addrHash hash . Hash , ID string ) ( * webhook . Type , error ) { url := fmt . Sprintf ( " " , addrHash . String ( ) , ID ) body , statusCode , err := api . Get ( url ) if err != nil { return nil , err } if statusCode < 200 || statusCode > 299 { return nil , errNoSuccess } if isErrorResponse ( body ) { return nil , GetErrorFromResponse ( body ) } wh := & webhook . Type { } err = json . Unmarshal ( body , & wh ) if err != nil { return nil , err } return wh , nil }
GetWebhook gets a single webhook
GetWebhook gets a single webhook
// Parse body for webhook