From 4159a1e695fbb161bf2a0ae4527d231c43ac851c Mon Sep 17 00:00:00 2001 From: Rich Leland Date: Sat, 22 Aug 2015 20:51:48 -0400 Subject: [PATCH] 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 --- docs/index.rst | 9 +++++---- docs/resources/metrics.rst | 34 ++++++++++++++++++++++++++++++++ docs/resources/transmissions.rst | 6 +++--- 3 files changed, 42 insertions(+), 7 deletions(-) create mode 100644 docs/resources/metrics.rst diff --git a/docs/index.rst b/docs/index.rst index e95ebc2..e413609 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -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 @@ -44,6 +44,7 @@ The following resources are available in python-sparkpost: .. toctree:: :maxdepth: 1 + resources/metrics resources/transmissions @@ -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 @@ -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 diff --git a/docs/resources/metrics.rst b/docs/resources/metrics.rst new file mode 100644 index 0000000..eaef00c --- /dev/null +++ b/docs/resources/metrics.rst @@ -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 + diff --git a/docs/resources/transmissions.rst b/docs/resources/transmissions.rst index b4e3c4f..e935265 100644 --- a/docs/resources/transmissions.rst +++ b/docs/resources/transmissions.rst @@ -19,7 +19,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 @@ -115,7 +115,7 @@ 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 @@ -123,5 +123,5 @@ 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