~robin-jeffries/mailman/dlist-robin

« back to all changes in this revision

Viewing changes to src/mailman/rest/docs/addresses.rst

  • Committer: Barry Warsaw
  • Date: 2012-09-22 21:13:13 UTC
  • Revision ID: barry@list.org-20120922211313-pzaahwq3glfalj6p
 * You can now verify and unverify an email address through the REST API.
   POST to .../addresses/<email>/verify and .../addresses/<email>/unverify
   respectively.  The POST data is ignored.  It is not an error to verify or
   unverify an address more than once, but verifying an already verified
   address does not change its `.verified_on` date.  (LP: #1054730)

Show diffs side-by-side

added added

removed removed

Lines of Context:
90
90
 
91
91
When the address gets verified, this attribute is available in the REST
92
92
representation.
93
 
::
94
93
 
95
94
    >>> from mailman.utilities.datetime import now
96
95
    >>> anne.verified_on = now()
103
102
    self_link: http://localhost:9001/3.0/addresses/anne@example.com
104
103
    verified_on: 2005-08-01T07:49:23
105
104
 
 
105
Addresses can also be verified through the REST API, by POSTing to the
 
106
'verify' sub-resource.  The POST data is ignored.
 
107
 
 
108
    >>> dump_json('http://localhost:9001/3.0/addresses/'
 
109
    ...           'cris@example.com/verify', {})
 
110
    content-length: 0
 
111
    date: ...
 
112
    server: ...
 
113
    status: 204
 
114
 
 
115
Now Cris's address is verified.
 
116
 
 
117
    >>> dump_json('http://localhost:9001/3.0/addresses/cris@example.com')
 
118
    display_name: Cris Person
 
119
    email: cris@example.com
 
120
    http_etag: "..."
 
121
    original_email: cris@example.com
 
122
    registered_on: 2005-08-01T07:49:23
 
123
    self_link: http://localhost:9001/3.0/addresses/cris@example.com
 
124
    verified_on: 2005-08-01T07:49:23
 
125
 
 
126
If you should ever need to 'unverify' an address, POST to the 'unverify'
 
127
sub-resource.  Again, the POST data is ignored.
 
128
 
 
129
    >>> dump_json('http://localhost:9001/3.0/addresses/'
 
130
    ...           'cris@example.com/unverify', {})
 
131
    content-length: 0
 
132
    date: ...
 
133
    server: ...
 
134
    status: 204
 
135
 
 
136
Now Cris's address is unverified.
 
137
 
 
138
    >>> dump_json('http://localhost:9001/3.0/addresses/cris@example.com')
 
139
    display_name: Cris Person
 
140
    email: cris@example.com
 
141
    http_etag: "..."
 
142
    original_email: cris@example.com
 
143
    registered_on: 2005-08-01T07:49:23
 
144
    self_link: http://localhost:9001/3.0/addresses/cris@example.com
 
145
 
106
146
 
107
147
User addresses
108
148
==============