Select Integration Property
curl --request POST \
--url https://api.example.com/integrations/{integrationType}/select-property \
--header 'Content-Type: application/json' \
--data '
{
"temporaryAccessToken": "<string>",
"propertyId": "<string>",
"externalUserIdentifier": "<string>"
}
'import requests
url = "https://api.example.com/integrations/{integrationType}/select-property"
payload = {
"temporaryAccessToken": "<string>",
"propertyId": "<string>",
"externalUserIdentifier": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
temporaryAccessToken: '<string>',
propertyId: '<string>',
externalUserIdentifier: '<string>'
})
};
fetch('https://api.example.com/integrations/{integrationType}/select-property', 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.example.com/integrations/{integrationType}/select-property",
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([
'temporaryAccessToken' => '<string>',
'propertyId' => '<string>',
'externalUserIdentifier' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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.example.com/integrations/{integrationType}/select-property"
payload := strings.NewReader("{\n \"temporaryAccessToken\": \"<string>\",\n \"propertyId\": \"<string>\",\n \"externalUserIdentifier\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.example.com/integrations/{integrationType}/select-property")
.header("Content-Type", "application/json")
.body("{\n \"temporaryAccessToken\": \"<string>\",\n \"propertyId\": \"<string>\",\n \"externalUserIdentifier\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/integrations/{integrationType}/select-property")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"temporaryAccessToken\": \"<string>\",\n \"propertyId\": \"<string>\",\n \"externalUserIdentifier\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"passthroughRedirectUri": "https://your-app.com/oauth/callback"
}
Integrations
Select Integration Property
Select a property for integrations that require it
POST
/
integrations
/
{integrationType}
/
select-property
Select Integration Property
curl --request POST \
--url https://api.example.com/integrations/{integrationType}/select-property \
--header 'Content-Type: application/json' \
--data '
{
"temporaryAccessToken": "<string>",
"propertyId": "<string>",
"externalUserIdentifier": "<string>"
}
'import requests
url = "https://api.example.com/integrations/{integrationType}/select-property"
payload = {
"temporaryAccessToken": "<string>",
"propertyId": "<string>",
"externalUserIdentifier": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
temporaryAccessToken: '<string>',
propertyId: '<string>',
externalUserIdentifier: '<string>'
})
};
fetch('https://api.example.com/integrations/{integrationType}/select-property', 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.example.com/integrations/{integrationType}/select-property",
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([
'temporaryAccessToken' => '<string>',
'propertyId' => '<string>',
'externalUserIdentifier' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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.example.com/integrations/{integrationType}/select-property"
payload := strings.NewReader("{\n \"temporaryAccessToken\": \"<string>\",\n \"propertyId\": \"<string>\",\n \"externalUserIdentifier\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.example.com/integrations/{integrationType}/select-property")
.header("Content-Type", "application/json")
.body("{\n \"temporaryAccessToken\": \"<string>\",\n \"propertyId\": \"<string>\",\n \"externalUserIdentifier\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/integrations/{integrationType}/select-property")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"temporaryAccessToken\": \"<string>\",\n \"propertyId\": \"<string>\",\n \"externalUserIdentifier\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"passthroughRedirectUri": "https://your-app.com/oauth/callback"
}
Select a specific property for integrations that require additional configuration after OAuth (e.g., Google Analytics).
URL Parameters
string
required
The type of integration. Currently supported:
google-analytics
Request
string
required
The temporary access token received from the callback
string
required
The ID of the property to select
string
required
Unique identifier for the user in your system
Response
boolean
Whether the property selection was successful
string
The redirect URI provided during connection
Example
curl -X POST https://suada.ai/api/public/integrations/google-analytics/select-property \
-H "Authorization: Bearer sk-suada-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"temporaryAccessToken": "temp-token-from-callback",
"propertyId": "123456789",
"externalUserIdentifier": "user-123"
}'
import { Suada } from '@suada/node';
const suada = new Suada({
apiKey: 'your-api-key'
});
const result = await suada.selectIntegrationProperty('google-analytics', {
temporaryAccessToken: 'temp-token-from-callback',
propertyId: '123456789',
externalUserIdentifier: 'user-123'
});
// Redirect user back to their application
window.location.href = result.passthroughRedirectUri;
from suada import Suada, SuadaConfig
suada = Suada(
config=SuadaConfig(
api_key="your-api-key"
)
)
result = suada.select_integration_property(
integration_type="google-analytics",
temporary_access_token="temp-token-from-callback",
property_id="123456789",
external_user_identifier="user-123"
)
# Redirect user back to result.passthrough_redirect_uri
{
"success": true,
"passthroughRedirectUri": "https://your-app.com/oauth/callback"
}
Error Codes
object
Invalid request
{
"error": "Missing required parameters"
}
object
Authentication error
{
"error": "Invalid or expired API key"
}
object
Invalid temporary token
{
"error": "Invalid temporary access token"
}
object
Server error
{
"error": "Failed to select property"
}
Notes
- This endpoint is currently only used for Google Analytics integration
- The
temporaryAccessTokenis received from the callback endpoint - The
propertyIdshould be selected from the list of properties returned in the callback response - After successful property selection, redirect the user to the
passthroughRedirectUri - The integration will be automatically enabled for the user after successful property selection
Was this page helpful?
⌘I