Skip to content

Commit d2af4f9

Browse files
committed
Merge pull request #44 from SparkPost/ISSUE-3
Add sphinx doc for metrics.
2 parents dd392cf + 4159a1e commit d2af4f9

File tree

3 files changed

+42
-7
lines changed

3 files changed

+42
-7
lines changed

docs/index.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Alternatively, you can pass the API key to the SparkPost class:
3333
from sparkpost import SparkPost
3434
sp = SparkPost('YOUR API KEY')
3535
36-
.. _API & SMTP: https://app.sparkpost.com/#/configuration/credentials
36+
.. _API & SMTP: https://app.sparkpost.com/configuration/credentials
3737

3838

3939
Resources
@@ -44,6 +44,7 @@ The following resources are available in python-sparkpost:
4444
.. toctree::
4545
:maxdepth: 1
4646

47+
resources/metrics
4748
resources/transmissions
4849

4950

@@ -63,7 +64,7 @@ Additional documentation
6364

6465
The underlying SparkPost API is documented at the official `SparkPost API Reference`_.
6566

66-
.. _SparkPost API Reference: https://www.sparkpost.com/docs/introduction
67+
.. _SparkPost API Reference: https://www.sparkpost.com/api
6768

6869

6970
Contribute
@@ -74,6 +75,6 @@ Contribute
7475
#. Write a test which shows that the bug was fixed or that the feature works as expected.
7576
#. Send a pull request. Make sure to add yourself to AUTHORS_.
7677

77-
.. _`the repository`: http://github.com/richleland/python-sparkpost
78-
.. _AUTHORS: https://github.com/richleland/python-sparkpost/blob/master/AUTHORS.rst
78+
.. _`the repository`: http://github.com/SparkPost/python-sparkpost
79+
.. _AUTHORS: https://github.com/SparkPost/python-sparkpost/blob/master/AUTHORS.rst
7980

docs/resources/metrics.rst

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
Metrics
2+
=======
3+
4+
Retrieve a list of campaigns
5+
----------------------------
6+
7+
.. code-block:: python
8+
9+
from sparkpost import SparkPost
10+
11+
sp = SparkPost()
12+
13+
sp.metrics.campaigns.list()
14+
15+
16+
Retrieve a list of domains
17+
--------------------------
18+
19+
.. code-block:: python
20+
21+
from sparkpost import SparkPost
22+
23+
sp = SparkPost()
24+
25+
sp.metrics.domains.list()
26+
27+
28+
Additional documentation
29+
------------------------
30+
31+
See the `SparkPost Metrics API Reference`_.
32+
33+
.. _SparkPost Metrics API Reference: https://www.sparkpost.com/api#/reference/metrics
34+

docs/resources/transmissions.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Here at SparkPost, our messages are known as transmissions. Let's use the underl
2121
print response
2222
# outputs {u'total_accepted_recipients': 1, u'id': u'47960765679942446', u'total_rejected_recipients': 0}
2323
24-
.. _transmissions API: http://www.sparkpost.com/docs/transmissions-api
24+
.. _transmissions API: https://www.sparkpost.com/api#/reference/transmissions
2525

2626

2727
Send a transmission
@@ -119,13 +119,13 @@ Further examples
119119

120120
See the `python-sparkpost transmissions examples`_.
121121

122-
.. _python-sparkpost transmissions examples: https://github.com/richleland/python-sparkpost/tree/master/examples/transmissions
122+
.. _python-sparkpost transmissions examples: https://github.com/SparkPost/python-sparkpost/tree/master/examples/transmissions
123123

124124

125125
Additional documentation
126126
------------------------
127127

128128
See the `SparkPost Transmissions API Reference`_.
129129

130-
.. _SparkPost Transmissions API Reference: https://www.sparkpost.com/docs/transmissions-api
130+
.. _SparkPost Transmissions API Reference: https://www.sparkpost.com/api#/reference/transmissions
131131

0 commit comments

Comments
 (0)