This API can be used to edit user information.
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 .
Actions to edit user's informations can have another common parameters identifying
the user whom informations you are about to change (unless such a user is the same user calling
API. e.g. you as a customer are changing data of user who is registered as yours).
You can check those parameters in
API to get user's informations
(with different CTRL parameter).
In case the user calling API is changing his/her own informations, there is no need for
additional parameters, such user is identify by
ze basic parameters .
Changing password
API to change user's password.
API request parameters
CTRL
Fixed value: user_edit_password
password
New password.
API request example
example 1: Changing password (PHP implementation)
$login = 'someuser';
$call = microtime(true);
$password = md5(md5("originalpassword").$call);
$url = "https://api.profisms.cz/index.php?" . http_build_query(array(
"CTRL" => "user_edit_password",
"_login" => $login,
"_password" => $password,
"_service" => "general",
"_call" => $call,
// the password will be changed to user calling API
"password" => "newpassword",
));
/**
URL
https://api.profisms.cz/index.php?CTRL=user_edit_password∓_login=someuser&
_password=02706666415386337290d919c9514edf&_service=general&_call=1301505714.88&
password=newpassword
*/
$json = join("", file($url));
API response
API response does not contain any additional data except for the basic one found in
general API description .
Changing user's values
API to change user's values.
The list of values that can be changed are listed in
user's informations
documentation.
API request parameters
CTRL
Fixed value: user_edit_value
name
Value name.
value
Value itself.
API request example
example 2: Changing value (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_edit_value",
"_login" => $login,
"_password" => $password,
"_service" => "general",
"_call" => $call,
"id" => 8, // request to change value for user with ID 8
"name" => "delivery_address",
"value" => "http://company.com/dlr.php",
));
/**
URL
https://api.profisms.cz/index.php?CTRL=user_edit_value&_login=user&
_password=36cb5039db59d01c8a3ada5fc80caf7d&_service=general&_call=1301506237.49&
name=delivery_address&value=http%3A%2F%2Fcompany.com%2Fdlr.php&id=8
*/
$json = join("", file($url));
API response
API response does not contain any additional data except for the basic one found in
general API description .
API for creating/editing/deleting user's contacts.
CTRL
Fixed value: user_edit_contact
Name and meaning of another parameters follows
contact structure .
To create new contact, set id_contact parameter to
0 .
In case of editing existing contact, type parameter is ignored
(contact type cannot be changed).
To delete existing contact, you should pass empty value
parameter.
example 3: Altering contact (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_edit_contact",
"_login" => $login,
"_password" => $password,
"_service" => "general",
"_call" => $call,
// altering contact with ID 3
"id_contact" => "3",
"value" => "johndoe@johndoe.com",
// In case this is the only contact of it's type, you do not have to pass
// parameter primary, since such contact is primary by default
// Since existing contact is edited, parameter type can be omited.
));
/**
URL
https://api.profisms.cz/index.php?CTRL=user_edit_contact&_login=user&
_password=246c826d378a33e733c8bddacf18841f&_service=general&_call=1301507796.28&
id_contact=3&value=johndoe%40johndoe.com
*/
$json = join("", file($url));
Basic response can be found in
general API description .
In case of valid response, parameter data follows
contact structure ,
of the contact that was created, edited, or deleted
(id_contact = 0
will be returned if deleted).
example 4: Response
{
"error":
{
"code":0,
"message":"OK"
},
"data":
{
"id_contact":3,
"type":"email",
"value":"johndoe@johndoe.com",
"primary":1
},
"_key":"69723ee1e490782ea985f72347c2da92",
"_POST":[],
"_GET":
{
"CTRL":"user_edit_contact",
"_login":"user",
"_service":"general",
"_call":"1301507893.91",
"id_contact":"3",
"value":"johndoe@johndoe.com"
},
"_WEBSOCKETSMS":[],
"_time":0.254902839661
}
User's address
API for creating/editing/deleting user's address.
API request parameters
CTRL
Fixed value: user_edit_address
Name and meaning of another parameters follows
address structure .
To create new address, set id_address parameter to
0 .
In case of editing existing address, type parameter is ignored
(address type cannot be changed).
To delete existing address, you should pass empty city
parameter.
You have to pass all address parameters. Omited parameters will be set to empty string or
0 .
API request example
example 5: Altering address (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_edit_address",
"_login" => $login,
"_password" => $password,
"_service" => "general",
"_call" => $call,
"id_address" => 9,
"type" => "postal",
"primary" => 1,
"name" => "Jane",
"surname" => "Doe",
"title" => "",
"company" => "",
"street" => "Elm Street",
"building_number" => "546",
"city" => "City of Angels",
"zip" => "90211",
"country" => "us"
));
/**
URL
https://api.profisms.cz/index.php?CTRL=user_edit_address&_login=user&
_password=c5ffb4783e4acc541f72e4d094c9d241&_service=general&_call=1301587300.03&
id_address=9&type=postal&primary=1&name=Jane&surname=Doe&title=&
company=&street=Elm+Street&building_number=546&city=City+of+Angels&
zip=90211&country=us
*/
$json = join("", file($url));
API response
Basic response can be found in
general API description .
In case of valid response, parameter data follows
address structure ,
of the address that was created, edited, or deleted
(id_address = 0
will be returned if deleted).
example 6: Response
{
"error":
{
"code":0,
"message":"OK"
},
"data":
{
"id_address":9,
"type":"postal",
"primary":1,
"name":"Jane",
"surname":"Doe",
"title":"",
"company":"",
"street":"Elm Street",
"building_number":"546",
"city":"City of Angels",
"zip":"90211",
"country":"us"
},
"_key":"5bc040b2efb1b458951501df14aa9be9",
"_POST":[],
"_GET":
{
"CTRL":"user_edit_address",
"_login":"user",
"_service":"general",
"_call":"1301587300.03",
"id_address":"9",
"type":"postal",
"primary":"1",
"name":"Jane",
"surname":"Doe",
"title":"",
"company":"",
"street":"Elm Street",
"building_number":"546",
"city":"City of Angels",
"zip":"90211",
"country":"us"
},
"_WEBSOCKETSMS":[],
"_time":0.0763208866119
}
You can use API as long as you agree to terms and conditions
for using ProfiSMS.
Version: 1.000 | 2011-04-13 | support@profisms.cz