Skip to content

Commit 4159a1e

Browse files
author
Rich Leland
committed
Add sphinx doc for metrics
- Added document for existing methods - Updated links to remove references to richleland repo - Updated links to proper API docs locations
1 parent 56fbe5f commit 4159a1e

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
@@ -19,7 +19,7 @@ Here at SparkPost, our messages are known as transmissions. Let's use the underl
1919
print response
2020
# outputs {u'total_accepted_recipients': 1, u'id': u'47960765679942446', u'total_rejected_recipients': 0}
2121
22-
.. _transmissions API: http://www.sparkpost.com/docs/transmissions-api
22+
.. _transmissions API: https://www.sparkpost.com/api#/reference/transmissions
2323

2424

2525
Send a transmission
@@ -115,13 +115,13 @@ Further examples
115115

116116
See the `python-sparkpost transmissions examples`_.
117117

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

120120

121121
Additional documentation
122122
------------------------
123123

124124
See the `SparkPost Transmissions API Reference`_.
125125

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

0 commit comments

Comments
 (0)