User informations

This API call is used to retrieve informations about user.

Basic description and parameters of API calls can be found on this page.

Service

User informations API belongs to General service (general).

API request

API request must contain all general parameters.

CTRL

Fixed value: user_info

User identification

One of following:

id
User's id.
login
User's login name.

You should specified one of user identification parameter listed above. This parameter identifies user uniquely. If you specify both, login will take precedence, if you specify none user making request will be assumed.

User can request following user's informations:

  • Administrators and system users can request informations about all users.
  • Customer can request informations about himself/herself and his/her users (user having him/her as owner).
  • User can request informations only about himself/herself.

If you request user who does not exists, or you do not have right/access to, USER_MISSING error is returned.

API examples

example 1: User's informations (PHP implementation)
$login = 'user';
$call = microtime(true);
$password = md5(md5("heslo").$call);

$url = "https://api.profisms.cz/index.php?" . http_build_query(array(
  "CTRL" => "user_info",
  "_login" => $login,
  "_password" => $password,
  "_service" => "general",
  "_call" => $call,

  "id" => 10, // user with ID 10
));

/**
URL

https://api.profisms.cz/index.php?CTRL=user_info&_login=user
  &_password=fc60197e8aaa9c692a1268d7f3cead77&_service=general
  &_call=1293633208.3125&id=10
*/

$json = join("", file($url));
  
example 2: User's informations (PHP implementation)
$login = 'user';
$call = microtime(true);
$password = md5(md5("heslo").$call);

$url = "https://api.profisms.cz/index.php?" . http_build_query(array(
  "CTRL" => "user_info",
  "_login" => $login,
  "_password" => $password,
  "_service" => "general",
  "_call" => $call,

  "login" => "kuk", // user with login name 'kuk'
));

/**
URL

https://api.profisms.cz/index.php?CTRL=user_info&_login=user
  &_password=fc60197e8aaa9c692a1268d7f3cead77&_service=general
  &_call=1293633208.3125&login=kuk
*/

$json = join("", file($url));
  
example 3: User's informations (PHP implementation)
$login = 'user';
$call = microtime(true);
$password = md5(md5("heslo").$call);

$url = "https://api.profisms.cz/index.php?" . http_build_query(array(
  "CTRL" => "user_info",
  "_login" => $login,
  "_password" => $password,
  "_service" => "general",
  "_call" => $call,
  // there are id and login parameters missing,
  // respose will contain informations about user with login
  // name "user" (request originator) 
));

/**
URL

https://api.profisms.cz/index.php?CTRL=user_info&_login=user
  &_password=fc60197e8aaa9c692a1268d7f3cead77&_service=general
  &_call=1293633208.3125
*/

$json = join("", file($url));
  

Response to valid API request

Basic response can be found in general API description.

Data object description

Object data contains following parameters:

id
User's id.
id_user
Owner's id (id of customer owning this user).
login
User's login name.
password
MD5 hash of user's password. This parameter will have value if API user is requesting himself/herself, or API user is either administrator or system user.
type
User's type.
created
Date and time when user was created. yyyy-mm-dd hh:ii:ss format.
account
Array of accounts, see below.
contact
Array of contacts, see below.
address
Array of addresses, see below.
values
Object containing some user specific values.

Description of objects in accounts array

Objects in array account have following properties:

number
Unique account number (variable symbol for usual payments)
credit
Credits on account (How much "money" is there on account).
currency
Account currency.

Description of objects in contacts array

Objects in array contact are following contact structure.

Description of objects in addresses array

Objects in array address are following address structure.

values object description

Object values contains following properties:

delivery_address
Preset value for SMS delivery reports.
deny_number_fix
Whether SMS can be sent to land lines (default true).
deny_number_foreign
Whether SMS can be sent to foreign (non Czech) numbers (default true).
forbidden_numbers
Array of numbers, that are considered invalid (SMS cannot be sent to such numbers by this user).
invoice_mail
Whether to send invoices by mail.
smsin_url
URL to send incomming SMS to. URL can be in form
http://www.example.com/index.php?ms=$msisdn&rec=$recipient&smstext=$smstext &so=$smsout&in=$smsin&reaon=$reason&created=$created
where variables are translated to:
$msisdn
Sender phone number
$recipient
Recipient phone number (one of numbers managed by Crazy Tomato)
$smstext
SMS text
$smsout
Comma separated list of IDs of messages which are (could be), source of such incomming SMS (session)
$smsin
ID of incomming SMS
$reason
Reason of such SMS
phone
SMS originated from phone number assigned to this user.
login
SMS text starts by this user's login name.
session
SMS was assigned to this user by session.
keyword
SMS was assigned to this user by keyword (kewords) assigned to this user.
smsin_email
Email address incomming SMS will be sent to (including some additional information).

Request and response examples

example 4: Request (PHP implementation)
$login = 'user';
$call = microtime(true);
$password = md5(md5("heslo").$call);

$url = "https://api.profisms.cz/index.php?" . http_build_query(array(
  "CTRL" => "user_info",
  "_login" => $login,
  "_password" => $password,
  "_service" => "general",
  "_call" => $call,
));

$json = join("", file($url));
  
ukázka 5: Response
{
  "error":
  {
    "code":0,
    "message":"OK"
  },
  "data":
  {
    "id":9,
    "id_user":8,
    "login":"user",
    "password":"12345678901234567890123456789012",
    "type":"customer",
    "created":"2010-10-20 13:17:31",
    "account":
    [
      {
        "number":"1200000275",
        "credit":423.9768,
        "currency":"CZK"
      },
      {
        "number":"1200000286",
        "credit":-6.39,
        "currency":"EUR"
      },
      {
        "number":"1200000297",
        "credit":0,
        "currency":"KRD"
      }
    ],
    "contact":
    [
      {
        "id_contact":1,
        "primary":1,
        "type":"email",
        "value":"john.doe@abcdef.cz"
      },
      {
        "id_contact":1,
        "primary":1,
        "type":"cell",
        "value":"+420123456789"
      }
    ],
    "address":
    [
      {
        "id_address":1,
        "primary":1,
        "type":"postal",
        "name":"John",
        "surname":"Doe",
        "title":"",
        "company":"",
        "street":"U obchody",
        "building_number":"123",
        "city":"Praha 1",
        "zip":"12345",
        "country":"cz"
      }
    ],
    "values":
    {
        "delivery_address":"john.doe@abcdef.cz",
        "deny_number_fix": 0,
        "deny_number_foreign": 0,
        "forbidden_numbers": [],
        "invoice_mail": 1,
        "smsin_email": "john.doe.in@abcdef.cz",
        "smsin_url": "http://www.abcdef.cz/index.php?ms=$msisdn&rec=$recipient=smstext=$smstext&so=$smsout&in=$smsin&reaon=$reason&created=$created"

    }
  },
  "_key":"dabaf9ab22e681c6edc0a6b60e8d6aac",
  "_time":0.64968109130859
}
  

Response to invalid request

Description can be found in general API description.