Set gross area for many buildings, asynchronously
Audience: org-service-account
Accepts 1 to 1,000 buildings of the org in the path and returns immediately. Poll the returned statusUrl (also the Location header). Each buildingId may appear once, and an item names no org (the org is the path's). One background job is started for the org.
Request
POST https://api.mapped.com/v1/accounts/{accountId}/orgs/{orgId}/buildings/gross-area:batch
Parameters
| Name | In | Required | Type | Constraints | Description |
|---|---|---|---|---|---|
accountId | path | yes | string | ||
orgId | path | yes | string |
Request body
The request body is required.
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
items | array of object | yes | minItems 1, maxItems 1000 | |
items[].buildingId | string | yes | pattern ^[A-Za-z0-9_.-]{1,128}$ | |
items[].grossArea | number | yes | minimum 0 | Square feet. 0 is valid. |
items[].orgId | Not allowed | no | Not allowed: the org is the path's. | |
createConnector | boolean | no | default false | Allow creating the admin-center connector if the org has none. |
Example
curl -X POST 'https://api.mapped.com/v1/accounts/{accountId}/orgs/{orgId}/buildings/gross-area:batch' \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
-d '{"items":[{"buildingId":"bld_1","grossArea":52000},{"buildingId":"bld_2","grossArea":18500}]}'
Responses
202
Accepts 1 to 1,000 buildings of the org in the path and returns immediately. Poll the returned statusUrl (also the Location header). Each buildingId may appear once, and an item names no org (the org is the path's). One background job is started for the org.
See the example above.
400
Nothing was started: items is not an array of 1 to 1,000 (invalid_items), an item is malformed or names an orgId (invalid_item), a buildingId repeats (duplicate_item), createConnector is not a boolean (invalid_create_connector), or the body is not a JSON object, is malformed, or is not application/json (bad_request).
Example error code: invalid_items
{
"code": "invalid_items",
"error": "items must be an array of 1 to 1000 entries",
"success": false
}
401
No valid bearer token: missing_token (no Authorization: Bearer header), invalid_token or token_expired.
Example error code: invalid_token
{
"code": "invalid_token",
"error": "Invalid bearer token",
"success": false
}
403
Not a credential for this org and account, or not an account-org-level service-account credential. Nothing was read or changed.
Error code: forbidden
{
"code": "forbidden",
"error": "Org does not belong to this account",
"success": false
}
413
A JSON body over 1,000,000 bytes is bad_request in this envelope. A body over 1 MiB (1,048,576 bytes) is refused earlier by the server, in its own shape ({ "code": "PAYLOAD_TOO_LARGE", ... }).
Error code: bad_request
{
"code": "bad_request",
"error": "Bad request",
"success": false
}
429
Too many requests, or too many batches or updates started; see Retry-After.
Error code: rate_limited
{
"code": "rate_limited",
"error": "Too many batches started; try again shortly",
"success": false
}
502
The job could not be started and was cancelled; some updates may already have been applied.
Error code: jobs_unavailable
{
"code": "jobs_unavailable",
"error": "The batch could not be started and was cancelled; some updates may already have been applied",
"success": false
}
503
Batches and updates are not available right now (batches_unavailable, jobs_unavailable), or a check this API depends on is unavailable (upstream_unavailable); retry.
Example error code: batches_unavailable
{
"code": "batches_unavailable",
"error": "Batches are temporarily unavailable; try again shortly",
"success": false
}