This API allows you to login user. After successfull login one can omit login
informations from additional API calls.
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_login
API call example
example 1: User login (PHP implementation)
$login = 'user';
$call = microtime(true);
$password = md5(md5("passwd").$call);
$url = "https://api.profisms.cz/index.php?" . http_build_query(array(
"CTRL" => "user_login",
"_login" => $login,
"_password" => $password,
"_service" => "general",
"_call" => $call,
));
/**
URL
https://api.profisms.cz/index.php?CTRL=user_login&_service=general
&_login=user&_password=67060092181f11e9a41ea8789a111415
&_call=1302885011.45
*/
$json = join("", file($url));
Response to valid API request
Basic response can be found in
general API description .
String data description
Parameter data in result contains string representing session
identifier. This session can be used in API calls instead of login informations.
Response example
example 2: Response
{
"error":
{
"code":0,
"message":"OK"
},
"data":"ee2c6144c0f37dd21eb9f03959fad885",
"_key":"fdb0ebd1840e4bae0985de22f7695616",
"_POST":[],
"_GET":
{
"CTRL":"user_login",
"_service":"general",
"_login":"user",
"_call":"1302885011.45"
},
"_WEBSOCKETSMS":[],
"_time":0.0836260318756
}
Session is valid only for 10 minutes. Validity is extended with every
request to another 10 minutes. If there is no request within this 10 minutes,
usage of such session will result in error (USER_MISSING
),
session will be destroyed and user logged out.
One must use regular API call or login user again.
Response to invalid request
Description can be found in general API description .
Session usage
In case of successfull login one may use session for all
following API calls instead of _login and _password
parameters.
example 3: Session usage example - SMS send
$call = microtime(true);
$url = "https://api.profisms.cz/index.php?" . http_build_query(array(
"CTRL" => "sms",
"_session" => "ee2c6144c0f37dd21eb9f03959fad885",
"_call" => $call,
"_service" => "sms",
"msisdn" => "+420605582922",
"text" => "sms text",
));
/**
URL
https://api.profisms.cz/index.php?CTRL=sms&_session=ee2c6144c0f37dd21eb9f03959fad885
&_call=1302885818.68&_service=sms&msisdn=%2B420605582922
&text=sms+text
*/
$json = join("", file($url));
example 4: Session usage example - user informations
$call = microtime(true);
$url = "https://api.profisms.cz/index.php?" . http_build_query(array(
"CTRL" => "user_info",
"_session" => "ee2c6144c0f37dd21eb9f03959fad885",
"_call" => $call,
"_service" => "general",
));
/**
URL
https://api.profisms.cz/index.php?CTRL=user_info
&_session=ee2c6144c0f37dd21eb9f03959fad885
&_call=1302886058.76&_service=general
*/
$json = join("", file($url));
The results of API calls when session is used are the same as in case of regular calls.
You can use API as long as you agree to terms and conditions
for using ProfiSMS.
Version: 1.000 | 2011-04-15 | support@profisms.cz