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
description Feel free to write anything about this account
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" : "vasili@sovietnavy.com",
    "password" : "av01d_nuc13Ar_War",
    "firstname" : "Vasili",
    "lastname": "Arkhipov",
    "city" : "Zvorkovo",
    "phone": "0011223344",
    "address1": "Somewhere in Zvorkovo",
    "zip": "386",
    "country_code" : "ru",
    "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>vasili@sovietnavy.com</email>
  <password>av01d_nuc13Ar_War</password>
  <firstname>Vasili</firstname>
  <lastname>Arkhipov</lastname>
  <city>Zvorkovo</city>
  <phone>0011223344</phone>
  <address1>Somewhere in Zvorkovo</address1>
  <address2></address2>
  <zip>386</zip>
  <country_code>ru</country_code>
  <isChild>1</isChild>
  <unlimited>0</unlimited>
</account>
        
      

$response = \SMSFactor\Account::create([
  'account' => [
    "firstname" => "Stanislav",
    "lastname" => "Petrov",
    "city" => "Vladivostok",
    "phone" => "70102030405",
    "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' => 'Petrov@urss.com',
    '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>