ValidSession

Post ValidSession 

URL: /api/Login/ValidSession

Description 

Validate a login session token with Yurbi.

Method 

POST

Data Params

{
sessionToken: [string]
}

Example

{
sessionToken: "GLYBPSYRSMQQIAHCCNZCVLP"
}

Success Response 

Code: 200 

The ValidSession response JSON object contains may pieces of information, but the primary useful information it contains in the LoginSession and LoginUser properties if the session is valid.

{  
   "ErrorCode":0,
   "ErrorMessage":"",
   "LicensePortalAddress":"http://support.yurbi.com/",
   "LoginSession":{  
      "ErrorCode":0,
      "ErrorMessage":"",
      "SessionFlag":0,
      "SessionTimeLeft":0,
      "SessionToken":"GLYBPSYRSMQQIAHCCNZCVLP[U",
      "isGuestSession":false
   },
   "LoginUser":{  
      "AllApplications":[  
      ],
      "AllGroups":[  
      ],
      "AllRoles":[  
      ],
      "ApplicationConstraints":null,
      "AuthType":"PIN",
      "ComboName":"Admin, Yurbi",
      "CreateDate":"2011-10-13T14:47:50",
      "Description":"Builtin Yurbi Admin account",
      "EmailAddress":"",
      "ErrorCode":0,
      "ErrorMessage":"",
      "FirstName":"Yurbi",
      "FullName":"Yurbi Admin",
      "ID":"1",
      "LastName":"Admin",
      "LoginDate":"2016-05-17T21:13:46",
      "LoginName":"admin",
      "ModifyDate":"2016-03-23T08:38:15",
      "Pin":"",
      "Preferences":[  
      ],
      "SecurityGroups":[  
         {  
            "AllRoles":[  
            ],
            "AllUsers":[  
            ],
            "ErrorCode":0,
            "ErrorMessage":"",
            "GroupCreated":"2011-10-13T14:47:51",
            "GroupDescription":"Yurbi Admins",
            "GroupId":"1",
            "GroupModified":"2011-10-13T14:47:51",
            "GroupName":"Administrators",
            "GroupRoles":[  
               {  
                  "ErrorCode":0,
                  "ErrorMessage":"",
                  "RoleCreated":"2009-06-29T00:00:00",
                  "RoleDescription":"Full access to resources assigned to this group",
                  "RoleId":"1",
                  "RoleModified":"2009-06-29T00:00:00",
                  "RoleName":"Admin"
               }
            ],
            "GroupStatus":0,
            "Membership":[  
            ]
         },
         {  
            "AllRoles":[  
            ],
            "AllUsers":[  
            ],
            "ErrorCode":0,
            "ErrorMessage":"",
            "GroupCreated":"2011-10-13T14:47:51",
            "GroupDescription":"Yurbi Anonymous Objects",
            "GroupId":"2",
            "GroupModified":"2011-10-13T14:47:51",
            "GroupName":"Anonymous",
            "GroupRoles":[  
               {  
                  "ErrorCode":0,
                  "ErrorMessage":"",
                  "RoleCreated":"2009-06-29T00:00:00",
                  "RoleDescription":"Read-Only access to resources within this group",
                  "RoleId":"2",
                  "RoleModified":"2009-06-29T00:00:00",
                  "RoleName":"View"
               }
            ],
            "GroupStatus":0,
            "Membership":[  
            ]
         },
         {  
            "AllRoles":[  
            ],
            "AllUsers":[  
            ],
            "ErrorCode":0,
            "ErrorMessage":"",
            "GroupCreated":"2011-10-13T14:47:51",
            "GroupDescription":"All Users",
            "GroupId":"0",
            "GroupModified":"2011-10-13T14:47:51",
            "GroupName":"AllUsers",
            "GroupRoles":[  
               {  
                  "ErrorCode":0,
                  "ErrorMessage":"",
                  "RoleCreated":"2009-06-29T00:00:00",
                  "RoleDescription":"Full access to resources assigned to this group",
                  "RoleId":"1",
                  "RoleModified":"2009-06-29T00:00:00",
                  "RoleName":"Admin"
               }
            ],
            "GroupStatus":0,
            "Membership":[  
            ]
         }
      ],
      "UserApplications":[  
         {  
            "ApplicationID":"11",
            "ApplicationName":"CA Service Desk r12 ITIL",
            "ApplicationRoleID":"7",
            "ApplicationRoleName":"Architect",
            "ApplicationRoleType":"0"
         },
         {  
            "ApplicationID":"50",
            "ApplicationName":"Remedy ITSM 7.6",
            "ApplicationRoleID":"7",
            "ApplicationRoleName":"Architect",
            "ApplicationRoleType":"0"
         },
         {  
            "ApplicationID":"1015",
            "ApplicationName":"AdventureWorks",
            "ApplicationRoleID":"7",
            "ApplicationRoleName":"Architect",
            "ApplicationRoleType":"0"
         }
      ],
      "UserState":0,
      "isAdmin":true,
      "isAgent":true,
      "isArchitect":true,
      "isBuilder":false,
      "isFirstRun":false,
      "isSuperAdmin":true
   },
   "Passport":null,
   "RealmList":[  
      {  
         "ErrorCode":0,
         "ErrorMessage":"",
         "ProviderList":[  
         ],
         "RealmCreated":"2009-06-29T00:00:00",
         "RealmDescription":"This is a default realm. Cannot be edited.",
         "RealmId":"1",
         "RealmModified":"2009-06-29T00:00:00",
         "RealmName":"MASTER",
         "SMTPSetting":{  
            "ErrorCode":0,
            "ErrorMessage":null,
            "SMTPCreated":null,
            "SMTPEnableSSL":null,
            "SMTPFromAddress":null,
            "SMTPHost":null,
            "SMTPId":null,
            "SMTPModified":null,
            "SMTPPassword":null,
            "SMTPPort":null,
            "SMTPRealm":null,
            "SMTPRequiredSecurity":null,
            "SMTPUserName":null
         }
      }
   ],
   "isPassportExpiredBase":false,
   "isPassportFirstRun":false
}

Definition of LoginSession

NameDescriptionType
ErrorCodeError code numberinteger
ErrorMessageAssociated error message for error codestring
isGuestSessionTrue/False is the login session a guest session.bool
SessionFlagTBDinteger
SesstionTimeLeftTBDinteger
SessionTokenSession Token which must be based to all API calls.string

Definition of LoginUser

NameDescriptionType
ComboNameLastname, Firstnamestring
CreateDateContact record create datedate
Description Contact record descriptionstring
EmailAddressUser’s Email Addressstring
FirstNameUser’s first name.string
FullNameFirstName, LastNamestring
IDUser record id.integer
isAdminDoes the user have Admin access - used only to setup UI.bool
isAgentDoes the user have Agent access - used only to setup UI.bool
isArchitectDoes the user have Architect access - used only to setup UI.bool
isBuilderDoes the user have Builder access - used only to setup UI.bool
isFirstRunIf First run is true, then we need to activate Yurbi.bool
isSuperAdminOnly true if using builtin Admin account, UI setup only.bool
LastNameUser’s last name.string
ModifyDateUser record last modify datedate
PINThis is never returned from the server will be blankstring
PreferencesUser preferences TBDobject

Sample Call

$.ajax({
  url: "/api/login/ValidSession",
  dataType: "json",
    sessionToken: "GLYBPSYRSMQQIAHCCNZCVLP[U" },
  type : "POST",
  success : function(r) {
   //this does not mean valid login, only the call completed successfully
   if (r.Errorcode == 0) {
     // session is valid
   } else {
     // session error display message
     console.log(r.ErrorMessage);
   }
    console.log(r);
  },
  error: function(r, ajaxOptiosn, thrownError) {
  //severe error occured, service many not be available
    console.log(thrownError)
  }
});

Was this article helpful?

API Summary List
DoLogout