Skip to content

Commit

Permalink
Opt outs http api is done
Browse files Browse the repository at this point in the history
  • Loading branch information
Trevor committed Jun 1, 2015
1 parent bfbb9ff commit 3a4eefb
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = []
extensions = ['sphinxcontrib.httpdomain']

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
Expand Down
78 changes: 78 additions & 0 deletions docs/http_api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
Opt outs http api
=================

.. http:get:: /optouts/(str:address_type)/(str:address)
**Request**

.. sourcecode:: http

GET /optouts/msisdn/"+273121100"
Host: example.com
Accept: application/json

**Response**

.. sourcecode:: http

HTTP/1.1 200 OK
Vary: accept
Content-type: application/json

[
{
"id": 2468,
"address-type": "msisdn",
"address": "+273121100"
},
{
"id": 8642,
"address-type": "twitter",
"address": "@vumi-app"
}
]

:statuscode 200: no error
:statuscode 404: there's no opt out for this contact

.. http:put:: /optouts/(str:address_type)/(str:address)
**Request**

.. sourcecode:: http

PUT /optouts/facebook/"@fb-app"
Host: example.com
Accept: application/json

{"address-type": "facebook", "address": "@fb-app"}

**Response**

.. sourcecode:: http

HTTP/1.1 200 OK
Vary: accept
Content-type: application/json

{..., "address": "@fb-app", ""address-type": "facebook", ...}

.. http:delete:: /optouts/(str:address_type)/01dfae6e5d4d90d9892622325959afbe
**Request**

.. sourcecode:: http

DELETE /optouts/twitter/01dfae6e5d4d90d9892622325959afbe
Host: axample.com
Accept: application/json

**Response**

.. sourcecode:: http

HTTP/1.1 200 OK
Vary: accept
Content-type: application/json

{..., "id": "68e456a0c8da43bea162839a9a1669c0", ...}
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Contents:
.. toctree::
:maxdepth: 2

http_api


Indices and tables
Expand Down

1 comment on commit 3a4eefb

@g1039
Copy link

@g1039 g1039 commented on 3a4eefb Jun 1, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hodgestar ready for review

Please sign in to comment.