Data Methods

You can use data methods to retrieve information about different objects on a page.

loggedInUser

Returns details of a user who is logged into the Freshteam user interface.

Copied Copy
1
2
3
4
5
6
7
8
client.data.get("loggedInUser").then ( function(data) { // success output }, function(error) { // failure operation } );

Sample Output Payload

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
{ "id": "34324", "name": "Joe Michael", "first_name": "Joe", "middle_name": , "last_name": "Michael", "role_ids": [1,23], "timezone": "en/us", "designation": "Manager", "branch": { "id": 1, "name": "Chennai Branch", "city": "Chennai", "street": "", "state": "TN", "country_code": "IN", "main_offfice": true, "deleted": false, "date_format": "MM/DD/YYYY", "time_zone": "Asia" }, "user_type": "full_time", "language": "en", "joining_date": "2020-02-02", "email": "joe.michael@xyz.com" }
EXPAND ↓

Attributes of the loggedInUser object

Attribute Date Type Description
id string Identifier of the logged in user.
name string Name of the user.
first_name string Business name of the user.
middle_name string Middle name of the user.
last_name string Last name of the user.
role_ids array of numbers Identifiers of the roles associated with the user who is logged in. When a role is configured in Freshteam, an auto-generated identifier is associated with the role.
timezone string Time-zone applicable to the branch to which the user is associated.
designation string Job title of the user.
branch branch object Details of the branch to which the user is associated.
user_type string Employment terms associated with the user.
For example,
Full Time, Part Time, Contract, Internship, Temporary, Seasonal, Volunteer, Fixed Term Contract, Secondment, and so on.
language string Primary language of the branch to which the user is associated.
joining_date string Date, in the UTC format, specified as the user’s joining date.
email string Email address of the user.

Attributes of the branch object

Attribute Date Type Description
id number Identifier of the branch object. This value is auto-generated.
name string Descriptive identifier of the branch.
city string City in which the branch is located.
street string Address parameter of the branch.
state string Province in which the branch is located.
country_code string Country in which the branch is located, specified as a character code.
main_offfice boolean Specifies whether the branch is the main office at a location.
Possible values: true, false
deleted boolean Specifies whether the branch is still a valid location. For deleted branches, the attribute is set as true.
Possible values: true, false
date_format string Accepted date format at the region where the branch is located.
Possible values: MonthFirst (specifies that the accepted format is MM-DD-YYYY), DateFirst (specifies that the accepted format is DD-MM-YYYY)
time_zone string Time-zone applicable to the branch location.
domainName

Returns the domain name of the business account that uses Freshteam.

Copied Copy
1
2
3
4
5
6
7
8
client.data.get("domainName").then ( function(data) { //Success operation }, function(error) { // failure operation } );

Sample Output Payload

1
"name": "domain.freshteam.com"

Data Returned by the domainName object

Date Type Description
string Domain name assigned by Freshteam, for a business account.
jobPosting

Returns details of the job posting in the Job Posting Details page.

Copied Copy
1
2
3
4
5
6
7
8
client.data.get("jobPosting").then ( function(data) { // success output }, function(error) { // failure operation } );

Sample Payload

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
{ "id": "753839", “title”: “Sample Job Posting”, “description”: “Sample Job”, "deleted": false, "remote": false, "experience": "Entry Level", "status": "Published", "show_pursue_as_career": false, “applicant_apply_link”: “https://test.freshteam.com/jobs/iITkQ-SkR09k”, “applicant_access_type”: “open”, "type": "contract", “branch”: { “id”: 1, “name”: “Chennai Branch”, “city”: “Chennai”, “street”: “”, “state”: “TN”, “country_code”: “IN”, “main_offfice”: true, “deleted”: false, “date_format”: “MM/DD/YYYY”, “time_zone”: “Asia” }, “department”: { “id”: 1, “name”: “Sales”, “deleted”: false }, “skills”: [“SALES”, “MARKETING”], “salary”: { “min”: 1000, “max”: 2000, “currency”: “USD” }, “custom_field_values”: { “custom_1”: "fewf", “custom_2”: "3232" }, “created_at”: 2020-06-10T04:27:55.000Z”, “updated_at”: 2020-06-10T08:27:55.000Z”, }
EXPAND ↓

Attributes of the jobPosting object

Attribute Date Type Description
id string Identifier of a job posting, auto-generated when a job posting is created in the Freshteam system.
title string Descriptive identifier of the job posting. For example, Marketing, Administration, Finance and so on.
description srting Details about the job posting.
deleted boolean Specifies whether the posting exists in the Freshteam system.
Possible values: true, false
remote boolean Specifies whether the job posting is open for remote work.
Possible values: true, false
experience string Experience level associated with the job role. For example, Internship, Entry level, Associate, Mid-senior level, Director/Vice-President, Executive/President, and so on.
status string Status of the job posting. For example, Active, Draft, Published, On Hold, Closed, Deleted, and so on.
show_pursue_as_career boolean Specifies whether the job posting is enabled for internal applicants as well.
Possible values: true, false
applicant_apply_link string URL using which candidates can apply to the job posting.
applicant_access_type string Type of access granted to users to view applicant information.
type string Employment terms associated with the job posting.
Possible values:
Full Time, Part Time, Contract, Internship, Temporary, Seasonal, Volunteer, Fixed Term Contract, Secondment
branch branch object Branch where the job posting is open for recruitment.
department object Details of the department associated with the job posting.
Attributes of the department object:
id (number): Identifier of the department object, auto-generated when a new department is created in the Freshteam system.
name (string): Descriptive identifier of the department.
deleted (boolean): Specifies whether the department still exists in the organization.
Possible values: true, false
skills array of strings Skills associated with the job posting.
salary object Details of the salary band associated with the job posting.
Attributes of the salary object:
min (integer): Minimum salary associated with the job.
max (integer): Maximum salary associated with the job.
max (integer): Currency applicable to the min and max values.
custom_field_values object The organization that uses Freshteam can configure custom fields to specify additional information about the job posting. The custom_field_values attribute contains the custom field names and corresponding values, as a valid JSON object of key (custom field name)-value (custom field’s value) pairs.
created_at string Timestamp of when the job posting is created, specified in the UTC format.
updated_at string Timestamp of when the job posting is updated, specified in the UTC format.