Session
Session endpoints allow you to create deep-link tokens for embedding Forms Live in your application, and retrieve information about the current authenticated user and their agency.
Create User Session
This endpoint creates a token for deep-linking an end-user into Forms Live. This is useful when you want to embed Forms Live within your own application using an iframe.
This endpoint is only applicable for third-party based authentication. See the Authentication documentation for more details.
Returns
- Name
token- Type
- string
- Description
Token to be used for deep-linking into Forms Live. This token can be appended to the Forms Live URL as
?x-token=<token>to authenticate the user.
Request
curl https://app-api.reiformslive.com.au/user/session \
--request POST \
--header "Authorization: Basic YTlkOWIwYItNGY4Yi1hYTQxLTI5NzZmMTcyZmEyMQ=="
Response
{
"token": "00000000-0000-0000-0000-000000000000"
}
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
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
| Field | Type | Description |
|---|---|---|
| id | Integer | Unique identifier for the user |
| agency_id | Integer | ID of the agency the user belongs to |
| member_number | String | Real estate member number (optional) |
| realtor_number | String | Realtor number (optional) |
| given_name | String | User's first name |
| surname | String | User's last name |
| String | User's email address | |
| mobile | String | User's mobile phone number |
| principal | Boolean | Whether the user is a principal of the agency |
| default_private | Boolean | Default privacy setting for forms |
| active | Boolean | Whether the user account is active |
| deleted | Boolean | Whether the user account has been deleted |
| created | Integer | Unix timestamp of account creation |
| updated | Integer | Unix timestamp of last update |
Agency Object
| Field | Type | Description |
|---|---|---|
| id | Integer | Unique identifier for the agency |
| name | String | Agency name |
| address | String | Primary address |
| address2 | String | Secondary address line |
| suburb | String | Suburb/city |
| state | String | State abbreviation |
| postcode | String | Postal code |
| phone | String | Agency phone number |
| fax | String | Agency fax number |
| String | Agency email address | |
| credits | Integer | Available form credits |
| active | Boolean | Whether the agency is active |
| approved | Boolean | Whether the agency is approved |
| member_number | String | Real estate member number |
| licencee_name | String | Licensed entity name |
| licencee_number | String | License number |
| gst | Boolean | Whether GST is applicable |
| abn | String | Australian Business Number |
| logo | String | URL to agency logo (optional) |
| created | Integer | Unix timestamp of agency creation |
| updated | Integer | Unix timestamp of last update |
| active_subscription | Boolean | Whether subscription is active |
| subscription_expiry | Integer | Unix timestamp of subscription expiry |
| subscription_type | String | Type of subscription |
| admin | Boolean | Whether user has admin privileges |
| forms_created | Integer | Number of forms created |
Session Object
| Field | Type | Description |
|---|---|---|
| token | String | Unique session token |
| impersonating | Boolean | Whether the session is impersonating another user |