List defects
curl --request GET \
--url https://api.buildpass.global/builders/{builderId}/defects \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.buildpass.global/builders/{builderId}/defects"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.buildpass.global/builders/{builderId}/defects', 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.buildpass.global/builders/{builderId}/defects",
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.buildpass.global/builders/{builderId}/defects"
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.buildpass.global/builders/{builderId}/defects")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.buildpass.global/builders/{builderId}/defects")
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{
"data": [
{
"id": "defect_extapidefect01",
"builderId": "buil_clgbsb90b001qjy0f0eo1hspp",
"projectId": "proj_clgbsb90b001qjy0f0eo1hscp",
"projectName": "Downtown Mall Construction",
"number": 1,
"title": "Damaged wall finish",
"description": "Repair the damaged wall finish on Level 1.",
"status": "TO_DO",
"priority": "LOW",
"type": "BUILDER_DEFECT",
"dueDate": "2023-11-07T05:31:56Z",
"tags": [
"<string>"
],
"location": {
"id": "loc_extapiprojectlocation01",
"name": "Level 1",
"parentId": "loc_extapiprojectlocation00"
},
"assigner": {
"id": "user_clgbsb90b001qjy0f0eo1hsau",
"name": "Alex Builder"
},
"assignees": [
{
"type": "USER",
"id": "wkr_fsf1r0nqlcirkxlz1gzbw7oh",
"name": "John Smith"
}
],
"attachments": [
{
"id": "extapidefectattachment01",
"fileName": "defect-photo.jpg",
"contentType": "image/jpeg",
"url": "<string>"
}
],
"distributedAt": "2023-11-07T05:31:56Z",
"completedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"meta": {
"totalCount": 100,
"totalPages": 4,
"offset": 0,
"limit": 25
}
}{
"errors": [
{
"fieldName": "name",
"message": "This field is required."
}
]
}Defects
List defects
List defects for a builder. Archived defects are excluded by default. Results are paginated with a default and maximum limit of 25.
GET
/
builders
/
{builderId}
/
defects
List defects
curl --request GET \
--url https://api.buildpass.global/builders/{builderId}/defects \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.buildpass.global/builders/{builderId}/defects"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.buildpass.global/builders/{builderId}/defects', 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.buildpass.global/builders/{builderId}/defects",
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.buildpass.global/builders/{builderId}/defects"
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.buildpass.global/builders/{builderId}/defects")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.buildpass.global/builders/{builderId}/defects")
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{
"data": [
{
"id": "defect_extapidefect01",
"builderId": "buil_clgbsb90b001qjy0f0eo1hspp",
"projectId": "proj_clgbsb90b001qjy0f0eo1hscp",
"projectName": "Downtown Mall Construction",
"number": 1,
"title": "Damaged wall finish",
"description": "Repair the damaged wall finish on Level 1.",
"status": "TO_DO",
"priority": "LOW",
"type": "BUILDER_DEFECT",
"dueDate": "2023-11-07T05:31:56Z",
"tags": [
"<string>"
],
"location": {
"id": "loc_extapiprojectlocation01",
"name": "Level 1",
"parentId": "loc_extapiprojectlocation00"
},
"assigner": {
"id": "user_clgbsb90b001qjy0f0eo1hsau",
"name": "Alex Builder"
},
"assignees": [
{
"type": "USER",
"id": "wkr_fsf1r0nqlcirkxlz1gzbw7oh",
"name": "John Smith"
}
],
"attachments": [
{
"id": "extapidefectattachment01",
"fileName": "defect-photo.jpg",
"contentType": "image/jpeg",
"url": "<string>"
}
],
"distributedAt": "2023-11-07T05:31:56Z",
"completedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"meta": {
"totalCount": 100,
"totalPages": 4,
"offset": 0,
"limit": 25
}
}{
"errors": [
{
"fieldName": "name",
"message": "This field is required."
}
]
}Requires
read:defects. Returns defects for the authenticated builder with
project, location, assigner, assignee, and signed attachment data. Defect IDs
use the defect_ prefix, and project location IDs use the loc_ prefix.
Assignees are exposed as USER (wkr_ or user_ IDs), COMPANY (sub_
IDs), or TAG (tag_ IDs); assigner IDs use the user_ prefix. Supply the
prefixed project location ID when filtering with locationId.Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Path Parameters
Example:
"buil_clgbsb90b001qjy0f0eo1hspp"
Query Parameters
Filter by a proj_-prefixed project ID
Example:
"proj_clgbsb90b001qjy0f0eo1hscp"
Filter by defect status. Repeat the parameter for multiple values.
Available options:
TO_DO, IN_PROGRESS, WAITING_REVIEW, BLOCKED, RESOLVED, CANCELLED Filter by defect priority. Repeat the parameter for multiple values.
Available options:
LOW, MEDIUM, HIGH, CRITICAL Filter by a loc_-prefixed project location ID
Example:
"loc_extapiprojectlocation01"
The number of items to skip before starting to collect the result set
Example:
0
The number of items to return.
Required range:
x <= 25Example:
25