Changeset 37564 in project


Ignore:
Timestamp:
04/28/19 11:59:46 (3 months ago)
Author:
evhan
Message:

eggref/topham: Add lists docs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/5/topham

    r37563 r37564  
    4343</enscript>
    4444
     45Subscribe or unsubscribe from a mailing list:
     46
     47<enscript highlight="scheme">
     48(create (subscription list: "~sircmpwn/sr.ht-announce"))
     49; => ((id . 24)
     50;     (created . "2018-07-08T23:46:31+00:00")
     51;     (list (name . "sr.ht-announce")
     52;           (owner (canonical_name . "~sircmpwn") (name . "sircmpwn"))))
     53
     54(retrieve (subscriptions))
     55; => ((#:service "lists" #:path "/api/subscriptions")
     56;     (next . null)
     57;     (results
     58;       .
     59;       #(((id . 24)
     60;          (created . "2018-07-08T23:46:31+00:00")
     61;          (list (name . "sr.ht-announce")
     62;                (owner (canonical_name . "~sircmpwn") (name . "sircmpwn"))))))
     63;     (total . 1)
     64;     (results_per_page . 50))
     65
     66(delete (subscription 24))
     67; => #t
     68</enscript>
     69
    4570
    4671== Usage
     
    104129
    105130<enscript highlight="scheme">
    106 (import (only (topham) retrieve page)
    107         (only (topham paste) pastes))
     131(import (only (topham) retrieve page))
    108132
    109133; retrieve the first page of results
    110 (retrieve (pastes))
     134(retrieve (emails "~user"))
    111135
    112136; retrieve results starting from id 42
    113 (retrieve (page (pastes) 42))
     137(retrieve (page (emails "~user") 42))
    114138</enscript>
    115139
     
    194218[[https://man.sr.ht/lists.sr.ht/api.md|lists.sr.ht]].
    195219
     220<procedure>(user string) => crud</procedure>
     221
     222[[https://man.sr.ht/lists.sr.ht/api.md#get-apiuserusername|Retrieves a user]].
     223
     224{{string}} should be a username or email address.
     225
     226<procedure>(subscriptions) => crud</procedure>
     227
     228[[https://man.sr.ht/lists.sr.ht/api.md#get-apisubscriptions|Retrieves the active user's mailing list subscriptions]].
     229
     230<procedure>(subscription number) => crud</procedure>
     231<procedure>(subscription #!key list) => crud</procedure>
     232
     233In the first form, [[https://man.sr.ht/lists.sr.ht/api.md#get-apisubscriptionssub-id|retrieves a subscription by ID]].
     234
     235In the second form, [[https://man.sr.ht/lists.sr.ht/api.md#post-apisubscriptions|subscribes to a mailing list]].
     236
     237{{number}} should be a subscription resource ID.
     238
     239<procedure>(emails string) => crud</procedure>
     240
     241[[https://man.sr.ht/lists.sr.ht/api.md#get-apiuserusernameemails|Retrieves a user's emails]].
     242
     243{{string}} should be a username or email address.
     244
     245This endpoint is subject to [[#pagination|pagination]].
     246
     247<procedure>(email number) => crud</procedure>
     248
     249[[https://man.sr.ht/lists.sr.ht/api.md#get-apiemailsemail-id|Retrieves an email]].
     250
     251{{number}} should be an email resource ID.
     252
     253<procedure>(thread number) => crud</procedure>
     254
     255[[https://man.sr.ht/lists.sr.ht/api.md#get-apithreademail-id|Retrieves an email thread]].
     256
     257{{number}} should be an email resource ID.
     258
     259<procedure>(mailing-lists string) => crud</procedure>
     260
     261[[https://man.sr.ht/lists.sr.ht/api.md#get-apiuserusernamelists|Retrieves a user's mailing lists]].
     262
     263{{string}} should be a username or email address.
     264
     265<procedure>(mailing-list string string) => crud</procedure>
     266<procedure>(mailing-list string #!key description) => crud</procedure>
     267<procedure>(mailing-list #!key name description) => crud</procedure>
     268
     269In the first form, [[https://man.sr.ht/lists.sr.ht/api.md#get-apiuserusernamelistslist-name|retrieves a subscription by ID]].
     270
     271In the second form, [[https://man.sr.ht/lists.sr.ht/api.md#put-apilistslist-name|updates a mailing list]].
     272
     273In the third form, [[https://man.sr.ht/lists.sr.ht/api.md#post-apilists|creates a mailing list]].
     274
     275The {{string}} arguments should be user and list names.
     276
     277<procedure>(posts string string) => crud</procedure>
     278
     279[[https://man.sr.ht/lists.sr.ht/api.md#get-apiuserusernamelistslist-nameposts|Retrieves posts to a mailing list]].
     280
     281The {{string}} arguments should be user and list names.
     282
     283This endpoint is subject to [[#pagination|pagination]].
     284
    196285
    197286==== meta
Note: See TracChangeset for help on using the changeset viewer.