Skip to content

Commit

Permalink
Add unsubscribe channel
Browse files Browse the repository at this point in the history
  • Loading branch information
kariudo committed Feb 6, 2015
1 parent 8428734 commit 150f141
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions gopushbullet.go
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,16 @@ func (c *Client) ListSubscriptions() (subscriptions SubscriptionList, err error)
return
}

//UnsubscribeChannel unsubscibes from the specified channel
func (c *Client) UnsubscribeChannel(channelID string) error {
_, apiError, err := c.makeCall("DELETE", "subscriptions/"+channelID, nil)
if err != nil {
log.Println("Failed to unsubscribe channel: ", err, apiError.String())
return err
}
return nil
}

func (c *Client) makeCall(method string, call string, data interface{}) (responseBody []byte, apiError *Error, err error) {
// make sure API key seems ok
if len(c.APIKey) == 0 {
Expand Down

0 comments on commit 150f141

Please sign in to comment.