Creating an account via API the server appears to validate some parameters and not others.
It doesn't, for instance, check to see if the email address is alredy in use. But it does check the format of the PlayerName.
Is there a list somewhere of what the server does/doesn't check when creating a new account via API?
API Account Parameters Validation
-
- Posts: 107
- Joined: Wed May 06, 2009 12:59 pm
- Contact:
-
- Site Admin
- Posts: 5880
- Joined: Wed Mar 19, 2008 8:47 pm
Re: API Account Parameters Validation
The AccountsAdd API command just uses the same validation routine as if you were manually creating the account from the server console. It's not as thorough as the routine that checks a player-created account. Specifically it looks at the following:CanadaWest wrote:Creating an account via API the server appears to validate some parameters and not others.
It doesn't, for instance, check to see if the email address is alredy in use. But it does check the format of the PlayerName.
Is there a list somewhere of what the server does/doesn't check when creating a new account via API?
Name is 3 to 12 characters and only includes letters, numbers, dashes, or underscores.
Name cannot be Dealer, System, or Administrator.
Title cannot exceed 15 characters in length.
Level cannot exceed 50 characters in length.
Real Name cannot exceed 25 characters in length.
Password must be from 6 to 30 characters in length.
Location must be from 1 to 30 characters in length.
Email address cannot exceed 80 characters in length and must contain an @ sign and a period.
Avatar index must be from 0 to 64.
If Avatar is 0 then you must specify an avatar file and that file must currently exist.
Custom field cannot exceed 50 character limit.
Note field cannot exceed 250 character limit.
-
- Posts: 107
- Joined: Wed May 06, 2009 12:59 pm
- Contact:
Re: API Account Parameters Validation
Thanks Kent.
So we need to check for a duplicate email address and run our own email validation?
Will api AccountsAdd write to the "ValCode" field? I don't see that parameter on the list.
And, whats wrong with this? It is returning "Notice: Undefined index: Email ... on line 26"
$params = "Password=$pw&Command=AccountsList&Fields=Email" ;
$api = Poker_API($url,$params,true);
$n = $api["Email"]; // This is line 26
$found = false;
for ($i = 1; $i <= $n; $i++)
{
$REmail = $api["Email" . $i];
if ($REmail == $Email)
{
$found = true;
}}
if ($found == true) die ("<p align=\"center\" font=\"arial\">
That Email address already has an account associated with it.
Click Back Button on your browser to correct the form.</font></p>");
So we need to check for a duplicate email address and run our own email validation?
Will api AccountsAdd write to the "ValCode" field? I don't see that parameter on the list.
And, whats wrong with this? It is returning "Notice: Undefined index: Email ... on line 26"
$params = "Password=$pw&Command=AccountsList&Fields=Email" ;
$api = Poker_API($url,$params,true);
$n = $api["Email"]; // This is line 26
$found = false;
for ($i = 1; $i <= $n; $i++)
{
$REmail = $api["Email" . $i];
if ($REmail == $Email)
{
$found = true;
}}
if ($found == true) die ("<p align=\"center\" font=\"arial\">
That Email address already has an account associated with it.
Click Back Button on your browser to correct the form.</font></p>");
-
- Site Admin
- Posts: 5880
- Joined: Wed Mar 19, 2008 8:47 pm
Re: API Account Parameters Validation
Yes.CanadaWest wrote: So we need to check for a duplicate email address and run our own email validation?
No, that field is disabled on creation so you'll have to do an AccountsEdit to write a value there.Will api AccountsAdd write to the "ValCode" field? I don't see that parameter on the list.
There is no "Email" field returned by AccountsList. There's an Email1, Email2, Email3, etc. You want the total count returned so change this:And, whats wrong with this? It is returning "Notice: Undefined index: Email ... on line 26"
$n = $api["Email"];
to this:
$n = $api["Accounts"];
-
- Posts: 107
- Joined: Wed May 06, 2009 12:59 pm
- Contact:
Re: API Account Parameters Validation
Thank you,
bummer,
and Thank you very much.
bummer,
and Thank you very much.