Manage goal relationships
curl --request POST \
--url https://api.meetsquad.ai/organisations/{orgId}/workspaces/{workspaceId}/outcomes/{outcomeId}/relationships/{action} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"opportunityIds": [
"a1b2c3d4-e5f6-4a5b-8c9d-0e1f2a3b4c5d"
],
"metricIds": [
"a1b2c3d4-e5f6-4a5b-8c9d-0e1f2a3b4c5d"
]
}
'import requests
url = "https://api.meetsquad.ai/organisations/{orgId}/workspaces/{workspaceId}/outcomes/{outcomeId}/relationships/{action}"
payload = {
"opportunityIds": ["a1b2c3d4-e5f6-4a5b-8c9d-0e1f2a3b4c5d"],
"metricIds": ["a1b2c3d4-e5f6-4a5b-8c9d-0e1f2a3b4c5d"]
}
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({
opportunityIds: ['a1b2c3d4-e5f6-4a5b-8c9d-0e1f2a3b4c5d'],
metricIds: ['a1b2c3d4-e5f6-4a5b-8c9d-0e1f2a3b4c5d']
})
};
fetch('https://api.meetsquad.ai/organisations/{orgId}/workspaces/{workspaceId}/outcomes/{outcomeId}/relationships/{action}', 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.meetsquad.ai/organisations/{orgId}/workspaces/{workspaceId}/outcomes/{outcomeId}/relationships/{action}",
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([
'opportunityIds' => [
'a1b2c3d4-e5f6-4a5b-8c9d-0e1f2a3b4c5d'
],
'metricIds' => [
'a1b2c3d4-e5f6-4a5b-8c9d-0e1f2a3b4c5d'
]
]),
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.meetsquad.ai/organisations/{orgId}/workspaces/{workspaceId}/outcomes/{outcomeId}/relationships/{action}"
payload := strings.NewReader("{\n \"opportunityIds\": [\n \"a1b2c3d4-e5f6-4a5b-8c9d-0e1f2a3b4c5d\"\n ],\n \"metricIds\": [\n \"a1b2c3d4-e5f6-4a5b-8c9d-0e1f2a3b4c5d\"\n ]\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.meetsquad.ai/organisations/{orgId}/workspaces/{workspaceId}/outcomes/{outcomeId}/relationships/{action}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"opportunityIds\": [\n \"a1b2c3d4-e5f6-4a5b-8c9d-0e1f2a3b4c5d\"\n ],\n \"metricIds\": [\n \"a1b2c3d4-e5f6-4a5b-8c9d-0e1f2a3b4c5d\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meetsquad.ai/organisations/{orgId}/workspaces/{workspaceId}/outcomes/{outcomeId}/relationships/{action}")
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 \"opportunityIds\": [\n \"a1b2c3d4-e5f6-4a5b-8c9d-0e1f2a3b4c5d\"\n ],\n \"metricIds\": [\n \"a1b2c3d4-e5f6-4a5b-8c9d-0e1f2a3b4c5d\"\n ]\n}"
response = http.request(request)
puts response.read_bodyGoals
Manage goal relationships
Add or remove relationships between a goal and other entities (opportunities, metrics, solutions, or insight)
POST
/
organisations
/
{orgId}
/
workspaces
/
{workspaceId}
/
outcomes
/
{outcomeId}
/
relationships
/
{action}
Manage goal relationships
curl --request POST \
--url https://api.meetsquad.ai/organisations/{orgId}/workspaces/{workspaceId}/outcomes/{outcomeId}/relationships/{action} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"opportunityIds": [
"a1b2c3d4-e5f6-4a5b-8c9d-0e1f2a3b4c5d"
],
"metricIds": [
"a1b2c3d4-e5f6-4a5b-8c9d-0e1f2a3b4c5d"
]
}
'import requests
url = "https://api.meetsquad.ai/organisations/{orgId}/workspaces/{workspaceId}/outcomes/{outcomeId}/relationships/{action}"
payload = {
"opportunityIds": ["a1b2c3d4-e5f6-4a5b-8c9d-0e1f2a3b4c5d"],
"metricIds": ["a1b2c3d4-e5f6-4a5b-8c9d-0e1f2a3b4c5d"]
}
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({
opportunityIds: ['a1b2c3d4-e5f6-4a5b-8c9d-0e1f2a3b4c5d'],
metricIds: ['a1b2c3d4-e5f6-4a5b-8c9d-0e1f2a3b4c5d']
})
};
fetch('https://api.meetsquad.ai/organisations/{orgId}/workspaces/{workspaceId}/outcomes/{outcomeId}/relationships/{action}', 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.meetsquad.ai/organisations/{orgId}/workspaces/{workspaceId}/outcomes/{outcomeId}/relationships/{action}",
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([
'opportunityIds' => [
'a1b2c3d4-e5f6-4a5b-8c9d-0e1f2a3b4c5d'
],
'metricIds' => [
'a1b2c3d4-e5f6-4a5b-8c9d-0e1f2a3b4c5d'
]
]),
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.meetsquad.ai/organisations/{orgId}/workspaces/{workspaceId}/outcomes/{outcomeId}/relationships/{action}"
payload := strings.NewReader("{\n \"opportunityIds\": [\n \"a1b2c3d4-e5f6-4a5b-8c9d-0e1f2a3b4c5d\"\n ],\n \"metricIds\": [\n \"a1b2c3d4-e5f6-4a5b-8c9d-0e1f2a3b4c5d\"\n ]\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.meetsquad.ai/organisations/{orgId}/workspaces/{workspaceId}/outcomes/{outcomeId}/relationships/{action}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"opportunityIds\": [\n \"a1b2c3d4-e5f6-4a5b-8c9d-0e1f2a3b4c5d\"\n ],\n \"metricIds\": [\n \"a1b2c3d4-e5f6-4a5b-8c9d-0e1f2a3b4c5d\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meetsquad.ai/organisations/{orgId}/workspaces/{workspaceId}/outcomes/{outcomeId}/relationships/{action}")
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 \"opportunityIds\": [\n \"a1b2c3d4-e5f6-4a5b-8c9d-0e1f2a3b4c5d\"\n ],\n \"metricIds\": [\n \"a1b2c3d4-e5f6-4a5b-8c9d-0e1f2a3b4c5d\"\n ]\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
JWT authentication for organization-scoped endpoints.
Path Parameters
Organization ID
Workspace ID
Outcome ID
Action to perform on relationships
Available options:
add, remove Body
application/json
Response
Relationships successfully modified
⌘I