Difference between revisions of "MOR API user login"

From Kolmisoft Wiki
Jump to navigationJump to search
Line 1: Line 1:
=Description=
[[MOR API]] Logs in user into MOR
[[MOR API]] Logs in user into MOR
<br><br>
=Configuration=
Go to '''SETTINGS –> Setup –> Settings''' select API tab and check '''Allow API globaly'''. 
<br><br>
=Usage=
* Call: /api/user_login
<br><br>
===Parameters=== 
* u - username to login. '''Required'''.
* p - Password to login. '''Required'''.
<br><br>
===Request===


==Request==
HTML POST: http://<SERVER_IP>/billing/api/user_login?u=username&p=password


HTML POST: http://<SERVER_IP>/billing/api/login?u=username&p=password
===Returns===


==Result==
'''Success'''. Everything is ok. User is logged into the system you get:


  <?xml version="1.0" encoding="utf-8" standalone="yes"?>
  <?xml version="1.0" encoding="utf-8" standalone="yes"?>
Line 11: Line 28:
     <name>login</name>
     <name>login</name>
     <status>ok</status>
     <status>ok</status>
     <user_id>54</user_id>    #this line was added on MOR11
     <user_id>user_id</user_id>    #this line was added on MOR11
    <status_message>Successfully logged in</status_message>
   </action>
   </action>
----
 
Everything is ok. User is logged in to the system.


----
'''Error'''


  <?xml version="1.0" encoding="utf-8" standalone="yes"?>
  <?xml version="1.0" encoding="utf-8" standalone="yes"?>
Line 23: Line 39:
     <name>login</name>
     <name>login</name>
     <status>failed</status>
     <status>failed</status>
    <status_message>Login failed</status_message>
   </action>
   </action>
   
   
This means that wrong username and/or password and user can't be authenticated.
This means that wrong username and/or password and user can't be authenticated.
<br><br>
<br><br>
 
=Advanced options=
==Customer redirect==
<!---This functionality is available from MOR 9--->
<!---This functionality is available from MOR 9--->
To redirect customer to MOR Billing main site go to: '''SETTINGS -> Setup -> Settings -> API''' and check the marked option:
To redirect customer to MOR Billing main site go to: '''SETTINGS -> Setup -> Settings -> API''' and check the marked option:

Revision as of 15:22, 19 May 2013

Description

MOR API Logs in user into MOR

Configuration

Go to SETTINGS –> Setup –> Settings select API tab and check Allow API globaly.

Usage

  • Call: /api/user_login



Parameters

  • u - username to login. Required.
  • p - Password to login. Required.



Request

HTML POST: http://<SERVER_IP>/billing/api/user_login?u=username&p=password

Returns

Success. Everything is ok. User is logged into the system you get:

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <action>
   <name>login</name>
   <status>ok</status>
   <user_id>user_id</user_id>    #this line was added on MOR11
   <status_message>Successfully logged in</status_message>
 </action>

Error

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <action>
   <name>login</name>
   <status>failed</status>
   <status_message>Login failed</status_message>
 </action>

This means that wrong username and/or password and user can't be authenticated.

Advanced options

To redirect customer to MOR Billing main site go to: SETTINGS -> Setup -> Settings -> API and check the marked option:

Mor api redirect.png

If login over API is successful the customer will be redirected to MOR Billing main site.

If login is not successful :

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <action>
   <name>login</name>
   <status>failed</status>
 </action>

This means that wrong username and/or password and user can't be authenticated.