Session

Session endpoints allow you to retrieve information about the current authenticated user and their agency. This is useful for understanding the context of API requests and displaying user-specific information.

Get Current Session

To get current session information, a HTTP GET request is made to the URL with the session token.

Required attributes

No additional parameters are required for this endpoint.

Returns

Returns session information including the authenticated user, their agency, and the session token.

Request

GET
/session/
curl https://nsw.api.reiformslive.com.au/session/ \
  --request GET \
  --header "Authorization: Basic YTlkOWIwYItNGY4Yi1hYTQxLTI5NzZmMTcyZmEyMQ=="

Response

{
  "user": {
    "id": 1,
    "agency_id": 2,
    "member_number": null,
    "realtor_number": null,
    "given_name": "John",
    "surname": "Doe",
    "email": "JohnDoe@example.com",
    "mobile": "",
    "principal": true,
    "default_private": false,
    "active": true,
    "deleted": false,
    "created": 1354083959,
    "updated": 1355181213
  },
  "agency": {
    "id": 44,
    "name": "Mark",
    "address": "Test",
    "address2": "",
    "suburb": "Test",
    "state": "SA",
    "postcode": "5000",
    "phone": "9493498394",
    "fax": "8498349",
    "email": "agency@example.com",
    "credits": 26500,
    "active": true,
    "approved": true,
    "member_number": "000001",
    "licencee_name": "Example Agency Realty Ltd Pty",
    "licencee_number": "000002",
    "gst": false,
    "abn": "000000",
    "logo": null,
    "created": 1354083959,
    "updated": 1355288002,
    "active_subscription": false,
    "subscription_expiry": null,
    "subscription_type": "ALL",
    "admin": true,
    "forms_created": 12
  },
  "token": "00000000-0000-0000-0000-000000000000",
  "impersonating": false
}

Response Fields

The session endpoint returns the following information:

User Object

FieldTypeDescription
idIntegerUnique identifier for the user
agency_idIntegerID of the agency the user belongs to
member_numberStringReal estate member number (optional)
realtor_numberStringRealtor number (optional)
given_nameStringUser's first name
surnameStringUser's last name
emailStringUser's email address
mobileStringUser's mobile phone number
principalBooleanWhether the user is a principal of the agency
default_privateBooleanDefault privacy setting for forms
activeBooleanWhether the user account is active
deletedBooleanWhether the user account has been deleted
createdIntegerUnix timestamp of account creation
updatedIntegerUnix timestamp of last update

Agency Object

FieldTypeDescription
idIntegerUnique identifier for the agency
nameStringAgency name
addressStringPrimary address
address2StringSecondary address line
suburbStringSuburb/city
stateStringState abbreviation
postcodeStringPostal code
phoneStringAgency phone number
faxStringAgency fax number
emailStringAgency email address
creditsIntegerAvailable form credits
activeBooleanWhether the agency is active
approvedBooleanWhether the agency is approved
member_numberStringReal estate member number
licencee_nameStringLicensed entity name
licencee_numberStringLicense number
gstBooleanWhether GST is applicable
abnStringAustralian Business Number
logoStringURL to agency logo (optional)
createdIntegerUnix timestamp of agency creation
updatedIntegerUnix timestamp of last update
active_subscriptionBooleanWhether subscription is active
subscription_expiryIntegerUnix timestamp of subscription expiry
subscription_typeStringType of subscription
adminBooleanWhether user has admin privileges
forms_createdIntegerNumber of forms created

Session Object

FieldTypeDescription
tokenStringUnique session token
impersonatingBooleanWhether the session is impersonating another user

Was this page helpful?