Add a party
Needs: Incidents, Read-write
Adds a witness or an involved party on the Parties tab. Staff and clients are added by id. Family and other people need a name and phone. Site incidents only take the site's staff and participants.
Note: The
asvalue in the response is the stored party type. For involved staff, clients and family, the type is set from the role.
curl -X POST "https://app.imploy.com.au/api/integrations/v1/incidents/123/parties" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-d '{
"as": "witness",
"role": "staff",
"staff_id": 31,
"type": "Primary Witness"
}'
import requests
import json
url = "https://app.imploy.com.au/api/integrations/v1/incidents/123/parties"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
}
data = {
"as": "witness",
"role": "staff",
"staff_id": 31,
"type": "Primary Witness"
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://app.imploy.com.au/api/integrations/v1/incidents/123/parties", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
},
body: JSON.stringify({
"as": "witness",
"role": "staff",
"staff_id": 31,
"type": "Primary Witness"
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"as": "witness",
"role": "staff",
"staff_id": 31,
"type": "Primary Witness"
}`)
req, err := http.NewRequest("POST", "https://app.imploy.com.au/api/integrations/v1/incidents/123/parties", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://app.imploy.com.au/api/integrations/v1/incidents/123/parties')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request['Authorization'] = 'Bearer YOUR_API_TOKEN'
request.body = '{
"as": "witness",
"role": "staff",
"staff_id": 31,
"type": "Primary Witness"
}'
response = http.request(request)
puts response.body
{
"created": 8,
"incident_id": 12,
"kind": "incident",
"as": "witness"
}
{
"message": "Invalid or expired access token."
}
{
"message": "Access token does not permit this action."
}
{
"message": "Too many requests."
}
/incidents/{incident_id}/partiesTarget server for requests. Edit to use your own host.
An organisation access token that starts with imp_at_. Send it as Authorization: Bearer imp_at_XXXX.
imp_at_. Send it as Authorization: Bearer imp_at_XXXX.The incident id.
The media type of the request body
witness or involved_party.
staff, client, family or other.
For role staff.
For role client.
For roles family and other.
For roles family and other.
Optional email.
For witnesses: Primary Witness or Witness (default Witness). For other involved parties: how they are involved.
Contacted, Pending or Not Contacted.
Notes about the person.
Request Preview
Response
Response will appear here after sending the request
Authentication
Bearer token. An organisation access token that starts with imp_at_. Send it as Authorization: Bearer imp_at_XXXX.
Path Parameters
The incident id.
Body
witness or involved_party.
staff, client, family or other.
For role staff.
For role client.
For roles family and other.
For roles family and other.
Optional email.
For witnesses: Primary Witness or Witness (default Witness). For other involved parties: how they are involved.
Contacted, Pending or Not Contacted.
Notes about the person.