Sync a photo report
curl --request POST \
--url https://api.buildpass.global/builders/{builderId}/photo-reports/sync \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sourceApp": "<string>",
"sourceExternalId": "<string>",
"sourceRevision": 1073741824,
"sourceCreatedAt": "2023-11-07T05:31:56Z",
"walkthroughDate": "2023-11-07T05:31:56Z",
"sourceAuthor": {
"externalId": "<string>",
"name": "<string>",
"email": "jsmith@example.com"
},
"page": {
"schemaVersion": 1,
"title": "<string>",
"blocks": [
{
"sourceBlockId": "<string>",
"type": "TEXT",
"properties": {},
"richText": [
{
"text": "<string>",
"marks": []
}
]
}
],
"shortDescription": "<string>",
"contentMetadata": {},
"sharingMetadata": {}
},
"mappedAdminUserId": "<string>",
"sourceDeepLink": "<string>",
"projectId": "<string>"
}
'import requests
url = "https://api.buildpass.global/builders/{builderId}/photo-reports/sync"
payload = {
"sourceApp": "<string>",
"sourceExternalId": "<string>",
"sourceRevision": 1073741824,
"sourceCreatedAt": "2023-11-07T05:31:56Z",
"walkthroughDate": "2023-11-07T05:31:56Z",
"sourceAuthor": {
"externalId": "<string>",
"name": "<string>",
"email": "jsmith@example.com"
},
"page": {
"schemaVersion": 1,
"title": "<string>",
"blocks": [
{
"sourceBlockId": "<string>",
"type": "TEXT",
"properties": {},
"richText": [
{
"text": "<string>",
"marks": []
}
]
}
],
"shortDescription": "<string>",
"contentMetadata": {},
"sharingMetadata": {}
},
"mappedAdminUserId": "<string>",
"sourceDeepLink": "<string>",
"projectId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
sourceApp: '<string>',
sourceExternalId: '<string>',
sourceRevision: 1073741824,
sourceCreatedAt: '2023-11-07T05:31:56Z',
walkthroughDate: '2023-11-07T05:31:56Z',
sourceAuthor: {externalId: '<string>', name: '<string>', email: 'jsmith@example.com'},
page: {
schemaVersion: 1,
title: '<string>',
blocks: [
{
sourceBlockId: '<string>',
type: 'TEXT',
properties: {},
richText: [{text: '<string>', marks: []}]
}
],
shortDescription: '<string>',
contentMetadata: {},
sharingMetadata: {}
},
mappedAdminUserId: '<string>',
sourceDeepLink: '<string>',
projectId: '<string>'
})
};
fetch('https://api.buildpass.global/builders/{builderId}/photo-reports/sync', 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}/photo-reports/sync",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'sourceApp' => '<string>',
'sourceExternalId' => '<string>',
'sourceRevision' => 1073741824,
'sourceCreatedAt' => '2023-11-07T05:31:56Z',
'walkthroughDate' => '2023-11-07T05:31:56Z',
'sourceAuthor' => [
'externalId' => '<string>',
'name' => '<string>',
'email' => 'jsmith@example.com'
],
'page' => [
'schemaVersion' => 1,
'title' => '<string>',
'blocks' => [
[
'sourceBlockId' => '<string>',
'type' => 'TEXT',
'properties' => [
],
'richText' => [
[
'text' => '<string>',
'marks' => [
]
]
]
]
],
'shortDescription' => '<string>',
'contentMetadata' => [
],
'sharingMetadata' => [
]
],
'mappedAdminUserId' => '<string>',
'sourceDeepLink' => '<string>',
'projectId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.buildpass.global/builders/{builderId}/photo-reports/sync"
payload := strings.NewReader("{\n \"sourceApp\": \"<string>\",\n \"sourceExternalId\": \"<string>\",\n \"sourceRevision\": 1073741824,\n \"sourceCreatedAt\": \"2023-11-07T05:31:56Z\",\n \"walkthroughDate\": \"2023-11-07T05:31:56Z\",\n \"sourceAuthor\": {\n \"externalId\": \"<string>\",\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\"\n },\n \"page\": {\n \"schemaVersion\": 1,\n \"title\": \"<string>\",\n \"blocks\": [\n {\n \"sourceBlockId\": \"<string>\",\n \"type\": \"TEXT\",\n \"properties\": {},\n \"richText\": [\n {\n \"text\": \"<string>\",\n \"marks\": []\n }\n ]\n }\n ],\n \"shortDescription\": \"<string>\",\n \"contentMetadata\": {},\n \"sharingMetadata\": {}\n },\n \"mappedAdminUserId\": \"<string>\",\n \"sourceDeepLink\": \"<string>\",\n \"projectId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.buildpass.global/builders/{builderId}/photo-reports/sync")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sourceApp\": \"<string>\",\n \"sourceExternalId\": \"<string>\",\n \"sourceRevision\": 1073741824,\n \"sourceCreatedAt\": \"2023-11-07T05:31:56Z\",\n \"walkthroughDate\": \"2023-11-07T05:31:56Z\",\n \"sourceAuthor\": {\n \"externalId\": \"<string>\",\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\"\n },\n \"page\": {\n \"schemaVersion\": 1,\n \"title\": \"<string>\",\n \"blocks\": [\n {\n \"sourceBlockId\": \"<string>\",\n \"type\": \"TEXT\",\n \"properties\": {},\n \"richText\": [\n {\n \"text\": \"<string>\",\n \"marks\": []\n }\n ]\n }\n ],\n \"shortDescription\": \"<string>\",\n \"contentMetadata\": {},\n \"sharingMetadata\": {}\n },\n \"mappedAdminUserId\": \"<string>\",\n \"sourceDeepLink\": \"<string>\",\n \"projectId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.buildpass.global/builders/{builderId}/photo-reports/sync")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"sourceApp\": \"<string>\",\n \"sourceExternalId\": \"<string>\",\n \"sourceRevision\": 1073741824,\n \"sourceCreatedAt\": \"2023-11-07T05:31:56Z\",\n \"walkthroughDate\": \"2023-11-07T05:31:56Z\",\n \"sourceAuthor\": {\n \"externalId\": \"<string>\",\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\"\n },\n \"page\": {\n \"schemaVersion\": 1,\n \"title\": \"<string>\",\n \"blocks\": [\n {\n \"sourceBlockId\": \"<string>\",\n \"type\": \"TEXT\",\n \"properties\": {},\n \"richText\": [\n {\n \"text\": \"<string>\",\n \"marks\": []\n }\n ]\n }\n ],\n \"shortDescription\": \"<string>\",\n \"contentMetadata\": {},\n \"sharingMetadata\": {}\n },\n \"mappedAdminUserId\": \"<string>\",\n \"sourceDeepLink\": \"<string>\",\n \"projectId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": "synced",
"idempotent": true,
"photoReportId": "<string>",
"pageId": "<string>",
"sourceRevision": 1073741824
}{
"code": "STALE_REVISION",
"message": "<string>"
}Photos
Sync a photo report
Creates or updates a photo report in BuildPass, including its title, text, photos and optional project. Use this endpoint to keep reports from your application in sync with BuildPass.
POST
/
builders
/
{builderId}
/
photo-reports
/
sync
Sync a photo report
curl --request POST \
--url https://api.buildpass.global/builders/{builderId}/photo-reports/sync \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sourceApp": "<string>",
"sourceExternalId": "<string>",
"sourceRevision": 1073741824,
"sourceCreatedAt": "2023-11-07T05:31:56Z",
"walkthroughDate": "2023-11-07T05:31:56Z",
"sourceAuthor": {
"externalId": "<string>",
"name": "<string>",
"email": "jsmith@example.com"
},
"page": {
"schemaVersion": 1,
"title": "<string>",
"blocks": [
{
"sourceBlockId": "<string>",
"type": "TEXT",
"properties": {},
"richText": [
{
"text": "<string>",
"marks": []
}
]
}
],
"shortDescription": "<string>",
"contentMetadata": {},
"sharingMetadata": {}
},
"mappedAdminUserId": "<string>",
"sourceDeepLink": "<string>",
"projectId": "<string>"
}
'import requests
url = "https://api.buildpass.global/builders/{builderId}/photo-reports/sync"
payload = {
"sourceApp": "<string>",
"sourceExternalId": "<string>",
"sourceRevision": 1073741824,
"sourceCreatedAt": "2023-11-07T05:31:56Z",
"walkthroughDate": "2023-11-07T05:31:56Z",
"sourceAuthor": {
"externalId": "<string>",
"name": "<string>",
"email": "jsmith@example.com"
},
"page": {
"schemaVersion": 1,
"title": "<string>",
"blocks": [
{
"sourceBlockId": "<string>",
"type": "TEXT",
"properties": {},
"richText": [
{
"text": "<string>",
"marks": []
}
]
}
],
"shortDescription": "<string>",
"contentMetadata": {},
"sharingMetadata": {}
},
"mappedAdminUserId": "<string>",
"sourceDeepLink": "<string>",
"projectId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
sourceApp: '<string>',
sourceExternalId: '<string>',
sourceRevision: 1073741824,
sourceCreatedAt: '2023-11-07T05:31:56Z',
walkthroughDate: '2023-11-07T05:31:56Z',
sourceAuthor: {externalId: '<string>', name: '<string>', email: 'jsmith@example.com'},
page: {
schemaVersion: 1,
title: '<string>',
blocks: [
{
sourceBlockId: '<string>',
type: 'TEXT',
properties: {},
richText: [{text: '<string>', marks: []}]
}
],
shortDescription: '<string>',
contentMetadata: {},
sharingMetadata: {}
},
mappedAdminUserId: '<string>',
sourceDeepLink: '<string>',
projectId: '<string>'
})
};
fetch('https://api.buildpass.global/builders/{builderId}/photo-reports/sync', 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}/photo-reports/sync",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'sourceApp' => '<string>',
'sourceExternalId' => '<string>',
'sourceRevision' => 1073741824,
'sourceCreatedAt' => '2023-11-07T05:31:56Z',
'walkthroughDate' => '2023-11-07T05:31:56Z',
'sourceAuthor' => [
'externalId' => '<string>',
'name' => '<string>',
'email' => 'jsmith@example.com'
],
'page' => [
'schemaVersion' => 1,
'title' => '<string>',
'blocks' => [
[
'sourceBlockId' => '<string>',
'type' => 'TEXT',
'properties' => [
],
'richText' => [
[
'text' => '<string>',
'marks' => [
]
]
]
]
],
'shortDescription' => '<string>',
'contentMetadata' => [
],
'sharingMetadata' => [
]
],
'mappedAdminUserId' => '<string>',
'sourceDeepLink' => '<string>',
'projectId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.buildpass.global/builders/{builderId}/photo-reports/sync"
payload := strings.NewReader("{\n \"sourceApp\": \"<string>\",\n \"sourceExternalId\": \"<string>\",\n \"sourceRevision\": 1073741824,\n \"sourceCreatedAt\": \"2023-11-07T05:31:56Z\",\n \"walkthroughDate\": \"2023-11-07T05:31:56Z\",\n \"sourceAuthor\": {\n \"externalId\": \"<string>\",\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\"\n },\n \"page\": {\n \"schemaVersion\": 1,\n \"title\": \"<string>\",\n \"blocks\": [\n {\n \"sourceBlockId\": \"<string>\",\n \"type\": \"TEXT\",\n \"properties\": {},\n \"richText\": [\n {\n \"text\": \"<string>\",\n \"marks\": []\n }\n ]\n }\n ],\n \"shortDescription\": \"<string>\",\n \"contentMetadata\": {},\n \"sharingMetadata\": {}\n },\n \"mappedAdminUserId\": \"<string>\",\n \"sourceDeepLink\": \"<string>\",\n \"projectId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.buildpass.global/builders/{builderId}/photo-reports/sync")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sourceApp\": \"<string>\",\n \"sourceExternalId\": \"<string>\",\n \"sourceRevision\": 1073741824,\n \"sourceCreatedAt\": \"2023-11-07T05:31:56Z\",\n \"walkthroughDate\": \"2023-11-07T05:31:56Z\",\n \"sourceAuthor\": {\n \"externalId\": \"<string>\",\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\"\n },\n \"page\": {\n \"schemaVersion\": 1,\n \"title\": \"<string>\",\n \"blocks\": [\n {\n \"sourceBlockId\": \"<string>\",\n \"type\": \"TEXT\",\n \"properties\": {},\n \"richText\": [\n {\n \"text\": \"<string>\",\n \"marks\": []\n }\n ]\n }\n ],\n \"shortDescription\": \"<string>\",\n \"contentMetadata\": {},\n \"sharingMetadata\": {}\n },\n \"mappedAdminUserId\": \"<string>\",\n \"sourceDeepLink\": \"<string>\",\n \"projectId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.buildpass.global/builders/{builderId}/photo-reports/sync")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"sourceApp\": \"<string>\",\n \"sourceExternalId\": \"<string>\",\n \"sourceRevision\": 1073741824,\n \"sourceCreatedAt\": \"2023-11-07T05:31:56Z\",\n \"walkthroughDate\": \"2023-11-07T05:31:56Z\",\n \"sourceAuthor\": {\n \"externalId\": \"<string>\",\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\"\n },\n \"page\": {\n \"schemaVersion\": 1,\n \"title\": \"<string>\",\n \"blocks\": [\n {\n \"sourceBlockId\": \"<string>\",\n \"type\": \"TEXT\",\n \"properties\": {},\n \"richText\": [\n {\n \"text\": \"<string>\",\n \"marks\": []\n }\n ]\n }\n ],\n \"shortDescription\": \"<string>\",\n \"contentMetadata\": {},\n \"sharingMetadata\": {}\n },\n \"mappedAdminUserId\": \"<string>\",\n \"sourceDeepLink\": \"<string>\",\n \"projectId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": "synced",
"idempotent": true,
"photoReportId": "<string>",
"pageId": "<string>",
"sourceRevision": 1073741824
}{
"code": "STALE_REVISION",
"message": "<string>"
}Requires
write:photos.
Send the complete report’s title, text and image blocks in page. Upload photos using bulk upsert photos, then include the returned attachment IDs in the report.
Keep sourceExternalId the same for each report and increase sourceRevision when its content changes. Retry with the same revision and content; outdated or conflicting revisions return 409.
Use PATCH to update an existing report and DELETE to archive it. Send a newer revision with POST to restore an archived report.Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
FlowClient Credentials
- Token URL
- https://api.buildpass.global/oauth/token
Scopes1
write:photos
Create, update, delete, and sync photos and photo folders
Path Parameters
Body
application/json
Required string length:
1 - 80Required string length:
1 - 220Required range:
1 <= x <= 2147483647Minimum string length:
1Minimum string length:
1Show child attributes
Show child attributes
Authoritative snapshot. Maximum 500 blocks across the whole tree and four Page levels including root. Source block IDs are unique among siblings.
Show child attributes
Show child attributes
Minimum string length:
1Pattern:
^user_[a-z][a-z0-9]+$HTTPS or supasite URI with no credentials, query string or fragment.
Required string length:
1 - 1000Minimum string length:
1Pattern:
^proj_[a-z][a-z0-9]+$Response
Snapshot committed