/failures
This endpoint allows you to create a Failure.
problem_id: refers to the type of problem. First, you need to retrieve the problem areas (GET /problems). Then, list the sub-problems from the desired area (GET /problems/{problem_id}/subproblems) and, from the response, use the respective problem_id.local_id: refers to the location (GET /locations) related to the Failure. It can't be of type "building" neither "location-folder", this is, only of type "location".createFailure
Content-Type: application/json
· Required fields: client_id, problem_id, priority, local_id
problem_id
integer
required
ID of the associated problem. Refers to the type of Problem and need to be a Problem Type, not a Problem Area. To get the Problem Types, first, you need to retrieve the Problem Areas (GET `/problems`). Then, list the Problem Types from the desired area (GET `/problems/{problem_id}/subproblems`) and, from the response, use the respective `problem_id`.
description
string
A more detailed description of the reported incident.
Example: The bathroom light needs replacement
observations
string
A longer description or anything with longer text that needs to be reported.
priority
integer
required
Failure priority number, being 1 the lowest priority and 4 the highest priority.
1
2
3
4
client_id
integer
required
ID of the client associated to the Failure
local_id
integer
required
ID of the location associated to the Failure
operator_id
integer
write-only
ID of the operator that owns the Failure. By default, uses the ID of the Operator associated to the API token.
report_type
string
Type of the Failure's reporter. The failure can be reported by an Operator or by a Contact.
contact
operator
report_id
integer
write-only
ID of the operator or contact who reported the Failure
supplier_id
integer
ID of the supplier associated to the Failure
gatekeeper_id
integer
ID for the associated Gatekeeper
cost_center_id
integer
ID of the associated CostCenter
include_automatic_assignees
boolean
If is to append automatic assignees when a user select a custom list of assignees
data
object
Failure model structure details
id
string
required
read-only
ID of the Failure
type
string
required
read-only
Model type
failure
attributes
object
required
failure_id
integer
read-only
ID of the Failure
Example: 1
uuid
string (uuid)
read-only
Universally Unique Identifier for the Failure
problem_id
integer
ID of the associated problem
status
string
read-only
WAITING_APPROVAL
WAITING_RESOLUTION
IN_RESOLUTION
PAUSED
COMPLETED
ARCHIVED
start_date
string (date-time)
read-only
Example: 2020-08-28T08:48:00.000Z
completed_date
string (date-time) | null
read-only
Example: 2020-08-28T17:12:00.000Z
approved_date
string (date-time) | null
read-only
Example: 2020-08-28T09:30:00.000Z
paused_date
string (date-time) | null
read-only
Example: 2020-08-28T13:05:00.000Z
description
string
Example: Needs replacement
last_status_description
string
Example: Completed
observations
string | null
Example: Needs a new part
code
string
Example: WO2022
fts_vector
string
Denormalized data of a Failure
priority
integer
Failure priority number being 1 the lowest priority and 4 the highest priority.
1
2
3
4
client_id
integer
read-only
ID of the associated client defined according to the respective `local_id`.
entity_id
integer
read-only
ID of the Entity of the Failure
metering_registry_id
integer | null
read-only
ID of a possible associated metering registry
local_id
integer
ID of the location associated to the Failure
paused_reason_id
integer
ID of the paused reason associated to the Failure
external_id
string | null
External ID to be associated to the Failure
report_name
string
Name of who reported the Failure
solved
boolean
read-only
Indicates whether the Failure was closed successfully or not
confirmed
boolean
read-only
Indicates whether the Failure is confirmed or not
started
boolean
read-only
Indicates whether the Failure is started or not
paused
boolean
read-only
Indicates whether the Failure is paused or not
completed
boolean
read-only
Indicates whether the Failure is completed or not
archived
boolean
read-only
Indicates whether the Failure is archived or not
approved
boolean
read-only
Indicates whether the Failure is approved or not
next_schedule
string (date-time) | null
read-only
Example: 2020-08-29T10:30:00.000Z
message_count
integer
Example: 3
time_statistics
object
approved_date
string (date-time) | null
read-only
Example: 2020-08-28T09:30:00.000Z
last_completed_date
string (date-time) | null
read-only
Example: 2020-08-28T17:12:00.000Z
last_paused_date
string (date-time) | null
read-only
Example: 2020-08-28T13:05:00.000Z
started_date
string (date-time) | null
read-only
Example: 2020-08-28T09:45:00.000Z
time_to_approve
string | null
read-only
Duration it took to approve the Failure since reported in `ISO8601` format.
Example: P0Y0M0DT0H42M0S
time_to_complete
string | null
read-only
Duration it took to complete the Failure since reported in `ISO8601` format.
Example: P0Y0M0DT8H24M0S
time_to_complete_after_started
string | null
read-only
Duration it took to complete the Failure since the resolution started in `ISO8601` format.
Example: P0Y0M0DT7H27M0S
time_to_start
string | null
read-only
Duration it took to start the Failure's resolution since reported in `ISO8601` format.
Example: P0Y0M0DT0H57M0S
time_to_start_after_approved
string | null
read-only
Duration it took to start the Failure's resolution since approved in `ISO8601` format.
Example: P0Y0M0DT0H15M0S
real_duration
string | null
read-only
Real duration of the Failure's resolution time in `ISO8601` format.
Example: P0Y0M0DT7H27M0S
supplier_id
integer
ID of the supplier associated to the Failure
signature_status
string
Indicates whether the Failure is signed or not
SIGNED
NOT_SIGNED
last_status_change_date
string (date-time)
read-only
Example: 2020-08-28T09:30:00.000Z
approved_by_id
integer | null
read-only
ID of the operator who approved the Failure.
completed_by_id
integer | null
read-only
ID of the operator who completed the Failure.
started_by_id
integer | null
read-only
ID of the operator who started the Failure's resolution.
paused_by_id
integer | null
read-only
ID of the operator who paused the Failure's resolution.
approved_by
string | null
read-only
Name of the operator who approved the Failure.
completed_by
string | null
read-only
Name of the operator who completed the Failure.
started_by
string | null
read-only
Name of the operator who started the Failure's resolution.
paused_by
string | null
read-only
Name of the operator who paused the Failure's resolution.
reported_by
string | null
read-only
Name of the operator who reported the Failure.
manpower_duration
string | null
read-only
Duration of the Failure's manpower time in `ISO8601` format.
Example: P0Y0M0DT7H27M0S
cost_center_id
integer | null
ID of the cost center associated to the Failure
network_failure_id
integer
read-only
ID of the Network Failure
Example: 1
created_at
string (date-time)
read-only
updated_at
string (date-time)
read-only
date_deleted
string (date-time)
read-only
relationships
object
approvedBy
object
data
object
type
string
read-only
operator
id
string
read-only
completedBy
object
data
object
type
string
read-only
operator
id
string
read-only
createdBy
object
data
object
type
string
read-only
operator
id
string
read-only
files
object
data
array<object>
type
string
read-only
file
id
string
read-only
location
object
data
object
type
string
read-only
location
id
string
read-only
operator
object
data
object
type
string
read-only
operator
id
string
read-only
status
string
error
error
object
properties
object
Only present when related to property validation error
dev_message
string
Example: Property validation error. Check the "properties" section in the response.
http_code
integer
400
message
string
Example: Property validation error.
more_info
string
status
string
error
error
object
http_code
integer
401
message
string
Example: Authentication token invalid.
more_info
string
status
string
error
error
object
http_code
integer
403
message
string
Example: Action unauthorized
more_info
string
status
string
error
error
object
http_code
integer
429
message
string
Example: Too Many Requests.
more_info
string
status
string
error
error
object
http_code
integer
500
message
string
Example: An error has occurred during the request.
more_info
string
curl -X POST \
'https://api.sandbox.infraspeak.com/v3/failures' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_API_TOKEN' \
-d '{
"problem_id": 0,
"description": "The bathroom light needs replacement",
"observations": "",
"priority": 0,
"client_id": 0,
"local_id": 0,
"operator_id": 0,
"report_type": "",
"report_id": 0,
"supplier_id": 0,
"gatekeeper_id": 0,
"cost_center_id": 0,
"include_automatic_assignees": false
}'
const response = await fetch('https://api.sandbox.infraspeak.com/v3/failures', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_TOKEN',
},
body: JSON.stringify({
"problem_id": 0,
"description": "The bathroom light needs replacement",
"observations": "",
"priority": 0,
"client_id": 0,
"local_id": 0,
"operator_id": 0,
"report_type": "",
"report_id": 0,
"supplier_id": 0,
"gatekeeper_id": 0,
"cost_center_id": 0,
"include_automatic_assignees": false
}),
});
const data = await response.json();
$response = Http::withHeaders([
'Accept' => 'application/json',
'Content-Type' => 'application/json',
])->withToken('YOUR_API_TOKEN')
->post('https://api.sandbox.infraspeak.com/v3/failures',
array (
'problem_id' => 0,
'description' => 'The bathroom light needs replacement',
'observations' => '',
'priority' => 0,
'client_id' => 0,
'local_id' => 0,
'operator_id' => 0,
'report_type' => '',
'report_id' => 0,
'supplier_id' => 0,
'gatekeeper_id' => 0,
'cost_center_id' => 0,
'include_automatic_assignees' => false,
)
);
import requests
response = requests.post(
'https://api.sandbox.infraspeak.com/v3/failures',
headers={
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_TOKEN',
},
json={
{
"problem_id": 0,
"description": "The bathroom light needs replacement",
"observations": "",
"priority": 0,
"client_id": 0,
"local_id": 0,
"operator_id": 0,
"report_type": "",
"report_id": 0,
"supplier_id": 0,
"gatekeeper_id": 0,
"cost_center_id": 0,
"include_automatic_assignees": false
}
},
)
data = response.json()