File: base_resource.py

package info (click to toggle)
python-sparkpost 1.3.10-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 516 kB
  • sloc: python: 2,528; makefile: 31; sh: 10
file content (18 lines) | stat: -rw-r--r-- 397 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import os

from sparkpost.base import Resource


class Webhooks(Resource):
    key = "webhooks"

    def list(self, **kwargs):
        results = self.request('GET', self.uri, **kwargs)
        return results


api_key = os.environ.get('SPARKPOST_API_KEY', None)
webhooks = Webhooks('https://api.sparkpost.com/api/v1', api_key)

# returns a list of webhooks for your account
print(webhooks.list())