Closed tim-peterson closed 10 years ago
Hey Tim, user_id was indeed user-definable on DogeAPI. However, Block.io has fixed user_ids that it assigned, and they are always integers. The only way you can 'mark' an address is by defining a custom label for it.
Take for example the case of creating a user to collect payment on an invoice. In this case, you can create_user with a random label, or you can create_user with label='userXinvoice1'. The latter is the preferred approach.
Keep in mind that get_new_address has the same behavior; the calls are basically aliases to let our users know they can cater to creating users as well, which in some cases is not obvious to them at all.
Thanks @doersf. My only question is that user_id
and not label
is required for the get_user_balance
and withdraw_from_user
methods.
This means we developers will need to keep track of both the user_id
and label
. This should be made more clear to everyone in the documentation.
Ah, I understand. I'll add this to the TODO list; you really shouldn't have to track labels and user IDs.
Thanks that'd be great. If we could use label
for get_user_balance
, withdraw_from_user
, etc. that would be awesome!
@doersf any updates on a fix for not making us track labels and user IDs?
Hey Tim, it's bunched in with some updates we're currently testing for rapid withdrawals. Will let you know once we push these live with relevant doc updates. Cheers :)
Sounds good thanks!
Tim, new methods are now available:
withdraw_from_users, withdraw_from_addresses, withdraw_from_labels
Check them out: https://block.io/api#withdrawal-methods
PHP library was also updated to include these. Cheers!
I see them in the PHP library that I just updated with Composer! awesome!
It would be good to add to the docs for create_user
and Withdraw From Labels
, that the labels
, like the user_id
, must be unique such that one can't send/receive from multiple users using the withdrawal_from_labels
method.
Good point, will make it clear. Cheers, Tim.
The documentation isn't ideal for the
create_user
API method:https://block.io/api/simple/php
When you call this method,
$response=$block_io->create_user(array('label' => 'some value'));
, you can also call this$response=$block_io->create_user(array('user_id' => 'some value'));
The latter's
$response
gives you both auser_id
and alabel
. However, only theuser_id
returned by BlockIo can be used in theget_user_balance
method$block_io->get_user_balance(array('user_id' => 'USER ID'));
It would be preferable to clarify in this PHP library and on the BlockIo's site documentation that the
label
is something the developer defines whereasuser_id
is set by BlockIo.