Skip to content

Commit

Permalink
Merge pull request #44 from SparkPost/ISSUE-3
Browse files Browse the repository at this point in the history
Add sphinx doc for metrics.
  • Loading branch information
richleland committed Aug 23, 2015
2 parents dd392cf + 4159a1e commit d2af4f9
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 7 deletions.
9 changes: 5 additions & 4 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Alternatively, you can pass the API key to the SparkPost class:
from sparkpost import SparkPost
sp = SparkPost('YOUR API KEY')
.. _API & SMTP: https://app.sparkpost.com/#/configuration/credentials
.. _API & SMTP: https://app.sparkpost.com/configuration/credentials


Resources
Expand All @@ -44,6 +44,7 @@ The following resources are available in python-sparkpost:
.. toctree::
:maxdepth: 1

resources/metrics
resources/transmissions


Expand All @@ -63,7 +64,7 @@ Additional documentation

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

.. _SparkPost API Reference: https://www.sparkpost.com/docs/introduction
.. _SparkPost API Reference: https://www.sparkpost.com/api


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

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

34 changes: 34 additions & 0 deletions docs/resources/metrics.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
Metrics
=======

Retrieve a list of campaigns
----------------------------

.. code-block:: python
from sparkpost import SparkPost
sp = SparkPost()
sp.metrics.campaigns.list()
Retrieve a list of domains
--------------------------

.. code-block:: python
from sparkpost import SparkPost
sp = SparkPost()
sp.metrics.domains.list()
Additional documentation
------------------------

See the `SparkPost Metrics API Reference`_.

.. _SparkPost Metrics API Reference: https://www.sparkpost.com/api#/reference/metrics

6 changes: 3 additions & 3 deletions docs/resources/transmissions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Here at SparkPost, our messages are known as transmissions. Let's use the underl
print response
# outputs {u'total_accepted_recipients': 1, u'id': u'47960765679942446', u'total_rejected_recipients': 0}
.. _transmissions API: http://www.sparkpost.com/docs/transmissions-api
.. _transmissions API: https://www.sparkpost.com/api#/reference/transmissions


Send a transmission
Expand Down Expand Up @@ -119,13 +119,13 @@ Further examples

See the `python-sparkpost transmissions examples`_.

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


Additional documentation
------------------------

See the `SparkPost Transmissions API Reference`_.

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

0 comments on commit d2af4f9

Please sign in to comment.