Saltar al contingut principal
GET
/
v1
/
organizations
/
{organization_id}
/
flows
/
{flow_id}
Recuperar un flux
curl --request GET \
  --url https://api.flexxible.net/v1/organizations/{organization_id}/flows/{flow_id} \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.flexxible.net/v1/organizations/{organization_id}/flows/{flow_id}"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://api.flexxible.net/v1/organizations/{organization_id}/flows/{flow_id}', 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.flexxible.net/v1/organizations/{organization_id}/flows/{flow_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.flexxible.net/v1/organizations/{organization_id}/flows/{flow_id}"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("Authorization", "Bearer <token>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.flexxible.net/v1/organizations/{organization_id}/flows/{flow_id}")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.flexxible.net/v1/organizations/{organization_id}/flows/{flow_id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "id": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "name": "<string>",
  "description": "<string>",
  "version": 123,
  "detection_only": true,
  "cooldown_minutes": 123,
  "enabled": true,
  "target": {
    "ids": [
      "<string>"
    ]
  },
  "conditions": [
    {
      "condition_type_id": "<string>",
      "metric": "<string>",
      "operator": "<string>",
      "compare_to": "<string>",
      "check_every": 123,
      "period": 123
    }
  ],
  "trigger": "<string>",
  "microservice_id": "<string>",
  "init_text": "<string>",
  "ok_text": "<string>",
  "ko_text": "<string>",
  "execution_metrics": {
    "targeted_workspaces": 123,
    "evaluations_per_day": 123,
    "possible_executions_per_day": 123,
    "total_possible_executions_per_day": 123
  }
}
{
"error": {
"message": "<string>",
"code": "<string>",
"details": "<string>"
}
}
{
"error": {
"message": "<string>",
"code": "<string>",
"details": "<string>"
}
}
{
"error": {
"message": "<string>",
"code": "<string>",
"details": "<string>"
}
}
{
"error": {
"message": "<string>",
"code": "<string>",
"details": "<string>"
}
}
{
"error": {
"message": "<string>",
"code": "<string>",
"details": "<string>"
}
}

Autoritzacions

Authorization
string
header
requerit

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Capçaleres

Accept-Language
enum<string>
predeterminat:es-ES

Codi de idioma per a camps de text que admeten diversos idiomes. Al crear o actualitzar recursos, això especifica el idioma dels valors de text proporcionats. Al recuperar recursos, això determina quina variant de idioma dels camps de text multilingües es retorna. Valors acceptats: 'en-EN' (anglès), 'es-ES' (espanyol), 'pt-BR' (portuguès), 'ca-ES' (català), 'eu-ES' (euskera). El valor predeterminat és 'es-ES' si no es proporciona.

Opcions disponibles:
en-EN,
es-ES,
pt-BR,
ca-ES,
eu-ES

Paràmetres de ruta

organization_id
string
requerit

El identificador únic de l'organització

Maximum string length: 24
Pattern: ^[0-9a-f]{24}$
flow_id
string
requerit

L'identificador únic del flux

Maximum string length: 24
Pattern: ^[0-9a-f]{24}$

Resposta

Detalls del flux recuperats correctament. La resposta inclou la configuració completa del flux, condicions, destinacions i mètriques d'execució.

Detall del flux tal com el retorna GET flow by id. L'organització està implícita per la ruta /v1/organizations/{organization_id}/flows/{flow_id}. Els workspaces/grups de destinació es normalitzen en target.ids (cadenes hexadecimals de ObjectId de MongoDB).

id
string
requerit
Maximum string length: 24
Pattern: ^[0-9a-f]{24}$
created_at
string<date-time>
requerit
name
string
requerit

Resol per Accept-Language quan és multilingüe

description
string
requerit

Resol per Accept-Language quan és multilingüe

type
enum<string>
requerit
Opcions disponibles:
session,
workspace
version
number
requerit
detection_only
boolean
requerit
cooldown_minutes
number
requerit

Temps d'espera en minuts

enabled
boolean
requerit
target
object
requerit

Destí d'execució: el tipus selecciona l'abast; ids enumera valors de _id de Workspace, _id de grup de Workspace o _id de Grup de reporte (buit quan el tipus és ALL_WORKSPACES)

conditions
object[]

Omitit o buit quan el flux no té condicions

trigger
string | null
microservice_id
string | null

ID del microservei vinculat quan està present

init_text
string | null

Resol per Accept-Language quan és multilingüe

ok_text
string | null

Resol per Accept-Language quan és multilingüe

ko_text
string | null

Resol per Accept-Language quan és multilingüe

execution_metrics
object | null

Present quan es van calcular mètriques per a aquest flux