Skip to main content
GET
/
projects
Projekte auflisten
curl --request GET \
  --url https://api.comstruct.com/v1/projects \
  --header 'X-API-Key: <api-key>'
import requests

url = "https://api.comstruct.com/v1/projects"

headers = {"X-API-Key": "<api-key>"}

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

print(response.text)
const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};

fetch('https://api.comstruct.com/v1/projects', 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.comstruct.com/v1/projects",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "X-API-Key: <api-key>"
  ],
]);

$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.comstruct.com/v1/projects"

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

	req.Header.Add("X-API-Key", "<api-key>")

	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.comstruct.com/v1/projects")
  .header("X-API-Key", "<api-key>")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.comstruct.com/v1/projects")

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

request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'

response = http.request(request)
puts response.read_body
{ "projects": [ { "id": "cefa2499-e11d-cada-b423-c3af41ae5232", "title": "Example Site 1", "project_number": "23423420", "description": "Description", "region": "Bavaria", "address": { "address": "Example Street", "city": "Munich", "country": "DE", "house_number": "1", "zip": "80331" }, "alternative_project_number": "ALT-23423420", "legal_entity": { "id": "11111111-1111-1111-1111-111111111111", "title": "Example Legal Entity", "number": "LE-001" }, "external_id": "EXT-001", "active": true }, { "id": "23d12932-2348-345d-b342-2323cd846323", "title": "23043 - Example Site 2", "project_number": null, "description": "Description", "region": "Berlin", "address": { "address": "Sample Avenue", "city": "Berlin", "country": "DE", "house_number": "2", "zip": "10115" }, "alternative_project_number": null, "legal_entity": { "id": "22222222-2222-2222-2222-222222222222", "title": "Sample Legal Entity", "number": "LE-002" }, "external_id": "EXT-002", "active": false } ] }

Authorizations

X-API-Key
string
header
required

API-Schlüssel zur Authentifizierung. Kontaktieren Sie Ihren Customer Success Manager, um einen API-Schlüssel zu erhalten.

Jeder Endpunkt erfordert spezifische Berechtigungen (Scopes); die erforderlichen Scopes werden pro Endpunkt angezeigt.

Query Parameters

limit
integer
default:25

Maximale Anzahl der Projekte pro Seite

Required range: 1 <= x <= 500
offset
integer
default:0

Anzahl der zu überspringenden Projekte für die Paginierung

Required range: x >= 0

Response

Erfolgreich

projects
object[]
total
integer

Gesamtanzahl der Projekte

Example:

150

limit
integer | null

Anzahl der Einträge pro Seite

Example:

25

offset
integer

Anzahl der übersprungenen Einträge

Example:

0

hasNext
boolean

Ob weitere Seiten verfügbar sind

Example:

true

hasPrevious
boolean

Ob vorherige Seiten verfügbar sind

Example:

false

totalPages
integer

Gesamtanzahl der Seiten

Example:

6

currentPage
integer

Aktuelle Seitennummer (0-basiert)

Example:

0