@extends('web.layouts.web-master')
@section('title', __('static.api.meta_title'))
@section('meta_description', __('static.api.meta_description'))
@php
// Die API läuft zentral über den Publisher-Hub (pressekonto).
$apiBase = rtrim((string) config('domains.domain_portal_url', config('app.url')), '/').'/api/v1';
$host = request()->getHost();
$apiBrandKey = str_contains($host, 'pressekonto')
? 'pressekonto'
: (str_contains($host, 'presseecho') ? 'presseecho' : 'businessportal24');
$apiContactEmail = config('domains.domains.'.$apiBrandKey.'.brand.contact_email') ?? 'info@businessportal24.com';
$endpoints = [
[
'group' => __('static.api.group_releases'),
'items' => [
['method' => 'GET', 'path' => '/press-releases', 'desc' => __('static.api.ep_pr_index'), 'ability' => 'press-releases:read'],
['method' => 'POST', 'path' => '/press-releases', 'desc' => __('static.api.ep_pr_store'), 'ability' => 'press-releases:write'],
['method' => 'GET', 'path' => '/press-releases/{id}', 'desc' => __('static.api.ep_pr_show'), 'ability' => 'press-releases:read'],
['method' => 'PATCH', 'path' => '/press-releases/{id}', 'desc' => __('static.api.ep_pr_update'), 'ability' => 'press-releases:write'],
['method' => 'POST', 'path' => '/press-releases/{id}/submit', 'desc' => __('static.api.ep_pr_submit'), 'ability' => 'press-releases:write'],
['method' => 'DELETE', 'path' => '/press-releases/{id}', 'desc' => __('static.api.ep_pr_destroy'), 'ability' => 'press-releases:write'],
],
],
[
'group' => __('static.api.group_images'),
'items' => [
['method' => 'GET', 'path' => '/press-releases/{id}/images', 'desc' => __('static.api.ep_img_index'), 'ability' => 'press-releases:read'],
['method' => 'POST', 'path' => '/press-releases/{id}/images', 'desc' => __('static.api.ep_img_store'), 'ability' => 'press-release-images:write'],
['method' => 'DELETE', 'path' => '/press-release-images/{imageId}', 'desc' => __('static.api.ep_img_destroy'), 'ability' => 'press-release-images:write'],
],
],
[
'group' => __('static.api.group_master_data'),
'items' => [
['method' => 'GET', 'path' => '/companies', 'desc' => __('static.api.ep_companies_index'), 'ability' => 'companies:read'],
['method' => 'GET', 'path' => '/companies/{id}', 'desc' => __('static.api.ep_companies_show'), 'ability' => 'companies:read'],
['method' => 'GET', 'path' => '/categories', 'desc' => __('static.api.ep_categories_index'), 'ability' => 'press-releases:read'],
],
],
];
$pressReleaseFields = [
['name' => 'portal', 'type' => 'string', 'required' => false, 'desc' => __('static.api.field_portal')],
['name' => 'company_id', 'type' => 'integer', 'required' => true, 'desc' => __('static.api.field_company_id')],
['name' => 'category_id', 'type' => 'integer', 'required' => true, 'desc' => __('static.api.field_category_id')],
['name' => 'language', 'type' => 'string', 'required' => true, 'desc' => __('static.api.field_language')],
['name' => 'title', 'type' => 'string', 'required' => true, 'desc' => __('static.api.field_title')],
['name' => 'text', 'type' => 'string', 'required' => true, 'desc' => __('static.api.field_text')],
['name' => 'backlink_url', 'type' => 'string', 'required' => false, 'desc' => __('static.api.field_backlink_url')],
['name' => 'keywords', 'type' => 'string', 'required' => false, 'desc' => __('static.api.field_keywords')],
['name' => 'teaser_begin / teaser_end', 'type' => 'integer', 'required' => false, 'desc' => __('static.api.field_teaser')],
['name' => 'no_export', 'type' => 'boolean', 'required' => false, 'desc' => __('static.api.field_no_export')],
];
// Bildkennzeichnung Block C: Mit Formular v2 sind Bildnachweis,
// Rechtebestätigung und die Kennung des Wortlauts Pflicht. Die Kennung
// kommt aus dem Textarchiv (aktive Fassung), damit die Doku nie hinterherhinkt.
$imageRightsV2 = (bool) config('images.rights_v2');
$confirmTextVersion = $imageRightsV2 ? app(\App\Services\Image\ImageRightsTextRenderer::class)->current()?->key : null;
$imageMaxMb = $imageRightsV2 ? (int) round((int) config('images.max_bytes') / 1024 / 1024) : 8;
$imageFields = array_values(array_filter([
['name' => 'image', 'type' => 'file', 'required' => true, 'desc' => __('static.api.field_image', ['mb' => $imageMaxMb])],
['name' => 'ai_declaration', 'type' => 'string', 'required' => true, 'desc' => __('static.api.field_image_ai_declaration')],
['name' => 'copyright', 'type' => 'string', 'required' => $imageRightsV2, 'desc' => __('static.api.field_image_copyright')],
$imageRightsV2 ? ['name' => 'rights_confirmed', 'type' => 'boolean', 'required' => true, 'desc' => __('static.api.field_image_rights_confirmed')] : null,
$imageRightsV2 ? ['name' => 'confirm_text_version', 'type' => 'string', 'required' => true, 'desc' => __('static.api.field_image_confirm_text_version', ['version' => $confirmTextVersion ?? '—'])] : null,
['name' => 'title', 'type' => 'string', 'required' => false, 'desc' => __('static.api.field_image_title')],
['name' => 'description', 'type' => 'string', 'required' => false, 'desc' => __('static.api.field_image_description')],
$imageRightsV2 ? ['name' => 'license_url', 'type' => 'string', 'required' => false, 'desc' => __('static.api.field_image_license_url')] : null,
$imageRightsV2 ? ['name' => 'source_url', 'type' => 'string', 'required' => false, 'desc' => __('static.api.field_image_source_url')] : null,
$imageRightsV2 ? ['name' => 'focus_x / focus_y', 'type' => 'integer', 'required' => false, 'desc' => __('static.api.field_image_focus')] : null,
$imageRightsV2 ? ['name' => 'no_crop', 'type' => 'boolean', 'required' => false, 'desc' => __('static.api.field_image_no_crop')] : null,
['name' => 'is_preview', 'type' => 'boolean', 'required' => false, 'desc' => __('static.api.field_image_is_preview')],
]));
$statusCodes = [
['code' => '200 / 201 / 204', 'desc' => __('static.api.status_2xx')],
['code' => '401', 'desc' => __('static.api.status_401')],
['code' => '402', 'desc' => __('static.api.status_402')],
['code' => '403', 'desc' => __('static.api.status_403')],
['code' => '409', 'desc' => __('static.api.status_409')],
['code' => '422', 'desc' => __('static.api.status_422')],
['code' => '429', 'desc' => __('static.api.status_429')],
];
$methodColors = [
'GET' => 'text-[#1F6B3F] bg-[#E7F2EA]',
'POST' => 'text-[#8A4B12] bg-[#F7EBDD]',
'PATCH' => 'text-[#6B4FA1] bg-[#EEE9F7]',
'DELETE' => 'text-[#A13030] bg-[#F7E5E5]',
];
@endphp
@section('content')
{!! __('static.api.basics_text', ['base' => e($apiBase)]) !!} {!! __('static.api.auth_text') !!}
{{ $endpoint['desc'] }}
· {{ __('static.api.permission') }}: {{ __('static.api.quickstart_text') }}
{{ __('static.api.ai_declaration_note') }}
@if ($imageRightsV2)
{{ __('static.api.image_rights_note', ['version' => $confirmTextVersion ?? '—']) }}{{ __('static.api.basics_heading') }}
{{ __('static.api.auth_heading') }}
{{ __('static.api.endpoints_heading') }}
{{ $group['group'] }}
{{ $endpoint['path'] }}
{{ $endpoint['ability'] }}
{{ __('static.api.fields_pr_heading') }}
@foreach ($pressReleaseFields as $field)
{{ __('static.api.th_field') }}
{{ __('static.api.th_type') }}
{{ __('static.api.th_required') }}
{{ __('static.api.th_description') }}
@endforeach
{{ $field['name'] }}
{{ $field['type'] }}
{{ $field['required'] ? __('static.api.required_yes') : '—' }}
{{ $field['desc'] }}
{{ __('static.api.fields_img_heading') }}
@foreach ($imageFields as $field)
{{ __('static.api.th_field') }}
{{ __('static.api.th_type') }}
{{ __('static.api.th_required') }}
{{ __('static.api.th_description') }}
@endforeach
{{ $field['name'] }}
{{ $field['type'] }}
{{ $field['required'] ? __('static.api.required_yes') : '—' }}
{{ $field['desc'] }}
{{ __('static.api.quickstart_heading') }}
{{ __('static.api.quickstart_step_1') }}
curl -X POST {{ $apiBase }}/press-releases \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"company_id": 1,
"category_id": 2,
"language": "de",
"title": "Neue Produktankündigung",
"text": "<p>Unser neues Produkt …</p>"
}'
{{ __('static.api.quickstart_step_2') }}
curl -X POST {{ $apiBase }}/press-releases/123/images \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-F "image=@pressefoto.jpg" \
-F "ai_declaration=original" \
-F "copyright=Mustermann GmbH" \@if ($imageRightsV2)
-F "rights_confirmed=1" \
-F "confirm_text_version={{ $confirmTextVersion ?? 'img-confirm-v2' }}" \@endif
-F "is_preview=1"
{{ __('static.api.quickstart_step_3') }}
curl -X POST {{ $apiBase }}/press-releases/123/submit \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "ai_text_declaration": "none" }'
{{ __('static.api.openapi_note') }} {{ __('static.api.openapi_link') }}.
{{-- Statuscodes --}}| {{ __('static.api.th_code') }} | {{ __('static.api.th_meaning') }} |
|---|---|
| {{ $status['code'] }} | {{ $status['desc'] }} |
{{ __('static.api.cta_text') }} {{ $apiContactEmail }}