User Management APIs

User Management enables you to create users and assign them various capabilities. For e.g. provide them phone credits, configure SIP settings for them, restrict their calls to only certain destinations etc.

Although, it’s not necessary to create users in order to use the TringMe APIs, creating users can give you an additional flexibility, for example restricting usage per user, per user call records etc. You can channel your entire user’s need (e.g. call or sms) though TringMe’s user management API and keep yourself free from implementing user management at your local end.

TringMe’s users can be categorized into two categories:

Public Users: Publics users are those which can be accessed by any API holder. Public users can even login directly at http://tringme.com:

  • 1. Can directly login at TringMe’s website.
  • 2. Is not restricted to the developer who has created this user using the API.
  • 3. TringMe can reach out to these users since they are not private to the developer who created them.

Private Users: These users are exclusively created in a ‘private’ space for the developer whose API keys were used to create them. These users are also created using ‘createuser’ API but with parameter ‘private’ set.

Private users are more flexible if you need:

  • 1. To create TringMe users who are restricted only to your application. No API holder can even access or change any settings of the private users.
  • 2. Better user management capabilities like changing the password, reversing the funds etc.
  • 3. Recommended

Let’s go through user management APIs to better understand the capabilities.


Create Account

This API is used for creating a user. It is the fundamental API to the user management capabilities in TringMe.

Parameters
op createuser
email Email address of the user being created.
password [optional] Password to be used for this account. Password is optional for the publicusers. In that case, system will generate the password and send in welcome email.
name [optional] Name of the user.
name [optional] Name of the user.
private [optional] Create a private user. If this parameter is specified, user will be created in API user's private space. No emails will be sent by TringMe for any private users.
amount [optional] Add initial credits to the account. Trasaction ID for credit transfer is returned in response.
Sample Request URL
http://api.tringme.com/api.php?op=createuser& email=joe.dirt%40somedomain.com &name=Joe+Dirt&
password=joedirt& apikey=b1234567890123456789 &sig=f1234567890123456789012345678901
Expected Response
OK <uid> <[transactionid]>
Sample Responses
OK 12345678
OK 12345678 a6b2t48x364nhijl2bc

Activate Account

This API is used for activating a public user after user creation. This is an essential step before the user can login. This API is NOT needed for private users since private users are pre-activated.

Parameters
op activateuser
email Email address of the user being activated.
activationcode Activation code which was sent to the user on user´s email address which was passed in ‘createuser’ API. This is required only for public users. Private users are automatically activated on creation.
Sample Request URL
http://api.tringme.com/api.php?op=activateuser &email=joe.dirt%40somedomain.com &activationcode=16OUOC3827& apikey=b1234567890123456789012345678 &sig=f1234567890123456789012345678901
Expected Response
OK
Sample Responses
OK

Reactivate User

This API is used for re-activating an existing public user. It resends the activation email to the user. Thisis only applicable if the user was created using ‘createuser’ API and password was specified during user creation. This API is NOT needed for private users.

Parameters
op reactivateuser
email Email address of the user.
Sample Request URL
http://api.tringme.com/api.php?op=reactivateuser &email=joe.dirt%40somedomain.com &apikey=b1234567890123456789012345678 &sig=f123456789012345678901234567
Expected Response
OK
Sample Responses
OK

Login User

This API is used to login a user. One user logs in, system will return the cookie which can be used in all subsequent API calls to associate the user with that API operation (e.g. call)

Parameters
op login
email Email address of the user.
password Password of the user.
private Private User Login. This parameter should only be set if the user was created - ‘createuser’- with the private parameter set.
validity [optional] Validity of login in minutes. Default, 90 minutes.
Sample Request URL
http://api.tringme.com/api.php?op=login &email=joe.dirt%40somedomain.com &password=joedirt123&apikey= b12345678901234567890123456789012345 &sig=f1234567890123456789012345678901
Expected Response
OK
Sample Responses
OK 12345678901234567890123

Logout User

This API is used to logout a user from the system.

Parameters
op logout
cookie Cookie which was obtained using ‘login’.
Sample Request URL
http://api.tringme.com/api.php?op=logout &cookie=12345678901234567890123456 &apikey=b1234567890123456789012345678 &sig=f1234567890123456789012345
Expected Response
OK
Sample Responses
OK

Get User Information

This API is used to get user information.

Parameters
op getuser
cookie Cookie which was obtained using ‘login’.
Sample Request URL
http://api.tringme.com/api.php?op=getuser &cookie=1234567890123456789012345678901 & apikey=b1234567890123456789012345678 &sig=f12345678901234567890123456
Expected Response
OK with user information in JSON format.
Sample Responses
OK "name":"joedirt", "authphone":"", "sipcredits":"0", "referbonus":"0.0000", "flag":"17534406", "uid":"1618118", "usdcredits":"0.5810", "virtualnumber":8735857304, "defchannel":"", "vmcount":"0", "refercount":0,"pendingpayments":"0", "userid":"1113

Reset Password

This API is used to change a user password. An email will be sent to user with code that should be used to change the password in ‘changepassword’ API.

This API is only needed for pubic users. Use ‘changepassword’ API for private users.

Parameters
op resetpassword
cookie Email of the user where the reset password email should be sent.
subject Subject of the email.
message Message that should be sent to the user. Note that you can include %TRINGMEAUTHCODE% as a placeholder in your message where TringMe will insert the verification code. This verification code should be used in ‘changepassword’.
Sample Request URL
http://api.tringme.com/api.php?op=resetpassword &email=joe.dirt%40somedomain.com &subject=Resetting+your+password &message=password+has+been +reseted with+authenticaion +code+%25TRINGMEAUTHCODE%25 &apikey=b1234567890123456 7890123456789012345 &sig=f1234567890123456 789012345678901
Expected Response
OK with user information in JSON format.
Sample Responses
OK

Change Password

This API is used to change a user password. For public users, change password requires either the old password or reset code sent by ‘resetpassword’’ API. For private users, password can directly be changed by giving new password.

Parameters
op resetpassword
email Email of the user.
password New password.
oldpassword [optional] Old password of the user. Optional for private users.If this is provided then, ‘code’ parameter is not required.
code [optional] A verification code that was sent by ‘resetpassword’. This parameters is mandatory if ‘oldpassword’ is not being supplied.
Sample Request URL
http://api.tringme.com/api.php?op=changepassword &email=joe.dirt%40somedomain.com &password=joe1234 &apikey=b123456789012345678901234567 89012345 &sig=f1234567890123456789012345678901
Expected Response
OK with user information in JSON format.
Sample Responses
OK "name":"joedirt", "authphone":"", "sipcredits":"0", "referbonus":"0.0000", "flag":"17534406", "uid":"1618118", "usdcredits":"0.5810", "virtualnumber":8735857304, "defchannel":"", "vmcount":"0", "refercount":0, "pendingpayments":"0", "userid":"1113

If you are an enterprise and would like to know better how TringMe can help you reduce cost and at the same time benefit you,
please send a mail to bizdev@tringme.com