# Unsubscribing from a Streaming API Event

This code example shows how to call the `unsubscribe` method so that a canvas app can unsubscribe from a Streaming API event.

```java
//Unsubscribe from Streaming API events.
//The PushTopic to unsubscribe from must be passed in.
Sfdc.canvas(function() {
    sr = JSON.parse('<%=signedRequestJson%>');
    Sfdc.canvas.client.unsubscribe(sr.client, {name : 'sfdc.streamingapi',
        params:{topic:"/topic/InvoiceStatements"}});
});
```

**See Also**

- [Using the Streaming API Event](/docs/platform/canvas-framework/guide/canvas-app-streaming-event-code-example.md)
- [Subscribing to a Streaming API Event](/docs/platform/canvas-framework/guide/canvas-app-streaming-subscribe-code-example.md)
