Draft API

1 view
Skip to first unread message

James Burke

unread,
Aug 11, 2010, 8:27:49 PM8/11/10
to raindr...@googlegroups.com
Here is a first pass at a draft API (IOW, an API for dealing with
message drafts):

1) drafts/index

Request args:
id= for a specific draft
ids=for a list of drafts
exclude=body

Can pass no ids, to get a full listing.

Response:
An object whose properties are draftIds with property names being the
draft objects:

{
"draftId1": {},
"draftId2": {}
}

The "exclude" arg is optional, and if exclude=body is passed (the only
supported value at first?) the result should be the result up above
but without the body property on the draft objects. This kind of call
is used to list outstanding drafts.

2) drafts/save/[draftId]

Request args:
JSON formatted request body that is the draft object.

Response:
Standard response object.

3) drafts/delete/[draftId]

Response:
Returns standard response object.

How does that sound? It means the client is responsible for generating
draft IDs which I think is OK, but holler if you do not like that.
What is not clear to me is how this works with the outgoing messages
and the deletion of drafts: does the setting of a message to be
outgoing (whatever that API is) automatically remove it from the
drafts? I'm fine saying the client has to manually delete the drafts
after setting the message to outgoing for now if that helps.

James

David Ascher

unread,
Aug 11, 2010, 8:32:40 PM8/11/10
to raindr...@googlegroups.com, James Burke
On 8/11/10 5:27 PM, James Burke wrote:
> Here is a first pass at a draft API (IOW, an API for dealing with
> message drafts):

it's a meta-draft api.

Reply all
Reply to author
Forward
0 new messages