curl --request GET \
--url https://api.contractorscloud.com/api/v1/users/{userId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.contractorscloud.com/api/v1/users/{userId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.contractorscloud.com/api/v1/users/{userId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.contractorscloud.com/api/v1/users/{userId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.contractorscloud.com/api/v1/users/{userId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.contractorscloud.com/api/v1/users/{userId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.contractorscloud.com/api/v1/users/{userId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": 1159,
"tenant_id": 1,
"default_company_id": 6,
"user_level_id": 4,
"email": "jane.doe@example.com",
"username": "jane.doe@example.com",
"first_name": "Jane",
"last_name": "Doe",
"initials": "JD",
"title": "Operations Manager",
"color": "#0a7d2c",
"timezone": "America/Chicago",
"started_at": "2019-06-03",
"terminated_at": null,
"is_active": true,
"phone_home": null,
"phone_cell": "(555) 100-2048",
"phone_direct": null,
"phone_direct_ext": null,
"address_street": null,
"address_city": null,
"address_state": "WI",
"address_zip": null,
"tax_id": null,
"employment_type": 0,
"description": null,
"theme": "charcoal",
"avatar_thumbnail_url": "https://cdn.contractorscloud.com/users/1159/thumb.jpeg",
"auto_insured_at": null,
"game_mode_daily_high_score": 0,
"game_mode_total_score": 0
}{
"message": "Unauthenticated."
}{
"message": "The requested resource could not be found."
}Get user
Returns a single user by id. Pass the literal me as the id to fetch the currently authenticated user — the recommended way to verify that your token works and identify who you’re connected as.
curl --request GET \
--url https://api.contractorscloud.com/api/v1/users/{userId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.contractorscloud.com/api/v1/users/{userId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.contractorscloud.com/api/v1/users/{userId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.contractorscloud.com/api/v1/users/{userId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.contractorscloud.com/api/v1/users/{userId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.contractorscloud.com/api/v1/users/{userId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.contractorscloud.com/api/v1/users/{userId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": 1159,
"tenant_id": 1,
"default_company_id": 6,
"user_level_id": 4,
"email": "jane.doe@example.com",
"username": "jane.doe@example.com",
"first_name": "Jane",
"last_name": "Doe",
"initials": "JD",
"title": "Operations Manager",
"color": "#0a7d2c",
"timezone": "America/Chicago",
"started_at": "2019-06-03",
"terminated_at": null,
"is_active": true,
"phone_home": null,
"phone_cell": "(555) 100-2048",
"phone_direct": null,
"phone_direct_ext": null,
"address_street": null,
"address_city": null,
"address_state": "WI",
"address_zip": null,
"tax_id": null,
"employment_type": 0,
"description": null,
"theme": "charcoal",
"avatar_thumbnail_url": "https://cdn.contractorscloud.com/users/1159/thumb.jpeg",
"auto_insured_at": null,
"game_mode_daily_high_score": 0,
"game_mode_total_score": 0
}{
"message": "Unauthenticated."
}{
"message": "The requested resource could not be found."
}Authorizations
Authenticate with an API access token in the Authorization header: Authorization: Bearer <token>. Create a token from the API Access Tokens page in Contractors Cloud, under Integrations.
Path Parameters
The id of the user, or the literal me to reference the currently authenticated user.
Query Parameters
Comma-separated related resources to embed. Allowed: user_level, default_company, project_list_setting, extended_properties.
Comma-separated computed attributes to include. Allowed: home_page, project_page, is_password_set, needs_onboarding, two_factor_setup_status.
Response
The requested user.
The user's unique identifier.
1159
The id of your organization's account.
1
The id of the company selected as this user's default company. References a company in your organization.
6
The id of the user's permission level (role), which determines the pages, reports, and actions the user can access. Can be null if no level has been assigned.
4
The user's email address, used to log in. Kept in sync with username — the two are always identical.
"jane.doe@example.com"
The user's login username. Kept in sync with email — the two are always identical.
"jane.doe@example.com"
The user's first name.
"Jane"
The user's last name. Can be null for legacy user records.
"Doe"
The user's initials, typically derived from their first and last name. Can be null if not set.
"JD"
The user's job title within your organization. Can be null if not set.
"Operations Manager"
Hex color code used to visually represent the user throughout the app, for example on calendar and schedule views. Can be null if not set.
"#0a7d2c"
The IANA time zone identifier (for example America/Chicago) used to display dates and times for this user. Can be null if not set.
"America/Chicago"
The date the user started with your organization, formatted as YYYY-MM-DD. Can be null if not recorded.
"2019-06-03"
The date the user was terminated, formatted as YYYY-MM-DD. Null while the user remains active.
null
Whether the user's account is active. Inactive users cannot authenticate.
true
The user's home phone number. Null if not provided.
The user's cell phone number. Null if not provided.
"(555) 100-2048"
The user's direct work phone number. Null if not provided.
Extension for the user's direct phone number. Null if not applicable.
The street portion of the user's address. Null if not provided.
The city portion of the user's address. Null if not provided.
The two-letter state or province code for the user's address. Can be null if not provided.
"WI"
The postal code for the user's address. Null if not provided.
The user's tax identification number, used for subcontractor reporting. Null if not provided.
How the user is employed by your organization. 0 = not set, 1 = employee, 2 = 1099/vendor (independent contractor).
0, 1, 2 1
Free-form notes about the user. Null if not set.
The UI color theme the user has selected for the app (for example charcoal). Can be null if the user hasn't chosen one.
"charcoal"
URL of the user's avatar thumbnail image. Can be null if the user hasn't uploaded a profile photo.
"https://cdn.contractorscloud.com/users/1159/thumb.jpeg"
The date the user's auto insurance was last verified, formatted as YYYY-MM-DD. Null if not tracked.
The user's high score for the current day in the app's Game Mode feature.
0
The user's all-time cumulative score in the app's Game Mode feature.
0