On 9/16/06, Vincent <[EMAIL PROTECTED]> wrote:
[...]
> On the source account, you'd initiate a transfer with the
> arguments being the target account and the amount.  The
> result on success would be that specific transfer's ID.

Ah, but you're not saying how you 'initiate a transfer'. It's one of the
questions I'm struggling with. It  could be:

POST /account/123
Host: myserver.com
Content-Length: XXX
   <action> Transfer</action>
   <toAccount>456</toAccount>
   <amount>300</amount>

Or:

POST /transfer/account/123
Host: myserver.com
Content-Length: XXX
   <toAccount>456</toAccount>
   <amount>300</amount>

Okay, so this brings up the question of "how pure do you want to be?"

The simplistic, non-pure answer is something like:

POST to e.g., /<authinfo>/account/123/transfer
with the arguments like you're second example above.

To be much more pure, you'd do this in stages:
PUT to e.g.: /<authinfo>/account/123/transfer
and get back a transfer transaction ID.  Then, you'd do the specific transfer:
POST to e.g.: /<authinfo>/account/123/transfer/<transactionID>
amount=$1,000.23
targetAccount=456789
and you'd get back a confirmation code or whatever as the body of the
200 response (if the 200 response isn't enough all by itself).

Then, you can always do a get to e.g.:
/<authinfo>/acount/123/transfer/<transactionID> to e.g., get the
details of that transfer.


> You authenticate and then post to the account's close.

So, same approach:

POST /account/123
Host: myserver.com
Content-Length: XXX
   <action>close</action>

Again, this smells like RPC to me.

Nope.  It would be something like:  DELETE to /<authinfo>/account/123
to close it.


And what if I want to close all accounts that have been inactive for at least a
year, without retrieving them one by one?
Would this approach:

POST /account/?inactivityPeriod=365
Host: myserver.com
Content-Length: XXX
   <action>close</action>

be more appropriate than this one?
POST /account/
Host: myserver.com
Content-Length: XXX
   <action>closeInactive</action>
  <inactivityPeriod>365</inactivityPeriod>

Um, er, isn't that just something that is done on the server?  Is this
for an admin client instead of a user client?


Hope this helps,
John

Reply via email to