Create an account
This method allows you to create an account or a sub-account. For a sub-account creation, just insert the isChild
param with the value 1
.
POST
/account
Body Parameters
email
required
|
The email of the account |
password
required
|
The password must be at least 6 characters long (25 max) |
country_code
required if main account
|
The country code associated to the account (ISO 3166-1 alpha-2) |
firstname | The firstname associated to the account |
lastname | The lastname associated to the account |
city | The city associated to the account |
phone | The phone number associated to the account |
address1 | The address associated to the account |
address2 | Further information about the address |
zip | The zip code |
company | The company associated to the account |
type | Select one between : company , association , administration , private |
sender | The default sender that will be used for your sendings |
isChild | integer 0 for a main account, 1 for a sub-account |
unlimited
required if isChild
|
Is the account unlimited ? If unlimited, the sub-account uses the parent's credits. If not, the main account has to give a certain amount of credits to its sub-account. |
Examples
POST /account HTTP/1.1
Host: api.smsfactor.com
Authorization: Bearer your.token
Accept: application/json
{
"account":{
"email" : "[email protected]",
"password" : "Y0UH4V37H3r16H77083H4PPY",
"firstname" : "Jean",
"lastname": "d'Ormesson",
"city" : "Paris",
"phone": "33612345678",
"address1": "Neuilly-sur-Seine",
"zip": "92200",
"country_code" : "fr",
"isChild" : 1,
"unlimited" : 0
}
}
POST /account HTTP/1.1
Host: api.smsfactor.com
Authorization: Bearer your.token
Accept: application/xml
<?xml version="1.0" encoding="UTF-8"?>
<account>
<email>[email protected]</email>
<password>Y0UH4V37H3r16H77083H4PPY</password>
<firstname>Jean</firstname>
<lastname>d'Ormesson</lastname>
<city>Paris</city>
<phone>33612345678</phone>
<address1>Neuilly-sur-Seine</address1>
<address2></address2>
<zip>92200</zip>
<country_code>fr</country_code>
<isChild>1</isChild>
<unlimited>0</unlimited>
</account>
$response = \SMSFactor\Account::create([
'account' => [
"firstname" => "Stanislav",
"lastname" => "Petrov",
"city" => "Vladivostok",
"phone" => "33612345678",
"address1" => "Unknown soldier street",
"zip" => "56330",
"country_code" => "RU",
"isChild" => 0, //Is the account a subaccount ?
"unlimited" => 0, //If isChild, should the subaccount use the parent's credits
'email' => '[email protected]',
'password' => 'av0id_nuc3ar_war'
]
]);
Result Format
{
"status": 1,
"message": "OK",
"id": "11689",
"active": "1"
}
<?xml version="1.0" encoding="UTF-8"?>
<response>
<status>1</status>
<message>OK</message>
<id>11690</id>
<active>1</active>
</response>